{
  "$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"
    },
    "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.read"
    },
    "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"
    },
    "exec.approval.grants.list": {
      "since": "2026.8",
      "scope": "operator.approvals"
    },
    "exec.approval.grants.revoke": {
      "since": "2026.8",
      "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.talk"
    },
    "talk.client.transcript": {
      "since": "<=2026.7",
      "scope": "operator.talk"
    },
    "talk.client.close": {
      "since": "<=2026.7",
      "scope": "operator.talk"
    },
    "talk.client.toolCall": {
      "since": "<=2026.7",
      "scope": "operator.talk"
    },
    "talk.client.steer": {
      "since": "<=2026.7",
      "scope": "operator.talk"
    },
    "talk.session.create": {
      "since": "<=2026.7",
      "scope": "operator.talk"
    },
    "talk.session.appendAudio": {
      "since": "<=2026.7",
      "scope": "operator.talk"
    },
    "talk.session.cancelOutput": {
      "since": "<=2026.7",
      "scope": "operator.talk"
    },
    "talk.session.acknowledgeMark": {
      "since": "<=2026.7",
      "scope": "operator.talk"
    },
    "talk.session.submitToolResult": {
      "since": "<=2026.7",
      "scope": "operator.talk"
    },
    "talk.session.steer": {
      "since": "<=2026.7",
      "scope": "operator.talk"
    },
    "talk.session.close": {
      "since": "<=2026.7",
      "scope": "operator.talk"
    },
    "talk.speak": {
      "since": "<=2026.7",
      "scope": "operator.talk"
    },
    "talk.mode": {
      "since": "<=2026.7",
      "scope": "operator.talk"
    },
    "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"
    },
    "users.setRole": {
      "since": "2026.8",
      "scope": "operator.admin"
    },
    "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": "dynamic"
    },
    "worktrees.create": {
      "since": "2026.7",
      "scope": "operator.write"
    },
    "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"
    },
    "sessions.list": {
      "since": "<=2026.7",
      "scope": "operator.read"
    },
    "sessions.subscribe": {
      "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.viewers.set": {
      "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.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.recover": {
      "since": "2026.8",
      "scope": "operator.write"
    },
    "sessions.send": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "sessions.abort": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "sessions.patch": {
      "since": "<=2026.7",
      "scope": "dynamic"
    },
    "sessions.goal.update": {
      "since": "2026.8",
      "scope": "operator.write"
    },
    "sessions.goal.clear": {
      "since": "2026.8",
      "scope": "operator.write"
    },
    "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.defaults": {
      "since": "2026.8",
      "scope": "operator.write"
    },
    "sessions.groups.put": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "sessions.groups.rename": {
      "since": "<=2026.7",
      "scope": "operator.write"
    },
    "sessions.groups.update": {
      "since": "2026.8",
      "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"
    },
    "device.pair.setupStatus": {
      "since": "2026.8",
      "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.runnerInventory.update": {
      "since": "2026.8",
      "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"
    },
    "push.web.preferences.get": {
      "since": "2026.8",
      "scope": "operator.read"
    },
    "push.web.preferences.set": {
      "since": "2026.8",
      "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"
    },
    "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.subscribe": {
      "since": "2026.7",
      "scope": "operator.read"
    },
    "controlUi.sessionPreview": {
      "since": "2026.8",
      "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": "dynamic"
    },
    "sessions.reclaim": {
      "since": "2026.7",
      "scope": "operator.write"
    },
    "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"
    },
    "memory.search": {
      "since": "2026.7",
      "scope": "operator.read"
    },
    "skills.proposals.events.list": {
      "since": "2026.7",
      "scope": "operator.read"
    },
    "skills.proposals.evaluate": {
      "since": "2026.7",
      "scope": "operator.admin"
    },
    "hooks.status": {
      "since": "2026.7",
      "scope": "operator.read"
    },
    "tasks.retry": {
      "since": "2026.7",
      "scope": "operator.write"
    },
    "tasks.dismiss": {
      "since": "2026.7",
      "scope": "operator.write"
    },
    "audit.run.inspect": {
      "since": "2026.7",
      "scope": "operator.read"
    },
    "sessions.patchMany": {
      "since": "2026.8",
      "scope": "dynamic"
    },
    "update.hold": {
      "since": "2026.8",
      "scope": "operator.admin"
    },
    "sessions.catalog.startTerminal": {
      "since": "2026.8",
      "scope": "operator.admin"
    },
    "worker.desktop.observe": {
      "since": "2026.8",
      "scope": "operator.admin"
    },
    "projects.list": {
      "since": "2026.8",
      "scope": "operator.read"
    },
    "projects.register": {
      "since": "2026.8",
      "scope": "operator.admin"
    },
    "projects.remove": {
      "since": "2026.8",
      "scope": "operator.admin"
    },
    "worker.desktop.launch": {
      "since": "2026.8",
      "scope": "operator.admin"
    },
    "secrets.store.list": {
      "since": "2026.8",
      "scope": "operator.admin"
    },
    "secrets.store.set": {
      "since": "2026.8",
      "scope": "operator.admin"
    },
    "secrets.store.delete": {
      "since": "2026.8",
      "scope": "operator.admin"
    },
    "users.prefs.get": {
      "since": "2026.8",
      "scope": "operator.read"
    },
    "users.prefs.set": {
      "since": "2026.8",
      "scope": "operator.write"
    },
    "projects.add": {
      "since": "2026.8",
      "scope": "operator.write"
    },
    "projects.searchRemote": {
      "since": "2026.8",
      "scope": "operator.read"
    },
    "desktop.observe": {
      "since": "2026.8",
      "scope": "operator.admin"
    },
    "desktop.launch": {
      "since": "2026.8",
      "scope": "operator.admin"
    },
    "device.scopes.requestUpgrade": {
      "since": "2026.8",
      "scope": "operator.read"
    },
    "device.scopes.waitUpgrade": {
      "since": "2026.8",
      "scope": "operator.read"
    },
    "portal.list": {
      "since": "2026.8",
      "scope": "operator.read"
    },
    "portal.open": {
      "since": "2026.8",
      "scope": "operator.write"
    },
    "portal.close": {
      "since": "2026.8",
      "scope": "operator.write"
    },
    "sessions.move": {
      "since": "2026.8",
      "scope": "dynamic"
    },
    "sessions.assignOwner": {
      "since": "2026.8",
      "scope": "operator.write"
    },
    "progressCard.get": {
      "since": "2026.8",
      "scope": "operator.read"
    },
    "progressCard.put": {
      "since": "2026.8",
      "scope": "operator.write"
    },
    "tools.github.status": {
      "since": "2026.8",
      "scope": "operator.read"
    },
    "tools.github.configure": {
      "since": "2026.8",
      "scope": "operator.admin"
    },
    "tools.github.authorize.start": {
      "since": "2026.8",
      "scope": "operator.admin"
    },
    "tools.github.authorize.poll": {
      "since": "2026.8",
      "scope": "operator.admin"
    },
    "tools.github.authorize.cancel": {
      "since": "2026.8",
      "scope": "operator.admin"
    },
    "sessions.github.publish": {
      "since": "2026.8",
      "scope": "operator.write"
    },
    "diagnostics.lanes": {
      "since": "2026.8",
      "scope": "operator.read"
    },
    "session.members.listEvidence": {
      "since": "2026.8",
      "scope": "operator.read"
    },
    "plugins.inspect": {
      "since": "2026.8",
      "scope": "operator.read"
    }
  },
  "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"
            }
          ]
        },
        "contentOwner": {
          "enum": [
            "html",
            "mcp-app",
            "plugin",
            "registered"
          ],
          "type": "string"
        },
        "registeredContentKind": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,31}$"
        },
        "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"
        },
        "kindLabel": {
          "type": "string",
          "minLength": 1,
          "maxLength": 80
        }
      },
      "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"
                  }
                ]
              },
              "contentOwner": {
                "enum": [
                  "html",
                  "mcp-app",
                  "plugin",
                  "registered"
                ],
                "type": "string"
              },
              "registeredContentKind": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9-]{0,31}$"
              },
              "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"
              },
              "kindLabel": {
                "type": "string",
                "minLength": 1,
                "maxLength": 80
              }
            },
            "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
    },
    "BoardWidgetRegisteredContent": {
      "type": "object",
      "required": [
        "kind",
        "contentKind",
        "source"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "const": "registered"
        },
        "contentKind": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9-]{0,31}$"
        },
        "source": {
          "type": "string",
          "maxLength": 262144
        }
      },
      "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
        },
        {
          "type": "object",
          "required": [
            "kind",
            "contentKind",
            "source"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "registered"
            },
            "contentKind": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9-]{0,31}$"
            },
            "source": {
              "type": "string",
              "maxLength": 262144
            }
          },
          "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",
            "contentKind",
            "source"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "registered"
            },
            "contentKind": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9-]{0,31}$"
            },
            "source": {
              "type": "string",
              "maxLength": 262144
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "kind",
            "docId"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "canvas-doc"
            },
            "docId": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "BoardWidgetGeneratedIdentity": {
      "type": "object",
      "required": [
        "source",
        "key",
        "fallbackName"
      ],
      "properties": {
        "source": {
          "type": "string",
          "const": "show_widget"
        },
        "key": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "fallbackName": {
          "type": "string",
          "pattern": "^[a-z0-9][a-z0-9._-]{0,63}$"
        }
      },
      "additionalProperties": false
    },
    "BoardGetParams": {
      "type": "object",
      "required": [
        "sessionKey"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "BoardUpdateParams": {
      "type": "object",
      "required": [
        "sessionKey",
        "ops"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "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
        },
        "agentId": {
          "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",
                "contentKind",
                "source"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "registered"
                },
                "contentKind": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9-]{0,31}$"
                },
                "source": {
                  "type": "string",
                  "maxLength": 262144
                }
              },
              "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
        },
        "generatedIdentity": {
          "type": "object",
          "required": [
            "source",
            "key",
            "fallbackName"
          ],
          "properties": {
            "source": {
              "type": "string",
              "const": "show_widget"
            },
            "key": {
              "type": "string",
              "pattern": "^[a-f0-9]{64}$"
            },
            "fallbackName": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9._-]{0,63}$"
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "BoardWidgetPutResult": {
      "type": "object",
      "required": [
        "sessionKey",
        "revision",
        "tabs",
        "widgets",
        "resolvedWidgetName"
      ],
      "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"
                  }
                ]
              },
              "contentOwner": {
                "enum": [
                  "html",
                  "mcp-app",
                  "plugin",
                  "registered"
                ],
                "type": "string"
              },
              "registeredContentKind": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9-]{0,31}$"
              },
              "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"
              },
              "kindLabel": {
                "type": "string",
                "minLength": 1,
                "maxLength": 80
              }
            },
            "additionalProperties": false
          }
        },
        "resolvedWidgetName": {
          "type": "string",
          "pattern": "^[a-z0-9][a-z0-9._-]{0,63}$"
        }
      },
      "additionalProperties": false
    },
    "BoardWidgetGrantParams": {
      "type": "object",
      "required": [
        "sessionKey",
        "name",
        "decision",
        "revision",
        "instanceId"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "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
        },
        "agentId": {
          "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
            },
            "agentId": {
              "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"
        }
      ]
    },
    "ProgressCardStepStatus": {
      "anyOf": [
        {
          "type": "string",
          "const": "pending"
        },
        {
          "type": "string",
          "const": "in_progress"
        },
        {
          "type": "string",
          "const": "completed"
        }
      ]
    },
    "ProgressCardStep": {
      "type": "object",
      "required": [
        "step",
        "status"
      ],
      "properties": {
        "step": {
          "type": "string",
          "minLength": 1
        },
        "status": {
          "anyOf": [
            {
              "type": "string",
              "const": "pending"
            },
            {
              "type": "string",
              "const": "in_progress"
            },
            {
              "type": "string",
              "const": "completed"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "ProgressCard": {
      "type": "object",
      "required": [
        "sessionKey",
        "revision",
        "updatedAt"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "revision": {
          "type": "integer",
          "minimum": 1
        },
        "updatedAt": {
          "type": "integer"
        },
        "markdown": {
          "type": "string"
        },
        "steps": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "step",
              "status"
            ],
            "properties": {
              "step": {
                "type": "string",
                "minLength": 1
              },
              "status": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "pending"
                  },
                  {
                    "type": "string",
                    "const": "in_progress"
                  },
                  {
                    "type": "string",
                    "const": "completed"
                  }
                ]
              }
            },
            "additionalProperties": false
          },
          "maxItems": 50
        }
      },
      "additionalProperties": false
    },
    "ProgressCardGetParams": {
      "type": "object",
      "required": [
        "sessionKey"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "ProgressCardGetResult": {
      "type": "object",
      "required": [
        "card"
      ],
      "properties": {
        "card": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "sessionKey",
                "revision",
                "updatedAt"
              ],
              "properties": {
                "sessionKey": {
                  "type": "string",
                  "minLength": 1
                },
                "revision": {
                  "type": "integer",
                  "minimum": 1
                },
                "updatedAt": {
                  "type": "integer"
                },
                "markdown": {
                  "type": "string"
                },
                "steps": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "step",
                      "status"
                    ],
                    "properties": {
                      "step": {
                        "type": "string",
                        "minLength": 1
                      },
                      "status": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "pending"
                          },
                          {
                            "type": "string",
                            "const": "in_progress"
                          },
                          {
                            "type": "string",
                            "const": "completed"
                          }
                        ]
                      }
                    },
                    "additionalProperties": false
                  },
                  "maxItems": 50
                }
              },
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "ProgressCardPutParams": {
      "type": "object",
      "required": [
        "sessionKey"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "markdown": {
          "type": "string"
        },
        "plan": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "step",
              "status"
            ],
            "properties": {
              "step": {
                "type": "string",
                "minLength": 1
              },
              "status": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "pending"
                  },
                  {
                    "type": "string",
                    "const": "in_progress"
                  },
                  {
                    "type": "string",
                    "const": "completed"
                  }
                ]
              }
            },
            "additionalProperties": false
          },
          "maxItems": 50
        },
        "expectedRevision": {
          "type": "integer",
          "minimum": 1
        }
      },
      "additionalProperties": false
    },
    "ProgressCardPutResult": {
      "type": "object",
      "required": [
        "card"
      ],
      "properties": {
        "card": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "sessionKey",
                "revision",
                "updatedAt"
              ],
              "properties": {
                "sessionKey": {
                  "type": "string",
                  "minLength": 1
                },
                "revision": {
                  "type": "integer",
                  "minimum": 1
                },
                "updatedAt": {
                  "type": "integer"
                },
                "markdown": {
                  "type": "string"
                },
                "steps": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "step",
                      "status"
                    ],
                    "properties": {
                      "step": {
                        "type": "string",
                        "minLength": 1
                      },
                      "status": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "pending"
                          },
                          {
                            "type": "string",
                            "const": "in_progress"
                          },
                          {
                            "type": "string",
                            "const": "completed"
                          }
                        ]
                      }
                    },
                    "additionalProperties": false
                  },
                  "maxItems": 50
                }
              },
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "ProgressCardChangedEvent": {
      "type": "object",
      "required": [
        "sessionKey",
        "revision"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "revision": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "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
            },
            "buildId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 96
            },
            "platform": {
              "type": "string",
              "minLength": 1
            },
            "deviceFamily": {
              "type": "string",
              "minLength": 1
            },
            "modelIdentifier": {
              "type": "string",
              "minLength": 1
            },
            "timeZone": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "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
          }
        },
        "computerUse": {},
        "workerRuns": {
          "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
            },
            "bundlePrewarm": {
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            }
          },
          "additionalProperties": false,
          "x-openclaw-since": "2026.7"
        },
        "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
        },
        "bundlePrewarm": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        }
      },
      "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
            },
            "buildId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 96
            },
            "bootId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 96
            },
            "controlUiBuildSource": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "bundled"
                },
                {
                  "type": "string",
                  "const": "configured"
                }
              ]
            },
            "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
                  },
                  "timeZone": {
                    "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
                  },
                  "onlineSince": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "lastActivityAt": {
                    "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
                      },
                      "identity": {
                        "type": "object",
                        "required": [
                          "type",
                          "id"
                        ],
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "profile"
                          },
                          "id": {
                            "type": "string",
                            "minLength": 1
                          }
                        },
                        "additionalProperties": false
                      },
                      "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"
                    },
                    "degradedSinceMs": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "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
                      }
                    },
                    "ingressFailed": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "channelId",
                          "accountId",
                          "count"
                        ],
                        "properties": {
                          "channelId": {
                            "type": "string"
                          },
                          "accountId": {
                            "type": "string"
                          },
                          "count": {
                            "type": "integer",
                            "minimum": 0
                          },
                          "oldestFailedAt": {
                            "type": "integer",
                            "minimum": 0
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "ingressPressure": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "channelId",
                          "accountId",
                          "laneCount",
                          "pendingCount",
                          "claimedCount",
                          "blockedCount",
                          "oldestReceivedAt"
                        ],
                        "properties": {
                          "channelId": {
                            "type": "string"
                          },
                          "accountId": {
                            "type": "string"
                          },
                          "laneCount": {
                            "type": "integer",
                            "minimum": 0
                          },
                          "pendingCount": {
                            "type": "integer",
                            "minimum": 0
                          },
                          "claimedCount": {
                            "type": "integer",
                            "minimum": 0
                          },
                          "blockedCount": {
                            "type": "integer",
                            "minimum": 0
                          },
                          "oldestReceivedAt": {
                            "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"
                          },
                          "session": {
                            "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
                },
                "modelConfigured": {
                  "type": "boolean"
                },
                "ownership": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "sole"
                    },
                    {
                      "type": "string",
                      "const": "legacy"
                    },
                    {
                      "type": "string",
                      "const": "explicit"
                    }
                  ]
                },
                "selectionRequired": {
                  "type": "boolean"
                },
                "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
                },
                "currentSha": {
                  "type": "string",
                  "minLength": 1
                },
                "upstreamRef": {
                  "type": "string",
                  "minLength": 1
                },
                "upstreamSha": {
                  "type": "string",
                  "minLength": 1
                },
                "commitsBehind": {
                  "type": "integer",
                  "minimum": 0
                },
                "commits": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "sha",
                      "subject"
                    ],
                    "properties": {
                      "sha": {
                        "type": "string",
                        "minLength": 1
                      },
                      "subject": {
                        "type": "string",
                        "maxLength": 120
                      }
                    },
                    "additionalProperties": false
                  },
                  "maxItems": 5
                }
              },
              "additionalProperties": false
            },
            "updateSchedule": {
              "type": "object",
              "required": [
                "channel",
                "autoEnabled"
              ],
              "properties": {
                "channel": {
                  "type": "string",
                  "minLength": 1
                },
                "autoEnabled": {
                  "type": "boolean"
                },
                "install": {
                  "type": "object",
                  "required": [
                    "kind"
                  ],
                  "properties": {
                    "kind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "package"
                        },
                        {
                          "type": "string",
                          "const": "git"
                        },
                        {
                          "type": "string",
                          "const": "unknown"
                        }
                      ]
                    },
                    "git": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "status"
                          ],
                          "properties": {
                            "currentSha": {
                              "type": "string",
                              "minLength": 1
                            },
                            "commitAtMs": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "installedAtMs": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "status": {
                              "type": "string",
                              "const": "current"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "status",
                            "commitsBehind"
                          ],
                          "properties": {
                            "currentSha": {
                              "type": "string",
                              "minLength": 1
                            },
                            "commitAtMs": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "installedAtMs": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "status": {
                              "type": "string",
                              "const": "behind"
                            },
                            "commitsBehind": {
                              "type": "integer",
                              "minimum": 1
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "status",
                            "commitsAhead"
                          ],
                          "properties": {
                            "currentSha": {
                              "type": "string",
                              "minLength": 1
                            },
                            "commitAtMs": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "installedAtMs": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "status": {
                              "type": "string",
                              "const": "ahead"
                            },
                            "commitsAhead": {
                              "type": "integer",
                              "minimum": 1
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "status",
                            "commitsAhead",
                            "commitsBehind"
                          ],
                          "properties": {
                            "currentSha": {
                              "type": "string",
                              "minLength": 1
                            },
                            "commitAtMs": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "installedAtMs": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "status": {
                              "type": "string",
                              "const": "diverged"
                            },
                            "commitsAhead": {
                              "type": "integer",
                              "minimum": 1
                            },
                            "commitsBehind": {
                              "type": "integer",
                              "minimum": 1
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "status",
                            "reason"
                          ],
                          "properties": {
                            "currentSha": {
                              "type": "string",
                              "minLength": 1
                            },
                            "commitAtMs": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "installedAtMs": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "status": {
                              "type": "string",
                              "const": "unavailable"
                            },
                            "reason": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "fetch-failed"
                                },
                                {
                                  "type": "string",
                                  "const": "no-upstream"
                                },
                                {
                                  "type": "string",
                                  "const": "no-upstream-sha"
                                },
                                {
                                  "type": "string",
                                  "const": "comparison-failed"
                                },
                                {
                                  "type": "string",
                                  "const": "git-unavailable"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                },
                "target": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "version"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "package"
                        },
                        "version": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "upstreamRef",
                        "upstreamSha",
                        "commitsBehind"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "git"
                        },
                        "upstreamRef": {
                          "type": "string",
                          "minLength": 1
                        },
                        "upstreamSha": {
                          "type": "string",
                          "minLength": 1
                        },
                        "commitsBehind": {
                          "type": "integer",
                          "minimum": 0
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                },
                "campaign": {
                  "type": "object",
                  "required": [
                    "id",
                    "state",
                    "announcedAtMs",
                    "forceAtMs",
                    "updatedAtMs"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "minLength": 1
                    },
                    "state": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "waiting-for-idle"
                        },
                        {
                          "type": "string",
                          "const": "countdown"
                        },
                        {
                          "type": "string",
                          "const": "applying"
                        }
                      ]
                    },
                    "announcedAtMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "applyAtMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "holdUntilMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "forceAtMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "updatedAtMs": {
                      "type": "integer",
                      "minimum": 0
                    }
                  },
                  "additionalProperties": false
                }
              },
              "additionalProperties": false
            }
          },
          "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"
              },
              "placement": {
                "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
            }
          }
        },
        "auth": {
          "type": "object",
          "required": [
            "role",
            "scopes"
          ],
          "properties": {
            "deviceToken": {
              "type": "string",
              "minLength": 1
            },
            "recoveryMigrationAllowed": {
              "type": "boolean",
              "const": true
            },
            "recoveryScope": {
              "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
            },
            "attachments": {
              "type": "object",
              "required": [
                "maxBytes",
                "maxImageBytes"
              ],
              "properties": {
                "maxBytes": {
                  "type": "integer",
                  "minimum": 1
                },
                "maxImageBytes": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "additionalProperties": false
            },
            "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": {},
        "traceparent": {
          "type": "string",
          "maxLength": 128
        }
      },
      "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": {},
            "traceparent": {
              "type": "string",
              "maxLength": 128
            }
          },
          "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
        },
        "timeZone": {
          "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
        },
        "onlineSince": {
          "type": "integer",
          "minimum": 0
        },
        "lastActivityAt": {
          "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
            },
            "identity": {
              "type": "object",
              "required": [
                "type",
                "id"
              ],
              "properties": {
                "type": {
                  "type": "string",
                  "const": "profile"
                },
                "id": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            "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
              },
              "timeZone": {
                "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
              },
              "onlineSince": {
                "type": "integer",
                "minimum": 0
              },
              "lastActivityAt": {
                "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
                  },
                  "identity": {
                    "type": "object",
                    "required": [
                      "type",
                      "id"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "profile"
                      },
                      "id": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "additionalProperties": false
                  },
                  "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"
                },
                "degradedSinceMs": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 0
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "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
                  }
                },
                "ingressFailed": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "channelId",
                      "accountId",
                      "count"
                    ],
                    "properties": {
                      "channelId": {
                        "type": "string"
                      },
                      "accountId": {
                        "type": "string"
                      },
                      "count": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "oldestFailedAt": {
                        "type": "integer",
                        "minimum": 0
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "ingressPressure": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "channelId",
                      "accountId",
                      "laneCount",
                      "pendingCount",
                      "claimedCount",
                      "blockedCount",
                      "oldestReceivedAt"
                    ],
                    "properties": {
                      "channelId": {
                        "type": "string"
                      },
                      "accountId": {
                        "type": "string"
                      },
                      "laneCount": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "pendingCount": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "claimedCount": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "blockedCount": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "oldestReceivedAt": {
                        "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"
                      },
                      "session": {
                        "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
            },
            "modelConfigured": {
              "type": "boolean"
            },
            "ownership": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "sole"
                },
                {
                  "type": "string",
                  "const": "legacy"
                },
                {
                  "type": "string",
                  "const": "explicit"
                }
              ]
            },
            "selectionRequired": {
              "type": "boolean"
            },
            "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
            },
            "currentSha": {
              "type": "string",
              "minLength": 1
            },
            "upstreamRef": {
              "type": "string",
              "minLength": 1
            },
            "upstreamSha": {
              "type": "string",
              "minLength": 1
            },
            "commitsBehind": {
              "type": "integer",
              "minimum": 0
            },
            "commits": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "sha",
                  "subject"
                ],
                "properties": {
                  "sha": {
                    "type": "string",
                    "minLength": 1
                  },
                  "subject": {
                    "type": "string",
                    "maxLength": 120
                  }
                },
                "additionalProperties": false
              },
              "maxItems": 5
            }
          },
          "additionalProperties": false
        },
        "updateSchedule": {
          "type": "object",
          "required": [
            "channel",
            "autoEnabled"
          ],
          "properties": {
            "channel": {
              "type": "string",
              "minLength": 1
            },
            "autoEnabled": {
              "type": "boolean"
            },
            "install": {
              "type": "object",
              "required": [
                "kind"
              ],
              "properties": {
                "kind": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "package"
                    },
                    {
                      "type": "string",
                      "const": "git"
                    },
                    {
                      "type": "string",
                      "const": "unknown"
                    }
                  ]
                },
                "git": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "status"
                      ],
                      "properties": {
                        "currentSha": {
                          "type": "string",
                          "minLength": 1
                        },
                        "commitAtMs": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "installedAtMs": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "status": {
                          "type": "string",
                          "const": "current"
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "commitsBehind"
                      ],
                      "properties": {
                        "currentSha": {
                          "type": "string",
                          "minLength": 1
                        },
                        "commitAtMs": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "installedAtMs": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "status": {
                          "type": "string",
                          "const": "behind"
                        },
                        "commitsBehind": {
                          "type": "integer",
                          "minimum": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "commitsAhead"
                      ],
                      "properties": {
                        "currentSha": {
                          "type": "string",
                          "minLength": 1
                        },
                        "commitAtMs": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "installedAtMs": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "status": {
                          "type": "string",
                          "const": "ahead"
                        },
                        "commitsAhead": {
                          "type": "integer",
                          "minimum": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "commitsAhead",
                        "commitsBehind"
                      ],
                      "properties": {
                        "currentSha": {
                          "type": "string",
                          "minLength": 1
                        },
                        "commitAtMs": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "installedAtMs": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "status": {
                          "type": "string",
                          "const": "diverged"
                        },
                        "commitsAhead": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "commitsBehind": {
                          "type": "integer",
                          "minimum": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "reason"
                      ],
                      "properties": {
                        "currentSha": {
                          "type": "string",
                          "minLength": 1
                        },
                        "commitAtMs": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "installedAtMs": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "status": {
                          "type": "string",
                          "const": "unavailable"
                        },
                        "reason": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "fetch-failed"
                            },
                            {
                              "type": "string",
                              "const": "no-upstream"
                            },
                            {
                              "type": "string",
                              "const": "no-upstream-sha"
                            },
                            {
                              "type": "string",
                              "const": "comparison-failed"
                            },
                            {
                              "type": "string",
                              "const": "git-unavailable"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                }
              },
              "additionalProperties": false
            },
            "target": {
              "anyOf": [
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "version"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "package"
                    },
                    "version": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "upstreamRef",
                    "upstreamSha",
                    "commitsBehind"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "git"
                    },
                    "upstreamRef": {
                      "type": "string",
                      "minLength": 1
                    },
                    "upstreamSha": {
                      "type": "string",
                      "minLength": 1
                    },
                    "commitsBehind": {
                      "type": "integer",
                      "minimum": 0
                    }
                  },
                  "additionalProperties": false
                }
              ]
            },
            "campaign": {
              "type": "object",
              "required": [
                "id",
                "state",
                "announcedAtMs",
                "forceAtMs",
                "updatedAtMs"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1
                },
                "state": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "waiting-for-idle"
                    },
                    {
                      "type": "string",
                      "const": "countdown"
                    },
                    {
                      "type": "string",
                      "const": "applying"
                    }
                  ]
                },
                "announcedAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "applyAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "holdUntilMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "forceAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "updatedAtMs": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        }
      },
      "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
    },
    "CronJobNotFoundErrorDetails": {
      "type": "object",
      "required": [
        "code",
        "jobId"
      ],
      "properties": {
        "code": {
          "type": "string",
          "const": "CRON_JOB_NOT_FOUND"
        },
        "jobId": {
          "type": "string",
          "minLength": 1
        }
      },
      "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
    },
    "OutboundDeliveryQueuedErrorDetails": {
      "type": "object",
      "required": [
        "code"
      ],
      "properties": {
        "code": {
          "type": "string",
          "const": "OUTBOUND_DELIVERY_QUEUED"
        }
      },
      "additionalProperties": false
    },
    "SkillProposalRevisionChangedErrorDetails": {
      "type": "object",
      "required": [
        "code",
        "expectedRevisionHash",
        "currentRevisionHash"
      ],
      "properties": {
        "code": {
          "type": "string",
          "const": "SKILL_PROPOSAL_REVISION_CHANGED"
        },
        "expectedRevisionHash": {
          "type": "string",
          "pattern": "^[a-fA-F0-9]{64}$"
        },
        "currentRevisionHash": {
          "type": "string",
          "pattern": "^[a-fA-F0-9]{64}$"
        }
      },
      "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
    },
    "SetupAdmissionBusyErrorDetails": {
      "type": "object",
      "required": [
        "code"
      ],
      "properties": {
        "code": {
          "type": "string",
          "const": "SETUP_ADMISSION_BUSY"
        }
      },
      "additionalProperties": false
    },
    "GatewayErrorDetails": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "code",
            "jobId"
          ],
          "properties": {
            "code": {
              "type": "string",
              "const": "CRON_JOB_NOT_FOUND"
            },
            "jobId": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        {
          "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"
          ],
          "properties": {
            "code": {
              "type": "string",
              "const": "OUTBOUND_DELIVERY_QUEUED"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code",
            "limit",
            "currentCount"
          ],
          "properties": {
            "code": {
              "type": "string",
              "const": "USER_PREFS_LIMIT_EXCEEDED"
            },
            "limit": {
              "type": "integer",
              "minimum": 1
            },
            "currentCount": {
              "type": "integer",
              "minimum": 0
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code",
            "expectedRevisionHash",
            "currentRevisionHash"
          ],
          "properties": {
            "code": {
              "type": "string",
              "const": "SKILL_PROPOSAL_REVISION_CHANGED"
            },
            "expectedRevisionHash": {
              "type": "string",
              "pattern": "^[a-fA-F0-9]{64}$"
            },
            "currentRevisionHash": {
              "type": "string",
              "pattern": "^[a-fA-F0-9]{64}$"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "code",
            "cause"
          ],
          "properties": {
            "code": {
              "type": "string",
              "const": "PROJECT_CLONE_FAILED"
            },
            "cause": {
              "type": "string",
              "enum": [
                "invalid_url",
                "auth_required",
                "not_found",
                "network",
                "target_exists",
                "clone_failed"
              ]
            }
          },
          "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
        },
        {
          "type": "object",
          "required": [
            "code"
          ],
          "properties": {
            "code": {
              "type": "string",
              "const": "SETUP_ADMISSION_BUSY"
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "ProjectCloneErrorDetails": {
      "type": "object",
      "required": [
        "code",
        "cause"
      ],
      "properties": {
        "code": {
          "type": "string",
          "const": "PROJECT_CLONE_FAILED"
        },
        "cause": {
          "type": "string",
          "enum": [
            "invalid_url",
            "auth_required",
            "not_found",
            "network",
            "target_exists",
            "clone_failed"
          ]
        }
      },
      "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"
        },
        "terminalPolicy": {
          "anyOf": [
            {
              "type": "string",
              "const": "preserve"
            },
            {
              "type": "string",
              "const": "terminate"
            }
          ]
        },
        "drain": {
          "type": "boolean"
        }
      },
      "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
    },
    "GatewaySuspendPrepareDrainingResult": {
      "type": "object",
      "required": [
        "status",
        "suspensionId",
        "expiresAtMs",
        "retryAfterMs",
        "activeCount",
        "blockers"
      ],
      "properties": {
        "status": {
          "type": "string",
          "const": "draining"
        },
        "suspensionId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "\\S"
        },
        "expiresAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "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",
            "retryAfterMs",
            "activeCount",
            "blockers"
          ],
          "properties": {
            "status": {
              "type": "string",
              "const": "draining"
            },
            "suspensionId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "\\S"
            },
            "expiresAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "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
    },
    "GatewaySuspendStatusDrainingResult": {
      "type": "object",
      "required": [
        "status",
        "expiresAtMs",
        "retryAfterMs",
        "activeCount",
        "blockers"
      ],
      "properties": {
        "status": {
          "type": "string",
          "const": "draining"
        },
        "expiresAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "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
    },
    "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",
            "retryAfterMs",
            "activeCount",
            "blockers"
          ],
          "properties": {
            "status": {
              "type": "string",
              "const": "draining"
            },
            "expiresAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "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",
            "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
    },
    "UserPrefsLimitExceededErrorDetails": {
      "type": "object",
      "required": [
        "code",
        "limit",
        "currentCount"
      ],
      "properties": {
        "code": {
          "type": "string",
          "const": "USER_PREFS_LIMIT_EXCEEDED"
        },
        "limit": {
          "type": "integer",
          "minimum": 1
        },
        "currentCount": {
          "type": "integer",
          "minimum": 0
        }
      },
      "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"
        }
      ]
    },
    "WorkerDesktopAppId": {
      "anyOf": [
        {
          "type": "string",
          "const": "browser"
        },
        {
          "type": "string",
          "const": "terminal"
        }
      ]
    },
    "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"
            }
          ]
        },
        "error": {
          "type": "string",
          "minLength": 1
        },
        "desktop": {
          "type": "boolean"
        },
        "desktopApps": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "string",
                "const": "browser"
              },
              {
                "type": "string",
                "const": "terminal"
              }
            ]
          },
          "maxItems": 8,
          "uniqueItems": true
        }
      },
      "additionalProperties": false
    },
    "WorkerSlotSummary": {
      "type": "object",
      "required": [
        "total",
        "available"
      ],
      "properties": {
        "total": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1024
        },
        "available": {
          "type": "integer",
          "minimum": 0,
          "maximum": 1024
        }
      },
      "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"
          ]
        },
        "platform": {
          "type": "string",
          "minLength": 1
        },
        "sessionHost": {
          "type": "boolean"
        },
        "workerSlots": {
          "type": "object",
          "required": [
            "total",
            "available"
          ],
          "properties": {
            "total": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1024
            },
            "available": {
              "type": "integer",
              "minimum": 0,
              "maximum": 1024
            }
          },
          "additionalProperties": false
        },
        "workerBundle": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "status",
                "version"
              ],
              "properties": {
                "status": {
                  "type": "string",
                  "const": "installed"
                },
                "version": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "status"
              ],
              "properties": {
                "status": {
                  "type": "string",
                  "const": "missing"
                }
              },
              "additionalProperties": false
            }
          ]
        },
        "lastConnectedAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "lastDisconnectedAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "lastSeenAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "lastSeenReason": {
          "type": "string",
          "minLength": 1
        },
        "trust": {
          "type": "string",
          "enum": [
            "persistent",
            "disposable"
          ]
        },
        "capabilities": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "invocableCommands": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "maxItems": 128,
          "uniqueItems": true
        },
        "desktop": {
          "type": "boolean"
        },
        "issues": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "code",
              "action",
              "updateCommand",
              "headlessReconnectCommand"
            ],
            "properties": {
              "code": {
                "type": "string",
                "const": "update-required"
              },
              "action": {
                "type": "string",
                "const": "update-and-reconnect"
              },
              "updateCommand": {
                "type": "string",
                "const": "openclaw update"
              },
              "headlessReconnectCommand": {
                "type": "string",
                "const": "openclaw node restart"
              }
            },
            "additionalProperties": false
          },
          "minItems": 1,
          "maxItems": 8
        },
        "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"
                }
              ]
            },
            "error": {
              "type": "string",
              "minLength": 1
            },
            "desktop": {
              "type": "boolean"
            },
            "desktopApps": {
              "type": "array",
              "items": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "browser"
                  },
                  {
                    "type": "string",
                    "const": "terminal"
                  }
                ]
              },
              "maxItems": 8,
              "uniqueItems": true
            }
          },
          "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"
          ]
        },
        "platform": {
          "type": "string",
          "minLength": 1
        },
        "sessionHost": {
          "type": "boolean"
        },
        "workerSlots": {
          "type": "object",
          "required": [
            "total",
            "available"
          ],
          "properties": {
            "total": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1024
            },
            "available": {
              "type": "integer",
              "minimum": 0,
              "maximum": 1024
            }
          },
          "additionalProperties": false
        },
        "workerBundle": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "status",
                "version"
              ],
              "properties": {
                "status": {
                  "type": "string",
                  "const": "installed"
                },
                "version": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "status"
              ],
              "properties": {
                "status": {
                  "type": "string",
                  "const": "missing"
                }
              },
              "additionalProperties": false
            }
          ]
        },
        "lastConnectedAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "lastDisconnectedAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "lastSeenAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "lastSeenReason": {
          "type": "string",
          "minLength": 1
        },
        "trust": {
          "type": "string",
          "enum": [
            "persistent",
            "disposable"
          ]
        },
        "capabilities": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "invocableCommands": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "maxItems": 128,
          "uniqueItems": true
        },
        "desktop": {
          "type": "boolean"
        },
        "issues": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "code",
              "action",
              "updateCommand",
              "headlessReconnectCommand"
            ],
            "properties": {
              "code": {
                "type": "string",
                "const": "update-required"
              },
              "action": {
                "type": "string",
                "const": "update-and-reconnect"
              },
              "updateCommand": {
                "type": "string",
                "const": "openclaw update"
              },
              "headlessReconnectCommand": {
                "type": "string",
                "const": "openclaw node restart"
              }
            },
            "additionalProperties": false
          },
          "minItems": 1,
          "maxItems": 8
        },
        "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"
                }
              ]
            },
            "error": {
              "type": "string",
              "minLength": 1
            },
            "desktop": {
              "type": "boolean"
            },
            "desktopApps": {
              "type": "array",
              "items": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "browser"
                  },
                  {
                    "type": "string",
                    "const": "terminal"
                  }
                ]
              },
              "maxItems": 8,
              "uniqueItems": true
            }
          },
          "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"
          ]
        },
        "platform": {
          "type": "string",
          "minLength": 1
        },
        "sessionHost": {
          "type": "boolean"
        },
        "workerSlots": {
          "type": "object",
          "required": [
            "total",
            "available"
          ],
          "properties": {
            "total": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1024
            },
            "available": {
              "type": "integer",
              "minimum": 0,
              "maximum": 1024
            }
          },
          "additionalProperties": false
        },
        "workerBundle": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "status",
                "version"
              ],
              "properties": {
                "status": {
                  "type": "string",
                  "const": "installed"
                },
                "version": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "status"
              ],
              "properties": {
                "status": {
                  "type": "string",
                  "const": "missing"
                }
              },
              "additionalProperties": false
            }
          ]
        },
        "lastConnectedAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "lastDisconnectedAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "lastSeenAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "lastSeenReason": {
          "type": "string",
          "minLength": 1
        },
        "trust": {
          "type": "string",
          "enum": [
            "persistent",
            "disposable"
          ]
        },
        "capabilities": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "invocableCommands": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "maxItems": 128,
          "uniqueItems": true
        },
        "desktop": {
          "type": "boolean"
        },
        "issues": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "code",
              "action",
              "updateCommand",
              "headlessReconnectCommand"
            ],
            "properties": {
              "code": {
                "type": "string",
                "const": "update-required"
              },
              "action": {
                "type": "string",
                "const": "update-and-reconnect"
              },
              "updateCommand": {
                "type": "string",
                "const": "openclaw update"
              },
              "headlessReconnectCommand": {
                "type": "string",
                "const": "openclaw node restart"
              }
            },
            "additionalProperties": false
          },
          "minItems": 1,
          "maxItems": 8
        },
        "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"
                }
              ]
            },
            "error": {
              "type": "string",
              "minLength": 1
            },
            "desktop": {
              "type": "boolean"
            },
            "desktopApps": {
              "type": "array",
              "items": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "browser"
                  },
                  {
                    "type": "string",
                    "const": "terminal"
                  }
                ]
              },
              "maxItems": 8,
              "uniqueItems": true
            }
          },
          "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"
                ]
              },
              "platform": {
                "type": "string",
                "minLength": 1
              },
              "sessionHost": {
                "type": "boolean"
              },
              "workerSlots": {
                "type": "object",
                "required": [
                  "total",
                  "available"
                ],
                "properties": {
                  "total": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1024
                  },
                  "available": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 1024
                  }
                },
                "additionalProperties": false
              },
              "workerBundle": {
                "anyOf": [
                  {
                    "type": "object",
                    "required": [
                      "status",
                      "version"
                    ],
                    "properties": {
                      "status": {
                        "type": "string",
                        "const": "installed"
                      },
                      "version": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "required": [
                      "status"
                    ],
                    "properties": {
                      "status": {
                        "type": "string",
                        "const": "missing"
                      }
                    },
                    "additionalProperties": false
                  }
                ]
              },
              "lastConnectedAtMs": {
                "type": "integer",
                "minimum": 0
              },
              "lastDisconnectedAtMs": {
                "type": "integer",
                "minimum": 0
              },
              "lastSeenAtMs": {
                "type": "integer",
                "minimum": 0
              },
              "lastSeenReason": {
                "type": "string",
                "minLength": 1
              },
              "trust": {
                "type": "string",
                "enum": [
                  "persistent",
                  "disposable"
                ]
              },
              "capabilities": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "invocableCommands": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                },
                "maxItems": 128,
                "uniqueItems": true
              },
              "desktop": {
                "type": "boolean"
              },
              "issues": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "code",
                    "action",
                    "updateCommand",
                    "headlessReconnectCommand"
                  ],
                  "properties": {
                    "code": {
                      "type": "string",
                      "const": "update-required"
                    },
                    "action": {
                      "type": "string",
                      "const": "update-and-reconnect"
                    },
                    "updateCommand": {
                      "type": "string",
                      "const": "openclaw update"
                    },
                    "headlessReconnectCommand": {
                      "type": "string",
                      "const": "openclaw node restart"
                    }
                  },
                  "additionalProperties": false
                },
                "minItems": 1,
                "maxItems": 8
              },
              "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"
                      }
                    ]
                  },
                  "error": {
                    "type": "string",
                    "minLength": 1
                  },
                  "desktop": {
                    "type": "boolean"
                  },
                  "desktopApps": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "browser"
                        },
                        {
                          "type": "string",
                          "const": "terminal"
                        }
                      ]
                    },
                    "maxItems": 8,
                    "uniqueItems": true
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          }
        },
        "profiles": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "providerId"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "providerId": {
                "type": "string",
                "minLength": 1
              },
              "trust": {
                "type": "string",
                "enum": [
                  "persistent",
                  "disposable"
                ]
              },
              "executionMode": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "worker-turn"
                  },
                  {
                    "type": "string",
                    "const": "remote-exec"
                  }
                ]
              },
              "executionModes": {
                "anyOf": [
                  {
                    "type": "array",
                    "additionalItems": false,
                    "items": [
                      {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "worker-turn"
                          },
                          {
                            "type": "string",
                            "const": "remote-exec"
                          }
                        ]
                      }
                    ],
                    "minItems": 1
                  },
                  {
                    "type": "array",
                    "additionalItems": false,
                    "items": [
                      {
                        "type": "string",
                        "const": "worker-turn"
                      },
                      {
                        "type": "string",
                        "const": "remote-exec"
                      }
                    ],
                    "minItems": 2
                  }
                ]
              },
              "machines": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "id",
                    "label"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 128
                    },
                    "label": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 128
                    },
                    "cpu": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 65536
                    },
                    "memoryGb": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 65536
                    },
                    "default": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                },
                "minItems": 1,
                "maxItems": 32
              }
            },
            "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"
          ]
        },
        "platform": {
          "type": "string",
          "minLength": 1
        },
        "sessionHost": {
          "type": "boolean"
        },
        "workerSlots": {
          "type": "object",
          "required": [
            "total",
            "available"
          ],
          "properties": {
            "total": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1024
            },
            "available": {
              "type": "integer",
              "minimum": 0,
              "maximum": 1024
            }
          },
          "additionalProperties": false
        },
        "workerBundle": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "status",
                "version"
              ],
              "properties": {
                "status": {
                  "type": "string",
                  "const": "installed"
                },
                "version": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "status"
              ],
              "properties": {
                "status": {
                  "type": "string",
                  "const": "missing"
                }
              },
              "additionalProperties": false
            }
          ]
        },
        "lastConnectedAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "lastDisconnectedAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "lastSeenAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "lastSeenReason": {
          "type": "string",
          "minLength": 1
        },
        "trust": {
          "type": "string",
          "enum": [
            "persistent",
            "disposable"
          ]
        },
        "capabilities": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "invocableCommands": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "maxItems": 128,
          "uniqueItems": true
        },
        "desktop": {
          "type": "boolean"
        },
        "issues": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "code",
              "action",
              "updateCommand",
              "headlessReconnectCommand"
            ],
            "properties": {
              "code": {
                "type": "string",
                "const": "update-required"
              },
              "action": {
                "type": "string",
                "const": "update-and-reconnect"
              },
              "updateCommand": {
                "type": "string",
                "const": "openclaw update"
              },
              "headlessReconnectCommand": {
                "type": "string",
                "const": "openclaw node restart"
              }
            },
            "additionalProperties": false
          },
          "minItems": 1,
          "maxItems": 8
        },
        "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"
                }
              ]
            },
            "error": {
              "type": "string",
              "minLength": 1
            },
            "desktop": {
              "type": "boolean"
            },
            "desktopApps": {
              "type": "array",
              "items": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "browser"
                  },
                  {
                    "type": "string",
                    "const": "terminal"
                  }
                ]
              },
              "maxItems": 8,
              "uniqueItems": true
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "WorkerDesktopObserveParams": {
      "type": "object",
      "required": [
        "environmentId"
      ],
      "properties": {
        "environmentId": {
          "type": "string",
          "minLength": 1
        },
        "control": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "WorkerDesktopObserveResult": {
      "type": "object",
      "required": [
        "transport",
        "wsPath",
        "expiresAtMs",
        "control"
      ],
      "properties": {
        "transport": {
          "type": "string",
          "enum": [
            "rfb"
          ]
        },
        "wsPath": {
          "type": "string",
          "minLength": 1
        },
        "expiresAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "control": {
          "type": "boolean"
        },
        "vncPassword": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "WorkerDesktopLaunchParams": {
      "type": "object",
      "required": [
        "environmentId",
        "app"
      ],
      "properties": {
        "environmentId": {
          "type": "string",
          "minLength": 1
        },
        "app": {
          "anyOf": [
            {
              "type": "string",
              "const": "browser"
            },
            {
              "type": "string",
              "const": "terminal"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "WorkerDesktopLaunchResult": {
      "type": "object",
      "required": [
        "app",
        "status"
      ],
      "properties": {
        "app": {
          "anyOf": [
            {
              "type": "string",
              "const": "browser"
            },
            {
              "type": "string",
              "const": "terminal"
            }
          ]
        },
        "status": {
          "type": "string",
          "const": "ready"
        }
      },
      "additionalProperties": false
    },
    "ProjectCheckout": {
      "type": "object",
      "required": [
        "runnerId",
        "path"
      ],
      "properties": {
        "runnerId": {
          "type": "string",
          "minLength": 1,
          "description": "Runner hosting this operator.write-scoped checkout."
        },
        "path": {
          "type": "string",
          "minLength": 1,
          "description": "Physical checkout path returned only to operator.write-capable callers."
        }
      },
      "additionalProperties": false
    },
    "ProjectSummary": {
      "type": "object",
      "required": [
        "name",
        "checkouts",
        "lastUsedAt"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1
        },
        "originUrl": {
          "type": "string",
          "minLength": 1,
          "description": "Sanitized repository origin returned to operator.write-capable callers."
        },
        "checkouts": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "runnerId",
              "path"
            ],
            "properties": {
              "runnerId": {
                "type": "string",
                "minLength": 1,
                "description": "Runner hosting this operator.write-scoped checkout."
              },
              "path": {
                "type": "string",
                "minLength": 1,
                "description": "Physical checkout path returned only to operator.write-capable callers."
              }
            },
            "additionalProperties": false
          },
          "minItems": 1,
          "maxItems": 50
        },
        "lastUsedAt": {
          "type": "number",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "DesktopSource": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "kind"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "host"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "kind",
            "environmentId"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "environment"
            },
            "environmentId": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "kind",
            "nodeId"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "node"
            },
            "nodeId": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "DesktopObserveParams": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "source"
          ],
          "properties": {
            "source": {
              "type": "object",
              "required": [
                "kind"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "host"
                }
              },
              "additionalProperties": false
            },
            "control": {
              "type": "boolean"
            },
            "credentials": {
              "type": "object",
              "properties": {
                "username": {
                  "type": "string",
                  "minLength": 1
                },
                "password": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "source"
          ],
          "properties": {
            "source": {
              "type": "object",
              "required": [
                "kind",
                "environmentId"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "environment"
                },
                "environmentId": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            "control": {
              "type": "boolean"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "source"
          ],
          "properties": {
            "source": {
              "type": "object",
              "required": [
                "kind",
                "nodeId"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "node"
                },
                "nodeId": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            "control": {
              "type": "boolean"
            },
            "credentials": {
              "type": "object",
              "properties": {
                "username": {
                  "type": "string",
                  "minLength": 1
                },
                "password": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "DesktopObserveResult": {
      "type": "object",
      "required": [
        "transport",
        "wsPath",
        "expiresAtMs",
        "control"
      ],
      "properties": {
        "transport": {
          "type": "string",
          "enum": [
            "rfb"
          ]
        },
        "wsPath": {
          "type": "string",
          "minLength": 1
        },
        "expiresAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "control": {
          "type": "boolean"
        },
        "vncPassword": {
          "type": "string",
          "minLength": 1
        },
        "auth": {
          "type": "string",
          "enum": [
            "none",
            "vnc-password",
            "ard-account"
          ]
        },
        "preauthenticated": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "DesktopLaunchParams": {
      "type": "object",
      "required": [
        "source",
        "app"
      ],
      "properties": {
        "source": {
          "type": "object",
          "required": [
            "kind",
            "environmentId"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "environment"
            },
            "environmentId": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        "app": {
          "anyOf": [
            {
              "type": "string",
              "const": "browser"
            },
            {
              "type": "string",
              "const": "terminal"
            }
          ]
        }
      },
      "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": {
            "^.*$": {}
          }
        },
        "reply": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "replyToId",
                "source"
              ],
              "properties": {
                "replyToId": {
                  "type": "string",
                  "minLength": 1
                },
                "source": {
                  "type": "string",
                  "const": "explicit"
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "replyToId",
                "source",
                "mode"
              ],
              "properties": {
                "replyToId": {
                  "type": "string",
                  "minLength": 1
                },
                "source": {
                  "type": "string",
                  "const": "implicit"
                },
                "mode": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "first"
                    },
                    {
                      "type": "string",
                      "const": "all"
                    }
                  ]
                }
              },
              "additionalProperties": false
            }
          ]
        },
        "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
        },
        "internalExecutionIdentityRetry": {
          "type": "boolean"
        },
        "internalExecutionIdentityRecoveryAttempt": {
          "type": "integer",
          "minimum": 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"
                    },
                    "sizeBytes": {
                      "type": "number"
                    },
                    "durationMs": {
                      "type": "number"
                    },
                    "width": {
                      "type": "number"
                    },
                    "height": {
                      "type": "number"
                    }
                  },
                  "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"
        },
        "forceCodeModeTools": {
          "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
        },
        "nameSource": {
          "type": "string",
          "enum": [
            "config",
            "agent",
            "workspace",
            "default"
          ]
        },
        "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
    },
    "ProjectRecord": {
      "type": "object",
      "required": [
        "id",
        "displayName",
        "source"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "displayName": {
          "type": "string",
          "minLength": 1
        },
        "repoRoot": {
          "type": "string",
          "minLength": 1,
          "description": "Repository checkout root; included only for callers holding operator.write."
        },
        "originUrl": {
          "type": "string",
          "minLength": 1,
          "description": "Repository origin URL; included only for callers holding operator.write."
        },
        "source": {
          "type": "string",
          "enum": [
            "workspace",
            "registered",
            "cloned"
          ]
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "ProjectRecentFolder": {
      "type": "object",
      "required": [
        "kind",
        "folder",
        "displayName"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "const": "folder"
        },
        "folder": {
          "type": "string",
          "minLength": 1
        },
        "displayName": {
          "type": "string",
          "minLength": 1
        },
        "execNode": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "ProjectRecentProject": {
      "type": "object",
      "required": [
        "kind",
        "projectId",
        "displayName"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "const": "project"
        },
        "projectId": {
          "type": "string",
          "minLength": 1
        },
        "displayName": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "ProjectRecent": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "kind",
            "projectId",
            "displayName"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "project"
            },
            "projectId": {
              "type": "string",
              "minLength": 1
            },
            "displayName": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "kind",
            "folder",
            "displayName"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "folder"
            },
            "folder": {
              "type": "string",
              "minLength": 1
            },
            "displayName": {
              "type": "string",
              "minLength": 1
            },
            "execNode": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "ProjectsListParams": {
      "type": "object",
      "properties": {
        "includeObserved": {
          "type": "boolean",
          "description": "Compute write-scoped observed checkout groups in addition to projects."
        }
      },
      "additionalProperties": false
    },
    "ProjectsListResult": {
      "type": "object",
      "required": [
        "projects"
      ],
      "properties": {
        "projects": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "displayName",
              "source"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "displayName": {
                "type": "string",
                "minLength": 1
              },
              "repoRoot": {
                "type": "string",
                "minLength": 1,
                "description": "Repository checkout root; included only for callers holding operator.write."
              },
              "originUrl": {
                "type": "string",
                "minLength": 1,
                "description": "Repository origin URL; included only for callers holding operator.write."
              },
              "source": {
                "type": "string",
                "enum": [
                  "workspace",
                  "registered",
                  "cloned"
                ]
              },
              "agentId": {
                "type": "string",
                "minLength": 1
              }
            },
            "additionalProperties": false
          }
        },
        "recents": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "object",
                "required": [
                  "kind",
                  "projectId",
                  "displayName"
                ],
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "project"
                  },
                  "projectId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "displayName": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "object",
                "required": [
                  "kind",
                  "folder",
                  "displayName"
                ],
                "properties": {
                  "kind": {
                    "type": "string",
                    "const": "folder"
                  },
                  "folder": {
                    "type": "string",
                    "minLength": 1
                  },
                  "displayName": {
                    "type": "string",
                    "minLength": 1
                  },
                  "execNode": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "additionalProperties": false
              }
            ]
          },
          "maxItems": 8
        },
        "observedProjects": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "name",
              "checkouts",
              "lastUsedAt"
            ],
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1
              },
              "originUrl": {
                "type": "string",
                "minLength": 1,
                "description": "Sanitized repository origin returned to operator.write-capable callers."
              },
              "checkouts": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "runnerId",
                    "path"
                  ],
                  "properties": {
                    "runnerId": {
                      "type": "string",
                      "minLength": 1,
                      "description": "Runner hosting this operator.write-scoped checkout."
                    },
                    "path": {
                      "type": "string",
                      "minLength": 1,
                      "description": "Physical checkout path returned only to operator.write-capable callers."
                    }
                  },
                  "additionalProperties": false
                },
                "minItems": 1,
                "maxItems": 50
              },
              "lastUsedAt": {
                "type": "number",
                "minimum": 0
              }
            },
            "additionalProperties": false
          },
          "maxItems": 50,
          "description": "Observed checkout details returned only to operator.write-capable callers."
        }
      },
      "additionalProperties": false
    },
    "ProjectsRegisterParams": {
      "type": "object",
      "required": [
        "path"
      ],
      "properties": {
        "path": {
          "type": "string",
          "minLength": 1
        },
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        }
      },
      "additionalProperties": false
    },
    "ProjectsRegisterResult": {
      "type": "object",
      "required": [
        "id",
        "displayName",
        "source"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "displayName": {
          "type": "string",
          "minLength": 1
        },
        "repoRoot": {
          "type": "string",
          "minLength": 1,
          "description": "Repository checkout root; included only for callers holding operator.write."
        },
        "originUrl": {
          "type": "string",
          "minLength": 1,
          "description": "Repository origin URL; included only for callers holding operator.write."
        },
        "source": {
          "type": "string",
          "enum": [
            "workspace",
            "registered",
            "cloned"
          ]
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "ProjectsAddParams": {
      "type": "object",
      "required": [
        "gitUrl"
      ],
      "properties": {
        "gitUrl": {
          "type": "string",
          "minLength": 1,
          "maxLength": 2048
        },
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        }
      },
      "additionalProperties": false
    },
    "ProjectsAddResult": {
      "type": "object",
      "required": [
        "id",
        "displayName",
        "source"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "displayName": {
          "type": "string",
          "minLength": 1
        },
        "repoRoot": {
          "type": "string",
          "minLength": 1,
          "description": "Repository checkout root; included only for callers holding operator.write."
        },
        "originUrl": {
          "type": "string",
          "minLength": 1,
          "description": "Repository origin URL; included only for callers holding operator.write."
        },
        "source": {
          "type": "string",
          "enum": [
            "workspace",
            "registered",
            "cloned"
          ]
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "RemoteProject": {
      "type": "object",
      "required": [
        "name",
        "fullName",
        "cloneUrl",
        "webUrl",
        "private"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 100
        },
        "fullName": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "description": {
          "type": "string",
          "maxLength": 500
        },
        "cloneUrl": {
          "type": "string",
          "minLength": 1,
          "maxLength": 2048
        },
        "webUrl": {
          "type": "string",
          "minLength": 1,
          "maxLength": 2048
        },
        "private": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "ProjectsSearchRemoteParams": {
      "type": "object",
      "required": [
        "query"
      ],
      "properties": {
        "query": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        }
      },
      "additionalProperties": false
    },
    "ProjectsSearchRemoteResult": {
      "type": "object",
      "required": [
        "credential",
        "projects"
      ],
      "properties": {
        "credential": {
          "anyOf": [
            {
              "type": "string",
              "const": "configured"
            },
            {
              "type": "string",
              "const": "missing"
            }
          ]
        },
        "projects": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "name",
              "fullName",
              "cloneUrl",
              "webUrl",
              "private"
            ],
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              "fullName": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "description": {
                "type": "string",
                "maxLength": 500
              },
              "cloneUrl": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2048
              },
              "webUrl": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2048
              },
              "private": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          },
          "maxItems": 10
        }
      },
      "additionalProperties": false
    },
    "ProjectsRemoveParams": {
      "type": "object",
      "required": [
        "id"
      ],
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^[a-z0-9][a-z0-9-]{0,63}$"
        },
        "deleteCheckout": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "ProjectsRemoveResult": {
      "type": "object",
      "required": [
        "removed"
      ],
      "properties": {
        "removed": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "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
        },
        "runEndCleanup": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "outcome",
                "at"
              ],
              "properties": {
                "outcome": {
                  "type": "string",
                  "enum": [
                    "removed-lossless",
                    "retained-busy",
                    "retained-dirty",
                    "retained-unpushed",
                    "retained-provisioned-drift"
                  ]
                },
                "at": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "outcome",
                "at",
                "reason"
              ],
              "properties": {
                "outcome": {
                  "type": "string",
                  "const": "failed"
                },
                "at": {
                  "type": "integer",
                  "minimum": 0
                },
                "reason": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 500
                }
              },
              "additionalProperties": false
            }
          ]
        }
      },
      "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
              },
              "runEndCleanup": {
                "anyOf": [
                  {
                    "type": "object",
                    "required": [
                      "outcome",
                      "at"
                    ],
                    "properties": {
                      "outcome": {
                        "type": "string",
                        "enum": [
                          "removed-lossless",
                          "retained-busy",
                          "retained-dirty",
                          "retained-unpushed",
                          "retained-provisioned-drift"
                        ]
                      },
                      "at": {
                        "type": "integer",
                        "minimum": 0
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "required": [
                      "outcome",
                      "at",
                      "reason"
                    ],
                    "properties": {
                      "outcome": {
                        "type": "string",
                        "const": "failed"
                      },
                      "at": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "reason": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 500
                      }
                    },
                    "additionalProperties": false
                  }
                ]
              }
            },
            "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
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "UiCommandResult": {
      "type": "object",
      "required": [
        "ok"
      ],
      "properties": {
        "ok": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "SecretsReloadParams": {
      "type": "object",
      "properties": {},
      "additionalProperties": false
    },
    "SecretStoreSecretEntry": {
      "type": "object",
      "required": [
        "name",
        "scopeKind",
        "scopeId",
        "createdAtMs",
        "updatedAtMs",
        "kind"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Z][A-Z0-9_]{0,127}$"
        },
        "scopeKind": {
          "type": "string",
          "const": "team"
        },
        "scopeId": {
          "type": "string",
          "const": ""
        },
        "createdAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "updatedAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "updatedBy": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "const": "secret"
        },
        "allowedHosts": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 253
          },
          "maxItems": 128,
          "uniqueItems": true,
          "x-openclaw-since": "2026.8"
        }
      },
      "additionalProperties": false
    },
    "SecretStoreEnvEntry": {
      "type": "object",
      "required": [
        "name",
        "scopeKind",
        "scopeId",
        "createdAtMs",
        "updatedAtMs",
        "kind",
        "value"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Z][A-Z0-9_]{0,127}$"
        },
        "scopeKind": {
          "type": "string",
          "const": "team"
        },
        "scopeId": {
          "type": "string",
          "const": ""
        },
        "createdAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "updatedAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "updatedBy": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "const": "env"
        },
        "value": {
          "type": "string",
          "maxLength": 65536
        }
      },
      "additionalProperties": false
    },
    "SecretStoreEntry": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "name",
            "scopeKind",
            "scopeId",
            "createdAtMs",
            "updatedAtMs",
            "kind"
          ],
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Z][A-Z0-9_]{0,127}$"
            },
            "scopeKind": {
              "type": "string",
              "const": "team"
            },
            "scopeId": {
              "type": "string",
              "const": ""
            },
            "createdAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "updatedAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "updatedBy": {
              "type": "string"
            },
            "kind": {
              "type": "string",
              "const": "secret"
            },
            "allowedHosts": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 253
              },
              "maxItems": 128,
              "uniqueItems": true,
              "x-openclaw-since": "2026.8"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "name",
            "scopeKind",
            "scopeId",
            "createdAtMs",
            "updatedAtMs",
            "kind",
            "value"
          ],
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Z][A-Z0-9_]{0,127}$"
            },
            "scopeKind": {
              "type": "string",
              "const": "team"
            },
            "scopeId": {
              "type": "string",
              "const": ""
            },
            "createdAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "updatedAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "updatedBy": {
              "type": "string"
            },
            "kind": {
              "type": "string",
              "const": "env"
            },
            "value": {
              "type": "string",
              "maxLength": 65536
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "SecretsStoreListParams": {
      "type": "object",
      "properties": {},
      "additionalProperties": false
    },
    "SecretsStoreListResult": {
      "type": "object",
      "required": [
        "entries"
      ],
      "properties": {
        "entries": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "object",
                "required": [
                  "name",
                  "scopeKind",
                  "scopeId",
                  "createdAtMs",
                  "updatedAtMs",
                  "kind"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128,
                    "pattern": "^[A-Z][A-Z0-9_]{0,127}$"
                  },
                  "scopeKind": {
                    "type": "string",
                    "const": "team"
                  },
                  "scopeId": {
                    "type": "string",
                    "const": ""
                  },
                  "createdAtMs": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "updatedAtMs": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "updatedBy": {
                    "type": "string"
                  },
                  "kind": {
                    "type": "string",
                    "const": "secret"
                  },
                  "allowedHosts": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 253
                    },
                    "maxItems": 128,
                    "uniqueItems": true,
                    "x-openclaw-since": "2026.8"
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "object",
                "required": [
                  "name",
                  "scopeKind",
                  "scopeId",
                  "createdAtMs",
                  "updatedAtMs",
                  "kind",
                  "value"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128,
                    "pattern": "^[A-Z][A-Z0-9_]{0,127}$"
                  },
                  "scopeKind": {
                    "type": "string",
                    "const": "team"
                  },
                  "scopeId": {
                    "type": "string",
                    "const": ""
                  },
                  "createdAtMs": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "updatedAtMs": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "updatedBy": {
                    "type": "string"
                  },
                  "kind": {
                    "type": "string",
                    "const": "env"
                  },
                  "value": {
                    "type": "string",
                    "maxLength": 65536
                  }
                },
                "additionalProperties": false
              }
            ]
          }
        }
      },
      "additionalProperties": false
    },
    "SecretsStoreSetParams": {
      "type": "object",
      "required": [
        "name",
        "value",
        "kind"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^(?:[A-Z][A-Z0-9_]{0,127}|github-setup-[a-f0-9]{32})$"
        },
        "value": {
          "type": "string",
          "maxLength": 65536
        },
        "kind": {
          "anyOf": [
            {
              "type": "string",
              "const": "secret"
            },
            {
              "type": "string",
              "const": "env"
            }
          ]
        },
        "allowedHosts": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 253
          },
          "maxItems": 128,
          "uniqueItems": true,
          "x-openclaw-since": "2026.8"
        }
      },
      "additionalProperties": false
    },
    "SecretsStoreDeleteParams": {
      "type": "object",
      "required": [
        "name"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^(?:[A-Z][A-Z0-9_]{0,127}|github-setup-[a-f0-9]{32})$"
        }
      },
      "additionalProperties": false
    },
    "SecretsStoreMutationResult": {
      "type": "object",
      "required": [
        "ok",
        "reloaded"
      ],
      "properties": {
        "ok": {
          "type": "boolean",
          "const": true
        },
        "reloaded": {
          "type": "boolean"
        },
        "warningCount": {
          "type": "integer",
          "minimum": 0
        }
      },
      "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
    },
    "SessionPermissionMode": {
      "anyOf": [
        {
          "type": "string",
          "const": "read-only"
        },
        {
          "type": "string",
          "const": "guarded"
        },
        {
          "type": "string",
          "const": "workspace"
        },
        {
          "type": "string",
          "const": "full"
        }
      ]
    },
    "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
        },
        "ownerId": {
          "type": "string",
          "minLength": 1
        },
        "ownerFirst": {
          "type": "boolean"
        },
        "involvingMe": {
          "type": "boolean"
        },
        "involvingProfileId": {
          "type": "string",
          "minLength": 1
        },
        "includePeople": {
          "type": "boolean"
        },
        "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
            },
            "startTerminal": {
              "type": "boolean"
            }
          },
          "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
                },
                "startTerminal": {
                  "type": "boolean"
                }
              },
              "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
        },
        "sourceHomeId": {
          "type": "string",
          "minLength": 1
        },
        "name": {
          "type": "string"
        },
        "color": {
          "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
            },
            "avatarUrl": {
              "type": "string",
              "minLength": 1
            },
            "identity": {
              "anyOf": [
                {
                  "type": "object",
                  "required": [
                    "type",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "profile"
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "type",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "agent"
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "type",
                    "pluginId",
                    "domain",
                    "idKind",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "remote"
                    },
                    "pluginId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "domain": {
                      "type": "string",
                      "minLength": 1
                    },
                    "idKind": {
                      "type": "string",
                      "minLength": 1
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "type",
                    "pluginId",
                    "accountId",
                    "senderKind",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "observation"
                    },
                    "pluginId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "accountId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "senderKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "human"
                        },
                        {
                          "type": "string",
                          "const": "bot"
                        },
                        {
                          "type": "string",
                          "const": "unknown"
                        }
                      ]
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "type",
                    "actorType",
                    "source",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "legacy"
                    },
                    "actorType": {
                      "type": "string"
                    },
                    "source": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "id": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              ]
            }
          },
          "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
              },
              "sourceHomeId": {
                "type": "string",
                "minLength": 1
              },
              "name": {
                "type": "string"
              },
              "color": {
                "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
                  },
                  "avatarUrl": {
                    "type": "string",
                    "minLength": 1
                  },
                  "identity": {
                    "anyOf": [
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "id"
                        ],
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "profile"
                          },
                          "id": {
                            "type": "string",
                            "minLength": 1
                          }
                        },
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "id"
                        ],
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "agent"
                          },
                          "id": {
                            "type": "string",
                            "minLength": 1
                          }
                        },
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "pluginId",
                          "domain",
                          "idKind",
                          "id"
                        ],
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "remote"
                          },
                          "pluginId": {
                            "type": "string",
                            "minLength": 1
                          },
                          "domain": {
                            "type": "string",
                            "minLength": 1
                          },
                          "idKind": {
                            "type": "string",
                            "minLength": 1
                          },
                          "id": {
                            "type": "string",
                            "minLength": 1
                          }
                        },
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "pluginId",
                          "accountId",
                          "senderKind",
                          "id"
                        ],
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "observation"
                          },
                          "pluginId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 1
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "accountId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 1
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "senderKind": {
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "human"
                              },
                              {
                                "type": "string",
                                "const": "bot"
                              },
                              {
                                "type": "string",
                                "const": "unknown"
                              }
                            ]
                          },
                          "id": {
                            "type": "string",
                            "minLength": 1
                          }
                        },
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "actorType",
                          "source",
                          "id"
                        ],
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "legacy"
                          },
                          "actorType": {
                            "type": "string"
                          },
                          "source": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "id": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    ]
                  }
                },
                "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
                },
                "startTerminal": {
                  "type": "boolean"
                }
              },
              "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
                    },
                    "sourceHomeId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "name": {
                      "type": "string"
                    },
                    "color": {
                      "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
                        },
                        "avatarUrl": {
                          "type": "string",
                          "minLength": 1
                        },
                        "identity": {
                          "anyOf": [
                            {
                              "type": "object",
                              "required": [
                                "type",
                                "id"
                              ],
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "profile"
                                },
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "type",
                                "id"
                              ],
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "agent"
                                },
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "type",
                                "pluginId",
                                "domain",
                                "idKind",
                                "id"
                              ],
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "remote"
                                },
                                "pluginId": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "domain": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "idKind": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "type",
                                "pluginId",
                                "accountId",
                                "senderKind",
                                "id"
                              ],
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "observation"
                                },
                                "pluginId": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "accountId": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "minLength": 1
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "senderKind": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "human"
                                    },
                                    {
                                      "type": "string",
                                      "const": "bot"
                                    },
                                    {
                                      "type": "string",
                                      "const": "unknown"
                                    }
                                  ]
                                },
                                "id": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "type",
                                "actorType",
                                "source",
                                "id"
                              ],
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "legacy"
                                },
                                "actorType": {
                                  "type": "string"
                                },
                                "source": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "id": {
                                  "type": "string"
                                }
                              },
                              "additionalProperties": false
                            }
                          ]
                        }
                      },
                      "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
                      },
                      "startTerminal": {
                        "type": "boolean"
                      }
                    },
                    "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
                          },
                          "sourceHomeId": {
                            "type": "string",
                            "minLength": 1
                          },
                          "name": {
                            "type": "string"
                          },
                          "color": {
                            "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
                              },
                              "avatarUrl": {
                                "type": "string",
                                "minLength": 1
                              },
                              "identity": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "required": [
                                      "type",
                                      "id"
                                    ],
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "profile"
                                      },
                                      "id": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "required": [
                                      "type",
                                      "id"
                                    ],
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "agent"
                                      },
                                      "id": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "required": [
                                      "type",
                                      "pluginId",
                                      "domain",
                                      "idKind",
                                      "id"
                                    ],
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "remote"
                                      },
                                      "pluginId": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "domain": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "idKind": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "id": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "required": [
                                      "type",
                                      "pluginId",
                                      "accountId",
                                      "senderKind",
                                      "id"
                                    ],
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "observation"
                                      },
                                      "pluginId": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "accountId": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "minLength": 1
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "senderKind": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "const": "human"
                                          },
                                          {
                                            "type": "string",
                                            "const": "bot"
                                          },
                                          {
                                            "type": "string",
                                            "const": "unknown"
                                          }
                                        ]
                                      },
                                      "id": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "required": [
                                      "type",
                                      "actorType",
                                      "source",
                                      "id"
                                    ],
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "legacy"
                                      },
                                      "actorType": {
                                        "type": "string"
                                      },
                                      "source": {
                                        "anyOf": [
                                          {
                                            "type": "string"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "id": {
                                        "type": "string"
                                      }
                                    },
                                    "additionalProperties": false
                                  }
                                ]
                              }
                            },
                            "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
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "sourceHomeId": {
          "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
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "sourceHomeId": {
          "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
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "sourceHomeId": {
          "type": "string",
          "minLength": 1
        },
        "confirmNoOtherRunner": {
          "type": "boolean",
          "const": true
        }
      },
      "additionalProperties": false
    },
    "SessionsCatalogArchiveResult": {
      "type": "object",
      "required": [
        "ok"
      ],
      "properties": {
        "ok": {
          "type": "boolean",
          "const": true
        }
      },
      "additionalProperties": false
    },
    "SessionsCatalogStartTerminalParams": {
      "type": "object",
      "required": [
        "catalogId",
        "agentId",
        "cwd"
      ],
      "properties": {
        "catalogId": {
          "type": "string",
          "minLength": 1
        },
        "hostId": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "cwd": {
          "type": "string",
          "minLength": 1
        },
        "initialMessage": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "SessionsCatalogStartTerminalResult": {
      "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
    },
    "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
    },
    "SessionsResolveCandidate": {
      "type": "object",
      "required": [
        "key",
        "agentId"
      ],
      "properties": {
        "key": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "displayName": {
          "type": "string"
        },
        "boardFace": {
          "anyOf": [
            {
              "type": "string",
              "const": "chat"
            },
            {
              "type": "string",
              "const": "dashboard"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "SessionsResolveParams": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string",
          "minLength": 1
        },
        "sessionId": {
          "type": "string",
          "minLength": 1
        },
        "label": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "shortId": {
          "type": "string",
          "minLength": 1
        },
        "slugHint": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "spawnedBy": {
          "type": "string",
          "minLength": 1
        },
        "includeGlobal": {
          "type": "boolean"
        },
        "includeUnknown": {
          "type": "boolean"
        },
        "allowMissing": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "SessionsResolveResult": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "ok",
            "key",
            "agentId"
          ],
          "properties": {
            "ok": {
              "type": "boolean",
              "const": true
            },
            "key": {
              "type": "string",
              "minLength": 1
            },
            "agentId": {
              "type": "string",
              "minLength": 1
            },
            "displayName": {
              "type": "string"
            },
            "boardFace": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "chat"
                },
                {
                  "type": "string",
                  "const": "dashboard"
                }
              ]
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "ok"
          ],
          "properties": {
            "ok": {
              "type": "boolean",
              "const": false
            },
            "candidates": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "key",
                  "agentId"
                ],
                "properties": {
                  "key": {
                    "type": "string",
                    "minLength": 1
                  },
                  "agentId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "displayName": {
                    "type": "string"
                  },
                  "boardFace": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "chat"
                      },
                      {
                        "type": "string",
                        "const": "dashboard"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              },
              "maxItems": 10
            }
          },
          "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
        },
        "tokensVersion": {
          "type": "number",
          "const": 1
        },
        "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
        },
        "avatarUrl": {
          "type": "string",
          "minLength": 1
        },
        "identity": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "type",
                "id"
              ],
              "properties": {
                "type": {
                  "type": "string",
                  "const": "profile"
                },
                "id": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "type",
                "id"
              ],
              "properties": {
                "type": {
                  "type": "string",
                  "const": "agent"
                },
                "id": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "type",
                "pluginId",
                "domain",
                "idKind",
                "id"
              ],
              "properties": {
                "type": {
                  "type": "string",
                  "const": "remote"
                },
                "pluginId": {
                  "type": "string",
                  "minLength": 1
                },
                "domain": {
                  "type": "string",
                  "minLength": 1
                },
                "idKind": {
                  "type": "string",
                  "minLength": 1
                },
                "id": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "type",
                "pluginId",
                "accountId",
                "senderKind",
                "id"
              ],
              "properties": {
                "type": {
                  "type": "string",
                  "const": "observation"
                },
                "pluginId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "accountId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "senderKind": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "human"
                    },
                    {
                      "type": "string",
                      "const": "bot"
                    },
                    {
                      "type": "string",
                      "const": "unknown"
                    }
                  ]
                },
                "id": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "type",
                "actorType",
                "source",
                "id"
              ],
              "properties": {
                "type": {
                  "type": "string",
                  "const": "legacy"
                },
                "actorType": {
                  "type": "string"
                },
                "source": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "id": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "SessionParticipantIdentity": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "type",
            "id"
          ],
          "properties": {
            "type": {
              "type": "string",
              "const": "profile"
            },
            "id": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "type",
            "id"
          ],
          "properties": {
            "type": {
              "type": "string",
              "const": "agent"
            },
            "id": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "type",
            "pluginId",
            "domain",
            "idKind",
            "id"
          ],
          "properties": {
            "type": {
              "type": "string",
              "const": "remote"
            },
            "pluginId": {
              "type": "string",
              "minLength": 1
            },
            "domain": {
              "type": "string",
              "minLength": 1
            },
            "idKind": {
              "type": "string",
              "minLength": 1
            },
            "id": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "type",
            "pluginId",
            "accountId",
            "senderKind",
            "id"
          ],
          "properties": {
            "type": {
              "type": "string",
              "const": "observation"
            },
            "pluginId": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1
                },
                {
                  "type": "null"
                }
              ]
            },
            "accountId": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1
                },
                {
                  "type": "null"
                }
              ]
            },
            "senderKind": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "human"
                },
                {
                  "type": "string",
                  "const": "bot"
                },
                {
                  "type": "string",
                  "const": "unknown"
                }
              ]
            },
            "id": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "type",
            "actorType",
            "source",
            "id"
          ],
          "properties": {
            "type": {
              "type": "string",
              "const": "legacy"
            },
            "actorType": {
              "type": "string"
            },
            "source": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "id": {
              "type": "string"
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "SessionParticipant": {
      "type": "object",
      "required": [
        "identity"
      ],
      "properties": {
        "identity": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "type",
                "id"
              ],
              "properties": {
                "type": {
                  "type": "string",
                  "const": "profile"
                },
                "id": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "type",
                "id"
              ],
              "properties": {
                "type": {
                  "type": "string",
                  "const": "agent"
                },
                "id": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "type",
                "pluginId",
                "domain",
                "idKind",
                "id"
              ],
              "properties": {
                "type": {
                  "type": "string",
                  "const": "remote"
                },
                "pluginId": {
                  "type": "string",
                  "minLength": 1
                },
                "domain": {
                  "type": "string",
                  "minLength": 1
                },
                "idKind": {
                  "type": "string",
                  "minLength": 1
                },
                "id": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "type",
                "pluginId",
                "accountId",
                "senderKind",
                "id"
              ],
              "properties": {
                "type": {
                  "type": "string",
                  "const": "observation"
                },
                "pluginId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "accountId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "senderKind": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "human"
                    },
                    {
                      "type": "string",
                      "const": "bot"
                    },
                    {
                      "type": "string",
                      "const": "unknown"
                    }
                  ]
                },
                "id": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "type",
                "actorType",
                "source",
                "id"
              ],
              "properties": {
                "type": {
                  "type": "string",
                  "const": "legacy"
                },
                "actorType": {
                  "type": "string"
                },
                "source": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "id": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            }
          ]
        },
        "label": {
          "type": "string",
          "minLength": 1
        },
        "avatarUrl": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SessionPerson": {
      "type": "object",
      "required": [
        "identity",
        "sessionCount"
      ],
      "properties": {
        "identity": {
          "type": "object",
          "required": [
            "type",
            "id"
          ],
          "properties": {
            "type": {
              "type": "string",
              "const": "profile"
            },
            "id": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        "label": {
          "type": "string",
          "minLength": 1
        },
        "avatarUrl": {
          "type": "string",
          "minLength": 1
        },
        "sessionCount": {
          "type": "integer",
          "minimum": 1
        }
      },
      "additionalProperties": false
    },
    "SessionOwner": {
      "type": "object",
      "required": [
        "actor"
      ],
      "properties": {
        "actor": {
          "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
            },
            "avatarUrl": {
              "type": "string",
              "minLength": 1
            },
            "identity": {
              "anyOf": [
                {
                  "type": "object",
                  "required": [
                    "type",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "profile"
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "type",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "agent"
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "type",
                    "pluginId",
                    "domain",
                    "idKind",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "remote"
                    },
                    "pluginId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "domain": {
                      "type": "string",
                      "minLength": 1
                    },
                    "idKind": {
                      "type": "string",
                      "minLength": 1
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "type",
                    "pluginId",
                    "accountId",
                    "senderKind",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "observation"
                    },
                    "pluginId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "accountId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "senderKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "human"
                        },
                        {
                          "type": "string",
                          "const": "bot"
                        },
                        {
                          "type": "string",
                          "const": "unknown"
                        }
                      ]
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "type",
                    "actorType",
                    "source",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "legacy"
                    },
                    "actorType": {
                      "type": "string"
                    },
                    "source": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "id": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              ]
            }
          },
          "additionalProperties": false
        },
        "assignedBy": {
          "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
            },
            "avatarUrl": {
              "type": "string",
              "minLength": 1
            },
            "identity": {
              "anyOf": [
                {
                  "type": "object",
                  "required": [
                    "type",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "profile"
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "type",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "agent"
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "type",
                    "pluginId",
                    "domain",
                    "idKind",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "remote"
                    },
                    "pluginId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "domain": {
                      "type": "string",
                      "minLength": 1
                    },
                    "idKind": {
                      "type": "string",
                      "minLength": 1
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "type",
                    "pluginId",
                    "accountId",
                    "senderKind",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "observation"
                    },
                    "pluginId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "accountId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "senderKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "human"
                        },
                        {
                          "type": "string",
                          "const": "bot"
                        },
                        {
                          "type": "string",
                          "const": "unknown"
                        }
                      ]
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "type",
                    "actorType",
                    "source",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "legacy"
                    },
                    "actorType": {
                      "type": "string"
                    },
                    "source": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "id": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              ]
            }
          },
          "additionalProperties": false
        },
        "assignedAt": {
          "type": "number",
          "minimum": 0
        }
      },
      "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"
        },
        "icon": {
          "type": "string"
        },
        "color": {
          "type": "string"
        },
        "channelAvatarUrl": {
          "type": "string",
          "minLength": 1
        },
        "boardFace": {
          "anyOf": [
            {
              "type": "string",
              "const": "chat"
            },
            {
              "type": "string",
              "const": "dashboard"
            }
          ]
        },
        "displayName": {
          "type": "string"
        },
        "derivedTitle": {
          "type": "string"
        },
        "lastMessagePreview": {
          "type": "string"
        },
        "channel": {
          "type": "string"
        },
        "classification": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "accountId": {
          "type": "string",
          "minLength": 1
        },
        "peerKind": {
          "type": "string",
          "minLength": 1
        },
        "isMain": {
          "type": "boolean"
        },
        "isBackground": {
          "type": "boolean"
        },
        "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
            },
            "avatarUrl": {
              "type": "string",
              "minLength": 1
            },
            "identity": {
              "anyOf": [
                {
                  "type": "object",
                  "required": [
                    "type",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "profile"
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "type",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "agent"
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "type",
                    "pluginId",
                    "domain",
                    "idKind",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "remote"
                    },
                    "pluginId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "domain": {
                      "type": "string",
                      "minLength": 1
                    },
                    "idKind": {
                      "type": "string",
                      "minLength": 1
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "type",
                    "pluginId",
                    "accountId",
                    "senderKind",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "observation"
                    },
                    "pluginId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "accountId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "senderKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "human"
                        },
                        {
                          "type": "string",
                          "const": "bot"
                        },
                        {
                          "type": "string",
                          "const": "unknown"
                        }
                      ]
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "type",
                    "actorType",
                    "source",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "legacy"
                    },
                    "actorType": {
                      "type": "string"
                    },
                    "source": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "id": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              ]
            }
          },
          "additionalProperties": false
        },
        "pinned": {
          "type": "boolean"
        },
        "pinnedAt": {
          "type": "number"
        },
        "unread": {
          "type": "boolean"
        },
        "lastReadAt": {
          "type": "number"
        },
        "markedUnreadAt": {
          "type": "number"
        },
        "lastActivityAt": {
          "type": "number"
        },
        "lastInteractionAt": {
          "type": "number"
        },
        "status": {
          "anyOf": [
            {
              "type": "string",
              "const": "queued"
            },
            {
              "type": "string",
              "const": "running"
            },
            {
              "type": "string",
              "const": "done"
            },
            {
              "type": "string",
              "const": "failed"
            },
            {
              "type": "string",
              "const": "killed"
            },
            {
              "type": "string",
              "const": "timeout"
            }
          ]
        },
        "lastRunError": {
          "type": "string"
        },
        "lastRunId": {
          "type": "string",
          "minLength": 1
        },
        "restartRecoveryStatus": {
          "type": "string",
          "const": "tombstoned"
        },
        "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"
        },
        "permissionMode": {
          "anyOf": [
            {
              "type": "string",
              "const": "read-only"
            },
            {
              "type": "string",
              "const": "guarded"
            },
            {
              "type": "string",
              "const": "workspace"
            },
            {
              "type": "string",
              "const": "full"
            }
          ]
        },
        "sessionRoot": {
          "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
            },
            "avatarUrl": {
              "type": "string",
              "minLength": 1
            },
            "identity": {
              "anyOf": [
                {
                  "type": "object",
                  "required": [
                    "type",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "profile"
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "type",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "agent"
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "type",
                    "pluginId",
                    "domain",
                    "idKind",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "remote"
                    },
                    "pluginId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "domain": {
                      "type": "string",
                      "minLength": 1
                    },
                    "idKind": {
                      "type": "string",
                      "minLength": 1
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "type",
                    "pluginId",
                    "accountId",
                    "senderKind",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "observation"
                    },
                    "pluginId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "accountId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "senderKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "human"
                        },
                        {
                          "type": "string",
                          "const": "bot"
                        },
                        {
                          "type": "string",
                          "const": "unknown"
                        }
                      ]
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "type",
                    "actorType",
                    "source",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "legacy"
                    },
                    "actorType": {
                      "type": "string"
                    },
                    "source": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "id": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              ]
            }
          },
          "additionalProperties": false
        },
        "owner": {
          "type": "object",
          "required": [
            "actor"
          ],
          "properties": {
            "actor": {
              "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
                },
                "avatarUrl": {
                  "type": "string",
                  "minLength": 1
                },
                "identity": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "type",
                        "id"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "profile"
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "type",
                        "id"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "agent"
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "type",
                        "pluginId",
                        "domain",
                        "idKind",
                        "id"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "remote"
                        },
                        "pluginId": {
                          "type": "string",
                          "minLength": 1
                        },
                        "domain": {
                          "type": "string",
                          "minLength": 1
                        },
                        "idKind": {
                          "type": "string",
                          "minLength": 1
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "type",
                        "pluginId",
                        "accountId",
                        "senderKind",
                        "id"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "observation"
                        },
                        "pluginId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "accountId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "senderKind": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "human"
                            },
                            {
                              "type": "string",
                              "const": "bot"
                            },
                            {
                              "type": "string",
                              "const": "unknown"
                            }
                          ]
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "type",
                        "actorType",
                        "source",
                        "id"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "legacy"
                        },
                        "actorType": {
                          "type": "string"
                        },
                        "source": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "id": {
                          "type": "string"
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                }
              },
              "additionalProperties": false
            },
            "assignedBy": {
              "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
                },
                "avatarUrl": {
                  "type": "string",
                  "minLength": 1
                },
                "identity": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "type",
                        "id"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "profile"
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "type",
                        "id"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "agent"
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "type",
                        "pluginId",
                        "domain",
                        "idKind",
                        "id"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "remote"
                        },
                        "pluginId": {
                          "type": "string",
                          "minLength": 1
                        },
                        "domain": {
                          "type": "string",
                          "minLength": 1
                        },
                        "idKind": {
                          "type": "string",
                          "minLength": 1
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "type",
                        "pluginId",
                        "accountId",
                        "senderKind",
                        "id"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "observation"
                        },
                        "pluginId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "accountId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "senderKind": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "human"
                            },
                            {
                              "type": "string",
                              "const": "bot"
                            },
                            {
                              "type": "string",
                              "const": "unknown"
                            }
                          ]
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "type",
                        "actorType",
                        "source",
                        "id"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "legacy"
                        },
                        "actorType": {
                          "type": "string"
                        },
                        "source": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "id": {
                          "type": "string"
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                }
              },
              "additionalProperties": false
            },
            "assignedAt": {
              "type": "number",
              "minimum": 0
            }
          },
          "additionalProperties": false
        },
        "participants": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "identity"
            ],
            "properties": {
              "identity": {
                "anyOf": [
                  {
                    "type": "object",
                    "required": [
                      "type",
                      "id"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "profile"
                      },
                      "id": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "required": [
                      "type",
                      "id"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "agent"
                      },
                      "id": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "required": [
                      "type",
                      "pluginId",
                      "domain",
                      "idKind",
                      "id"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "remote"
                      },
                      "pluginId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "domain": {
                        "type": "string",
                        "minLength": 1
                      },
                      "idKind": {
                        "type": "string",
                        "minLength": 1
                      },
                      "id": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "required": [
                      "type",
                      "pluginId",
                      "accountId",
                      "senderKind",
                      "id"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "observation"
                      },
                      "pluginId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "minLength": 1
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "accountId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "minLength": 1
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "senderKind": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "human"
                          },
                          {
                            "type": "string",
                            "const": "bot"
                          },
                          {
                            "type": "string",
                            "const": "unknown"
                          }
                        ]
                      },
                      "id": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "required": [
                      "type",
                      "actorType",
                      "source",
                      "id"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "legacy"
                      },
                      "actorType": {
                        "type": "string"
                      },
                      "source": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "id": {
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  }
                ]
              },
              "label": {
                "type": "string",
                "minLength": 1
              },
              "avatarUrl": {
                "type": "string",
                "minLength": 1
              }
            },
            "additionalProperties": false
          },
          "maxItems": 4
        },
        "participantCount": {
          "type": "integer",
          "minimum": 0
        },
        "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"
        },
        "modelOverrideSource": {
          "anyOf": [
            {
              "type": "string",
              "const": "user"
            },
            {
              "type": "string",
              "const": "auto"
            },
            {
              "type": "null"
            }
          ]
        },
        "toolOverrides": {
          "type": "object",
          "properties": {
            "mcpServers": {
              "type": "object",
              "patternProperties": {
                "^.*$": {
                  "type": "boolean"
                }
              }
            },
            "mcpToolsDeny": {
              "type": "object",
              "patternProperties": {
                "^.*$": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  }
                }
              }
            },
            "skills": {
              "type": "object",
              "patternProperties": {
                "^.*$": {
                  "type": "boolean"
                }
              }
            },
            "webSearch": {
              "type": "boolean"
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": true
    },
    "SessionsCompanionAskParams": {
      "type": "object",
      "required": [
        "sessionKey",
        "question"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "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
        },
        "agentId": {
          "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
        },
        "agentId": {
          "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
    },
    "SessionGitHubPublishParams": {
      "type": "object",
      "required": [
        "idempotencyKey"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "idempotencyKey": {
          "type": "string",
          "minLength": 1
        },
        "title": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256,
          "pattern": "^[^\\r\\n]*\\S[^\\r\\n]*$"
        },
        "body": {
          "type": "string",
          "minLength": 1,
          "maxLength": 8192
        }
      },
      "additionalProperties": false
    },
    "SessionGitHubPublicationRequested": {
      "type": "object",
      "required": [
        "requestId",
        "status",
        "message"
      ],
      "properties": {
        "requestId": {
          "type": "string",
          "minLength": 1
        },
        "status": {
          "type": "string",
          "const": "requested"
        },
        "message": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SessionGitHubPublicationPublishing": {
      "type": "object",
      "required": [
        "requestId",
        "status",
        "message"
      ],
      "properties": {
        "requestId": {
          "type": "string",
          "minLength": 1
        },
        "status": {
          "type": "string",
          "const": "publishing"
        },
        "message": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SessionGitHubPublicationPublished": {
      "type": "object",
      "required": [
        "requestId",
        "status",
        "url",
        "repository",
        "branch",
        "headCommit"
      ],
      "properties": {
        "requestId": {
          "type": "string",
          "minLength": 1
        },
        "status": {
          "type": "string",
          "const": "published"
        },
        "url": {
          "type": "string",
          "minLength": 1
        },
        "repository": {
          "type": "string",
          "minLength": 1
        },
        "branch": {
          "type": "string",
          "minLength": 1
        },
        "headCommit": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SessionGitHubPublicationFailed": {
      "type": "object",
      "required": [
        "requestId",
        "status",
        "code",
        "message",
        "nextAction"
      ],
      "properties": {
        "requestId": {
          "type": "string",
          "minLength": 1
        },
        "status": {
          "type": "string",
          "const": "failed"
        },
        "code": {
          "anyOf": [
            {
              "type": "string",
              "const": "identity_changed"
            },
            {
              "type": "string",
              "const": "identity_unavailable"
            },
            {
              "type": "string",
              "const": "session_changed"
            },
            {
              "type": "string",
              "const": "workspace_changed"
            },
            {
              "type": "string",
              "const": "not_git"
            },
            {
              "type": "string",
              "const": "not_github"
            },
            {
              "type": "string",
              "const": "no_changes"
            },
            {
              "type": "string",
              "const": "push_rejected"
            },
            {
              "type": "string",
              "const": "github_rejected"
            },
            {
              "type": "string",
              "const": "unavailable"
            }
          ]
        },
        "message": {
          "type": "string",
          "minLength": 1
        },
        "nextAction": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SessionGitHubPublicationResult": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "requestId",
            "status",
            "message"
          ],
          "properties": {
            "requestId": {
              "type": "string",
              "minLength": 1
            },
            "status": {
              "type": "string",
              "const": "requested"
            },
            "message": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "requestId",
            "status",
            "message"
          ],
          "properties": {
            "requestId": {
              "type": "string",
              "minLength": 1
            },
            "status": {
              "type": "string",
              "const": "publishing"
            },
            "message": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "requestId",
            "status",
            "url",
            "repository",
            "branch",
            "headCommit"
          ],
          "properties": {
            "requestId": {
              "type": "string",
              "minLength": 1
            },
            "status": {
              "type": "string",
              "const": "published"
            },
            "url": {
              "type": "string",
              "minLength": 1
            },
            "repository": {
              "type": "string",
              "minLength": 1
            },
            "branch": {
              "type": "string",
              "minLength": 1
            },
            "headCommit": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "requestId",
            "status",
            "code",
            "message",
            "nextAction"
          ],
          "properties": {
            "requestId": {
              "type": "string",
              "minLength": 1
            },
            "status": {
              "type": "string",
              "const": "failed"
            },
            "code": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "identity_changed"
                },
                {
                  "type": "string",
                  "const": "identity_unavailable"
                },
                {
                  "type": "string",
                  "const": "session_changed"
                },
                {
                  "type": "string",
                  "const": "workspace_changed"
                },
                {
                  "type": "string",
                  "const": "not_git"
                },
                {
                  "type": "string",
                  "const": "not_github"
                },
                {
                  "type": "string",
                  "const": "no_changes"
                },
                {
                  "type": "string",
                  "const": "push_rejected"
                },
                {
                  "type": "string",
                  "const": "github_rejected"
                },
                {
                  "type": "string",
                  "const": "unavailable"
                }
              ]
            },
            "message": {
              "type": "string",
              "minLength": 1
            },
            "nextAction": {
              "type": "string",
              "minLength": 1
            }
          },
          "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
        },
        "avatarUrl": {
          "type": "string",
          "minLength": 1
        },
        "identity": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "type",
                "id"
              ],
              "properties": {
                "type": {
                  "type": "string",
                  "const": "profile"
                },
                "id": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "type",
                "id"
              ],
              "properties": {
                "type": {
                  "type": "string",
                  "const": "agent"
                },
                "id": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "type",
                "pluginId",
                "domain",
                "idKind",
                "id"
              ],
              "properties": {
                "type": {
                  "type": "string",
                  "const": "remote"
                },
                "pluginId": {
                  "type": "string",
                  "minLength": 1
                },
                "domain": {
                  "type": "string",
                  "minLength": 1
                },
                "idKind": {
                  "type": "string",
                  "minLength": 1
                },
                "id": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "type",
                "pluginId",
                "accountId",
                "senderKind",
                "id"
              ],
              "properties": {
                "type": {
                  "type": "string",
                  "const": "observation"
                },
                "pluginId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "accountId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "senderKind": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "human"
                    },
                    {
                      "type": "string",
                      "const": "bot"
                    },
                    {
                      "type": "string",
                      "const": "unknown"
                    }
                  ]
                },
                "id": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "type",
                "actorType",
                "source",
                "id"
              ],
              "properties": {
                "type": {
                  "type": "string",
                  "const": "legacy"
                },
                "actorType": {
                  "type": "string"
                },
                "source": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "id": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            }
          ]
        }
      },
      "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
    },
    "SessionMemberEvidence": {
      "type": "object",
      "required": [
        "identityId",
        "addedAt"
      ],
      "properties": {
        "identityId": {
          "type": "string",
          "minLength": 1
        },
        "addedBy": {
          "type": "string",
          "minLength": 1
        },
        "addedByState": {
          "type": "string",
          "const": "unknown"
        },
        "addedAt": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false,
      "not": {
        "required": [
          "addedBy",
          "addedByState"
        ]
      }
    },
    "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
            },
            "avatarUrl": {
              "type": "string",
              "minLength": 1
            },
            "identity": {
              "anyOf": [
                {
                  "type": "object",
                  "required": [
                    "type",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "profile"
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "type",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "agent"
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "type",
                    "pluginId",
                    "domain",
                    "idKind",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "remote"
                    },
                    "pluginId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "domain": {
                      "type": "string",
                      "minLength": 1
                    },
                    "idKind": {
                      "type": "string",
                      "minLength": 1
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "type",
                    "pluginId",
                    "accountId",
                    "senderKind",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "observation"
                    },
                    "pluginId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "accountId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "senderKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "human"
                        },
                        {
                          "type": "string",
                          "const": "bot"
                        },
                        {
                          "type": "string",
                          "const": "unknown"
                        }
                      ]
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "type",
                    "actorType",
                    "source",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "legacy"
                    },
                    "actorType": {
                      "type": "string"
                    },
                    "source": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "id": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              ]
            }
          },
          "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
              },
              "avatarUrl": {
                "type": "string",
                "minLength": 1
              },
              "identity": {
                "anyOf": [
                  {
                    "type": "object",
                    "required": [
                      "type",
                      "id"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "profile"
                      },
                      "id": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "required": [
                      "type",
                      "id"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "agent"
                      },
                      "id": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "required": [
                      "type",
                      "pluginId",
                      "domain",
                      "idKind",
                      "id"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "remote"
                      },
                      "pluginId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "domain": {
                        "type": "string",
                        "minLength": 1
                      },
                      "idKind": {
                        "type": "string",
                        "minLength": 1
                      },
                      "id": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "required": [
                      "type",
                      "pluginId",
                      "accountId",
                      "senderKind",
                      "id"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "observation"
                      },
                      "pluginId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "minLength": 1
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "accountId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "minLength": 1
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "senderKind": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "human"
                          },
                          {
                            "type": "string",
                            "const": "bot"
                          },
                          {
                            "type": "string",
                            "const": "unknown"
                          }
                        ]
                      },
                      "id": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "required": [
                      "type",
                      "actorType",
                      "source",
                      "id"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "legacy"
                      },
                      "actorType": {
                        "type": "string"
                      },
                      "source": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "id": {
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  }
                ]
              }
            },
            "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
    },
    "SessionMembersListEvidenceResult": {
      "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
            },
            "avatarUrl": {
              "type": "string",
              "minLength": 1
            },
            "identity": {
              "anyOf": [
                {
                  "type": "object",
                  "required": [
                    "type",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "profile"
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "type",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "agent"
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "type",
                    "pluginId",
                    "domain",
                    "idKind",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "remote"
                    },
                    "pluginId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "domain": {
                      "type": "string",
                      "minLength": 1
                    },
                    "idKind": {
                      "type": "string",
                      "minLength": 1
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "type",
                    "pluginId",
                    "accountId",
                    "senderKind",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "observation"
                    },
                    "pluginId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "accountId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "senderKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "human"
                        },
                        {
                          "type": "string",
                          "const": "bot"
                        },
                        {
                          "type": "string",
                          "const": "unknown"
                        }
                      ]
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "type",
                    "actorType",
                    "source",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "legacy"
                    },
                    "actorType": {
                      "type": "string"
                    },
                    "source": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "id": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              ]
            }
          },
          "additionalProperties": false
        },
        "members": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "identityId",
              "addedAt"
            ],
            "properties": {
              "identityId": {
                "type": "string",
                "minLength": 1
              },
              "addedBy": {
                "type": "string",
                "minLength": 1
              },
              "addedByState": {
                "type": "string",
                "const": "unknown"
              },
              "addedAt": {
                "type": "integer",
                "minimum": 0
              }
            },
            "additionalProperties": false,
            "not": {
              "required": [
                "addedBy",
                "addedByState"
              ]
            }
          }
        },
        "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
              },
              "avatarUrl": {
                "type": "string",
                "minLength": 1
              },
              "identity": {
                "anyOf": [
                  {
                    "type": "object",
                    "required": [
                      "type",
                      "id"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "profile"
                      },
                      "id": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "required": [
                      "type",
                      "id"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "agent"
                      },
                      "id": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "required": [
                      "type",
                      "pluginId",
                      "domain",
                      "idKind",
                      "id"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "remote"
                      },
                      "pluginId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "domain": {
                        "type": "string",
                        "minLength": 1
                      },
                      "idKind": {
                        "type": "string",
                        "minLength": 1
                      },
                      "id": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "required": [
                      "type",
                      "pluginId",
                      "accountId",
                      "senderKind",
                      "id"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "observation"
                      },
                      "pluginId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "minLength": 1
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "accountId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "minLength": 1
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "senderKind": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "human"
                          },
                          {
                            "type": "string",
                            "const": "bot"
                          },
                          {
                            "type": "string",
                            "const": "unknown"
                          }
                        ]
                      },
                      "id": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "required": [
                      "type",
                      "actorType",
                      "source",
                      "id"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "legacy"
                      },
                      "actorType": {
                        "type": "string"
                      },
                      "source": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "id": {
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  }
                ]
              }
            },
            "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
            },
            "avatarUrl": {
              "type": "string",
              "minLength": 1
            },
            "identity": {
              "anyOf": [
                {
                  "type": "object",
                  "required": [
                    "type",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "profile"
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "type",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "agent"
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "type",
                    "pluginId",
                    "domain",
                    "idKind",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "remote"
                    },
                    "pluginId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "domain": {
                      "type": "string",
                      "minLength": 1
                    },
                    "idKind": {
                      "type": "string",
                      "minLength": 1
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "type",
                    "pluginId",
                    "accountId",
                    "senderKind",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "observation"
                    },
                    "pluginId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "accountId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "senderKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "human"
                        },
                        {
                          "type": "string",
                          "const": "bot"
                        },
                        {
                          "type": "string",
                          "const": "unknown"
                        }
                      ]
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "type",
                    "actorType",
                    "source",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "legacy"
                    },
                    "actorType": {
                      "type": "string"
                    },
                    "source": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "id": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              ]
            }
          },
          "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
    },
    "SessionSharingEvidenceEvent": {
      "type": "object",
      "required": [
        "action",
        "sessionKey",
        "agentId",
        "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
        },
        "actorState": {
          "type": "string",
          "const": "unknown"
        },
        "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
            },
            "avatarUrl": {
              "type": "string",
              "minLength": 1
            },
            "identity": {
              "anyOf": [
                {
                  "type": "object",
                  "required": [
                    "type",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "profile"
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "type",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "agent"
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "type",
                    "pluginId",
                    "domain",
                    "idKind",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "remote"
                    },
                    "pluginId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "domain": {
                      "type": "string",
                      "minLength": 1
                    },
                    "idKind": {
                      "type": "string",
                      "minLength": 1
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "type",
                    "pluginId",
                    "accountId",
                    "senderKind",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "observation"
                    },
                    "pluginId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "accountId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "senderKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "human"
                        },
                        {
                          "type": "string",
                          "const": "bot"
                        },
                        {
                          "type": "string",
                          "const": "unknown"
                        }
                      ]
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "type",
                    "actorType",
                    "source",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "legacy"
                    },
                    "actorType": {
                      "type": "string"
                    },
                    "source": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "id": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              ]
            }
          },
          "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
                },
                "avatarUrl": {
                  "type": "string",
                  "minLength": 1
                },
                "identity": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "type",
                        "id"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "profile"
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "type",
                        "id"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "agent"
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "type",
                        "pluginId",
                        "domain",
                        "idKind",
                        "id"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "remote"
                        },
                        "pluginId": {
                          "type": "string",
                          "minLength": 1
                        },
                        "domain": {
                          "type": "string",
                          "minLength": 1
                        },
                        "idKind": {
                          "type": "string",
                          "minLength": 1
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "type",
                        "pluginId",
                        "accountId",
                        "senderKind",
                        "id"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "observation"
                        },
                        "pluginId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "accountId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "senderKind": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "human"
                            },
                            {
                              "type": "string",
                              "const": "bot"
                            },
                            {
                              "type": "string",
                              "const": "unknown"
                            }
                          ]
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "type",
                        "actorType",
                        "source",
                        "id"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "legacy"
                        },
                        "actorType": {
                          "type": "string"
                        },
                        "source": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "id": {
                          "type": "string"
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                }
              },
              "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
                  },
                  "avatarUrl": {
                    "type": "string",
                    "minLength": 1
                  },
                  "identity": {
                    "anyOf": [
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "id"
                        ],
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "profile"
                          },
                          "id": {
                            "type": "string",
                            "minLength": 1
                          }
                        },
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "id"
                        ],
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "agent"
                          },
                          "id": {
                            "type": "string",
                            "minLength": 1
                          }
                        },
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "pluginId",
                          "domain",
                          "idKind",
                          "id"
                        ],
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "remote"
                          },
                          "pluginId": {
                            "type": "string",
                            "minLength": 1
                          },
                          "domain": {
                            "type": "string",
                            "minLength": 1
                          },
                          "idKind": {
                            "type": "string",
                            "minLength": 1
                          },
                          "id": {
                            "type": "string",
                            "minLength": 1
                          }
                        },
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "pluginId",
                          "accountId",
                          "senderKind",
                          "id"
                        ],
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "observation"
                          },
                          "pluginId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 1
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "accountId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "minLength": 1
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "senderKind": {
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "human"
                              },
                              {
                                "type": "string",
                                "const": "bot"
                              },
                              {
                                "type": "string",
                                "const": "unknown"
                              }
                            ]
                          },
                          "id": {
                            "type": "string",
                            "minLength": 1
                          }
                        },
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "actorType",
                          "source",
                          "id"
                        ],
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "legacy"
                          },
                          "actorType": {
                            "type": "string"
                          },
                          "source": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "id": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    ]
                  }
                },
                "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
                },
                "avatarUrl": {
                  "type": "string",
                  "minLength": 1
                },
                "identity": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "type",
                        "id"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "profile"
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "type",
                        "id"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "agent"
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "type",
                        "pluginId",
                        "domain",
                        "idKind",
                        "id"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "remote"
                        },
                        "pluginId": {
                          "type": "string",
                          "minLength": 1
                        },
                        "domain": {
                          "type": "string",
                          "minLength": 1
                        },
                        "idKind": {
                          "type": "string",
                          "minLength": 1
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "type",
                        "pluginId",
                        "accountId",
                        "senderKind",
                        "id"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "observation"
                        },
                        "pluginId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "accountId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "senderKind": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "human"
                            },
                            {
                              "type": "string",
                              "const": "bot"
                            },
                            {
                              "type": "string",
                              "const": "unknown"
                            }
                          ]
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "type",
                        "actorType",
                        "source",
                        "id"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "legacy"
                        },
                        "actorType": {
                          "type": "string"
                        },
                        "source": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "id": {
                          "type": "string"
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                }
              },
              "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
                },
                "avatarUrl": {
                  "type": "string",
                  "minLength": 1
                },
                "identity": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "type",
                        "id"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "profile"
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "type",
                        "id"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "agent"
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "type",
                        "pluginId",
                        "domain",
                        "idKind",
                        "id"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "remote"
                        },
                        "pluginId": {
                          "type": "string",
                          "minLength": 1
                        },
                        "domain": {
                          "type": "string",
                          "minLength": 1
                        },
                        "idKind": {
                          "type": "string",
                          "minLength": 1
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "type",
                        "pluginId",
                        "accountId",
                        "senderKind",
                        "id"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "observation"
                        },
                        "pluginId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "accountId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "senderKind": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "human"
                            },
                            {
                              "type": "string",
                              "const": "bot"
                            },
                            {
                              "type": "string",
                              "const": "unknown"
                            }
                          ]
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "type",
                        "actorType",
                        "source",
                        "id"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "legacy"
                        },
                        "actorType": {
                          "type": "string"
                        },
                        "source": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "id": {
                          "type": "string"
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                }
              },
              "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"
        },
        "preview": {
          "type": "string",
          "maxLength": 400
        }
      },
      "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
            },
            "avatarUrl": {
              "type": "string",
              "minLength": 1
            },
            "identity": {
              "anyOf": [
                {
                  "type": "object",
                  "required": [
                    "type",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "profile"
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "type",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "agent"
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "type",
                    "pluginId",
                    "domain",
                    "idKind",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "remote"
                    },
                    "pluginId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "domain": {
                      "type": "string",
                      "minLength": 1
                    },
                    "idKind": {
                      "type": "string",
                      "minLength": 1
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "type",
                    "pluginId",
                    "accountId",
                    "senderKind",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "observation"
                    },
                    "pluginId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "accountId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "minLength": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "senderKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "human"
                        },
                        {
                          "type": "string",
                          "const": "bot"
                        },
                        {
                          "type": "string",
                          "const": "unknown"
                        }
                      ]
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "type",
                    "actorType",
                    "source",
                    "id"
                  ],
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "legacy"
                    },
                    "actorType": {
                      "type": "string"
                    },
                    "source": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "id": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              ]
            }
          },
          "additionalProperties": false
        },
        "typing": {
          "type": "boolean"
        },
        "preview": {
          "type": "string",
          "maxLength": 400
        },
        "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"
        }
      ]
    },
    "SessionPlacementDiskSpace": {
      "type": "object",
      "required": [
        "status",
        "availableBytes",
        "totalBytes",
        "observedAtMs"
      ],
      "properties": {
        "status": {
          "anyOf": [
            {
              "type": "string",
              "const": "ok"
            },
            {
              "type": "string",
              "const": "warning"
            },
            {
              "type": "string",
              "const": "critical"
            }
          ]
        },
        "availableBytes": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "totalBytes": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "observedAtMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        }
      },
      "additionalProperties": false
    },
    "SessionPlacementRunner": {
      "type": "object",
      "required": [
        "kind",
        "status"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "const": "device"
        },
        "status": {
          "anyOf": [
            {
              "type": "string",
              "const": "available"
            },
            {
              "type": "string",
              "const": "offline"
            }
          ]
        },
        "deviceId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256,
          "pattern": "^\\S(?:.*\\S)?$"
        }
      },
      "additionalProperties": false
    },
    "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
        },
        "providerId": {
          "type": "string",
          "minLength": 1
        },
        "profileId": {
          "type": "string",
          "minLength": 1
        },
        "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
        },
        "providerId": {
          "type": "string",
          "minLength": 1
        },
        "profileId": {
          "type": "string",
          "minLength": 1
        },
        "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
        },
        "providerId": {
          "type": "string",
          "minLength": 1
        },
        "profileId": {
          "type": "string",
          "minLength": 1
        },
        "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
        },
        "providerId": {
          "type": "string",
          "minLength": 1
        },
        "profileId": {
          "type": "string",
          "minLength": 1
        },
        "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
        },
        "diskSpace": {
          "type": "object",
          "required": [
            "status",
            "availableBytes",
            "totalBytes",
            "observedAtMs"
          ],
          "properties": {
            "status": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "ok"
                },
                {
                  "type": "string",
                  "const": "warning"
                },
                {
                  "type": "string",
                  "const": "critical"
                }
              ]
            },
            "availableBytes": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "totalBytes": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "observedAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            }
          },
          "additionalProperties": false
        },
        "runner": {
          "type": "object",
          "required": [
            "kind",
            "status"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "device"
            },
            "status": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "available"
                },
                {
                  "type": "string",
                  "const": "offline"
                }
              ]
            },
            "deviceId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "pattern": "^\\S(?:.*\\S)?$"
            }
          },
          "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
        },
        "providerId": {
          "type": "string",
          "minLength": 1
        },
        "profileId": {
          "type": "string",
          "minLength": 1
        },
        "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
        },
        "diskSpace": {
          "type": "object",
          "required": [
            "status",
            "availableBytes",
            "totalBytes",
            "observedAtMs"
          ],
          "properties": {
            "status": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "ok"
                },
                {
                  "type": "string",
                  "const": "warning"
                },
                {
                  "type": "string",
                  "const": "critical"
                }
              ]
            },
            "availableBytes": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "totalBytes": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "observedAtMs": {
              "type": "integer",
              "minimum": 0,
              "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
        },
        "providerId": {
          "type": "string",
          "minLength": 1
        },
        "profileId": {
          "type": "string",
          "minLength": 1
        },
        "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
        },
        "diskSpace": {
          "type": "object",
          "required": [
            "status",
            "availableBytes",
            "totalBytes",
            "observedAtMs"
          ],
          "properties": {
            "status": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "ok"
                },
                {
                  "type": "string",
                  "const": "warning"
                },
                {
                  "type": "string",
                  "const": "critical"
                }
              ]
            },
            "availableBytes": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "totalBytes": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "observedAtMs": {
              "type": "integer",
              "minimum": 0,
              "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
        },
        "providerId": {
          "type": "string",
          "minLength": 1
        },
        "profileId": {
          "type": "string",
          "minLength": 1
        },
        "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
        },
        "terminalReason": {
          "type": "string",
          "minLength": 1
        },
        "terminalAtMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        }
      },
      "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
        },
        "providerId": {
          "type": "string",
          "minLength": 1
        },
        "profileId": {
          "type": "string",
          "minLength": 1
        },
        "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
        },
        "terminalReason": {
          "type": "string",
          "minLength": 1
        },
        "terminalAtMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "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
            },
            "providerId": {
              "type": "string",
              "minLength": 1
            },
            "profileId": {
              "type": "string",
              "minLength": 1
            },
            "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
            },
            "providerId": {
              "type": "string",
              "minLength": 1
            },
            "profileId": {
              "type": "string",
              "minLength": 1
            },
            "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
            },
            "providerId": {
              "type": "string",
              "minLength": 1
            },
            "profileId": {
              "type": "string",
              "minLength": 1
            },
            "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
            },
            "providerId": {
              "type": "string",
              "minLength": 1
            },
            "profileId": {
              "type": "string",
              "minLength": 1
            },
            "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
            },
            "diskSpace": {
              "type": "object",
              "required": [
                "status",
                "availableBytes",
                "totalBytes",
                "observedAtMs"
              ],
              "properties": {
                "status": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "ok"
                    },
                    {
                      "type": "string",
                      "const": "warning"
                    },
                    {
                      "type": "string",
                      "const": "critical"
                    }
                  ]
                },
                "availableBytes": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "totalBytes": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "observedAtMs": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                }
              },
              "additionalProperties": false
            },
            "runner": {
              "type": "object",
              "required": [
                "kind",
                "status"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "device"
                },
                "status": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "available"
                    },
                    {
                      "type": "string",
                      "const": "offline"
                    }
                  ]
                },
                "deviceId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256,
                  "pattern": "^\\S(?:.*\\S)?$"
                }
              },
              "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
            },
            "providerId": {
              "type": "string",
              "minLength": 1
            },
            "profileId": {
              "type": "string",
              "minLength": 1
            },
            "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
            },
            "diskSpace": {
              "type": "object",
              "required": [
                "status",
                "availableBytes",
                "totalBytes",
                "observedAtMs"
              ],
              "properties": {
                "status": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "ok"
                    },
                    {
                      "type": "string",
                      "const": "warning"
                    },
                    {
                      "type": "string",
                      "const": "critical"
                    }
                  ]
                },
                "availableBytes": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "totalBytes": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "observedAtMs": {
                  "type": "integer",
                  "minimum": 0,
                  "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
            },
            "providerId": {
              "type": "string",
              "minLength": 1
            },
            "profileId": {
              "type": "string",
              "minLength": 1
            },
            "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
            },
            "diskSpace": {
              "type": "object",
              "required": [
                "status",
                "availableBytes",
                "totalBytes",
                "observedAtMs"
              ],
              "properties": {
                "status": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "ok"
                    },
                    {
                      "type": "string",
                      "const": "warning"
                    },
                    {
                      "type": "string",
                      "const": "critical"
                    }
                  ]
                },
                "availableBytes": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "totalBytes": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "observedAtMs": {
                  "type": "integer",
                  "minimum": 0,
                  "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
            },
            "providerId": {
              "type": "string",
              "minLength": 1
            },
            "profileId": {
              "type": "string",
              "minLength": 1
            },
            "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
            },
            "terminalReason": {
              "type": "string",
              "minLength": 1
            },
            "terminalAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            }
          },
          "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
            },
            "providerId": {
              "type": "string",
              "minLength": 1
            },
            "profileId": {
              "type": "string",
              "minLength": 1
            },
            "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
            },
            "terminalReason": {
              "type": "string",
              "minLength": 1
            },
            "terminalAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "recoveryError": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "SessionsDispatchParams": {
      "type": "object",
      "required": [
        "key"
      ],
      "properties": {
        "key": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "profileId": {
          "type": "string",
          "minLength": 1
        },
        "deviceId": {
          "type": "string",
          "minLength": 1
        },
        "autoDevice": {
          "type": "boolean",
          "const": true
        },
        "machineClass": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        }
      },
      "additionalProperties": false,
      "oneOf": [
        {
          "required": [
            "profileId"
          ],
          "not": {
            "anyOf": [
              {
                "required": [
                  "deviceId"
                ]
              },
              {
                "required": [
                  "autoDevice"
                ]
              }
            ]
          }
        },
        {
          "required": [
            "deviceId"
          ],
          "not": {
            "anyOf": [
              {
                "required": [
                  "profileId"
                ]
              },
              {
                "required": [
                  "autoDevice"
                ]
              },
              {
                "required": [
                  "machineClass"
                ]
              }
            ]
          }
        },
        {
          "required": [
            "autoDevice"
          ],
          "not": {
            "anyOf": [
              {
                "required": [
                  "profileId"
                ]
              },
              {
                "required": [
                  "deviceId"
                ]
              },
              {
                "required": [
                  "machineClass"
                ]
              }
            ]
          }
        },
        {
          "not": {
            "anyOf": [
              {
                "required": [
                  "profileId"
                ]
              },
              {
                "required": [
                  "deviceId"
                ]
              },
              {
                "required": [
                  "autoDevice"
                ]
              },
              {
                "required": [
                  "machineClass"
                ]
              }
            ]
          }
        }
      ]
    },
    "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
            },
            "providerId": {
              "type": "string",
              "minLength": 1
            },
            "profileId": {
              "type": "string",
              "minLength": 1
            },
            "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
            },
            "diskSpace": {
              "type": "object",
              "required": [
                "status",
                "availableBytes",
                "totalBytes",
                "observedAtMs"
              ],
              "properties": {
                "status": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "ok"
                    },
                    {
                      "type": "string",
                      "const": "warning"
                    },
                    {
                      "type": "string",
                      "const": "critical"
                    }
                  ]
                },
                "availableBytes": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "totalBytes": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "observedAtMs": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                }
              },
              "additionalProperties": false
            },
            "runner": {
              "type": "object",
              "required": [
                "kind",
                "status"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "device"
                },
                "status": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "available"
                    },
                    {
                      "type": "string",
                      "const": "offline"
                    }
                  ]
                },
                "deviceId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256,
                  "pattern": "^\\S(?:.*\\S)?$"
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "SessionsReclaimParams": {
      "type": "object",
      "required": [
        "key"
      ],
      "properties": {
        "key": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SessionsReclaimResultPlacement": {
      "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": "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
            },
            "providerId": {
              "type": "string",
              "minLength": 1
            },
            "profileId": {
              "type": "string",
              "minLength": 1
            },
            "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
            },
            "terminalReason": {
              "type": "string",
              "minLength": 1
            },
            "terminalAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            }
          },
          "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": {
          "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": "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
                },
                "providerId": {
                  "type": "string",
                  "minLength": 1
                },
                "profileId": {
                  "type": "string",
                  "minLength": 1
                },
                "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
                },
                "terminalReason": {
                  "type": "string",
                  "minLength": 1
                },
                "terminalAtMs": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                }
              },
              "additionalProperties": false
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "SessionMoveExpectedSource": {
      "type": "object",
      "required": [
        "generation",
        "environmentId",
        "ownerEpoch"
      ],
      "properties": {
        "generation": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "environmentId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256,
          "pattern": "^\\S(?:.*\\S)?$"
        },
        "ownerEpoch": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        }
      },
      "additionalProperties": false
    },
    "SessionMoveGatewayTarget": {
      "type": "object",
      "required": [
        "kind"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "const": "gateway"
        }
      },
      "additionalProperties": false
    },
    "SessionMoveProfileTarget": {
      "type": "object",
      "required": [
        "kind",
        "profileId"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "const": "profile"
        },
        "profileId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256,
          "pattern": "^\\S(?:.*\\S)?$"
        },
        "machineClass": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        }
      },
      "additionalProperties": false
    },
    "SessionMoveDeviceTarget": {
      "type": "object",
      "required": [
        "kind",
        "deviceId"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "const": "device"
        },
        "deviceId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256,
          "pattern": "^\\S(?:.*\\S)?$"
        }
      },
      "additionalProperties": false
    },
    "SessionMoveTarget": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "kind"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "gateway"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "kind",
            "profileId"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "profile"
            },
            "profileId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "pattern": "^\\S(?:.*\\S)?$"
            },
            "machineClass": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "kind",
            "deviceId"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "device"
            },
            "deviceId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "pattern": "^\\S(?:.*\\S)?$"
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "SessionPlacementMove": {
      "type": "object",
      "required": [
        "target",
        "updatedAtMs"
      ],
      "properties": {
        "target": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "kind"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "gateway"
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "kind",
                "profileId"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "profile"
                },
                "profileId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256,
                  "pattern": "^\\S(?:.*\\S)?$"
                },
                "machineClass": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "kind",
                "deviceId"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "device"
                },
                "deviceId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256,
                  "pattern": "^\\S(?:.*\\S)?$"
                }
              },
              "additionalProperties": false
            }
          ]
        },
        "updatedAtMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "error": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        }
      },
      "additionalProperties": false
    },
    "SessionsMoveParams": {
      "type": "object",
      "required": [
        "key",
        "expected",
        "target"
      ],
      "properties": {
        "key": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "expected": {
          "type": "object",
          "required": [
            "generation",
            "environmentId",
            "ownerEpoch"
          ],
          "properties": {
            "generation": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "environmentId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "pattern": "^\\S(?:.*\\S)?$"
            },
            "ownerEpoch": {
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            }
          },
          "additionalProperties": false
        },
        "target": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "kind"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "gateway"
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "kind",
                "profileId"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "profile"
                },
                "profileId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256,
                  "pattern": "^\\S(?:.*\\S)?$"
                },
                "machineClass": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "kind",
                "deviceId"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "device"
                },
                "deviceId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256,
                  "pattern": "^\\S(?:.*\\S)?$"
                }
              },
              "additionalProperties": false
            }
          ]
        },
        "abandonSource": {
          "type": "boolean",
          "const": true
        }
      },
      "additionalProperties": false,
      "allOf": [
        {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "target"
              ],
              "properties": {
                "target": {
                  "type": "object",
                  "required": [
                    "kind"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "gateway"
                    }
                  },
                  "additionalProperties": false
                }
              }
            },
            {
              "type": "object",
              "required": [
                "target"
              ],
              "properties": {
                "target": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "profileId"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "profile"
                        },
                        "profileId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256,
                          "pattern": "^\\S(?:.*\\S)?$"
                        },
                        "machineClass": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "deviceId"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "device"
                        },
                        "deviceId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256,
                          "pattern": "^\\S(?:.*\\S)?$"
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                }
              },
              "not": {
                "required": [
                  "abandonSource"
                ]
              }
            }
          ]
        }
      ]
    },
    "SessionMovePlacementState": {
      "anyOf": [
        {
          "type": "string",
          "const": "local"
        },
        {
          "type": "string",
          "const": "active"
        }
      ]
    },
    "SessionMovePlacement": {
      "type": "object",
      "required": [
        "state",
        "generation"
      ],
      "properties": {
        "state": {
          "anyOf": [
            {
              "type": "string",
              "const": "local"
            },
            {
              "type": "string",
              "const": "active"
            }
          ]
        },
        "generation": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        }
      },
      "additionalProperties": false
    },
    "SessionsMoveResult": {
      "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"
          ],
          "properties": {
            "state": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "local"
                },
                {
                  "type": "string",
                  "const": "active"
                }
              ]
            },
            "generation": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            }
          },
          "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
        },
        "agentId": {
          "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
        },
        "agentId": {
          "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
    },
    "SessionsGoalUpdateParams": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "sessionKey",
            "goalId",
            "operationId",
            "issuedAtMs",
            "action",
            "objective"
          ],
          "properties": {
            "sessionKey": {
              "type": "string",
              "minLength": 1
            },
            "agentId": {
              "type": "string",
              "minLength": 1
            },
            "sessionId": {
              "type": "string",
              "minLength": 1
            },
            "goalId": {
              "type": "string",
              "minLength": 1
            },
            "operationId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "issuedAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "action": {
              "type": "string",
              "const": "edit"
            },
            "objective": {
              "type": "string",
              "minLength": 1,
              "maxLength": 16000
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "sessionKey",
            "goalId",
            "operationId",
            "issuedAtMs",
            "action"
          ],
          "properties": {
            "sessionKey": {
              "type": "string",
              "minLength": 1
            },
            "agentId": {
              "type": "string",
              "minLength": 1
            },
            "sessionId": {
              "type": "string",
              "minLength": 1
            },
            "goalId": {
              "type": "string",
              "minLength": 1
            },
            "operationId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "issuedAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "action": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "pause"
                },
                {
                  "type": "string",
                  "const": "resume"
                },
                {
                  "type": "string",
                  "const": "complete"
                },
                {
                  "type": "string",
                  "const": "block"
                }
              ]
            },
            "note": {
              "type": "string",
              "maxLength": 2000
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "SessionsGoalClearParams": {
      "type": "object",
      "required": [
        "sessionKey",
        "goalId",
        "operationId",
        "issuedAtMs"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "sessionId": {
          "type": "string",
          "minLength": 1
        },
        "goalId": {
          "type": "string",
          "minLength": 1
        },
        "operationId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "issuedAtMs": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "SessionsGoalMutationResult": {
      "type": "object",
      "required": [
        "operationId",
        "action",
        "sessionId",
        "goalId",
        "status"
      ],
      "properties": {
        "operationId": {
          "type": "string",
          "minLength": 1
        },
        "action": {
          "anyOf": [
            {
              "type": "string",
              "const": "start"
            },
            {
              "type": "string",
              "const": "edit"
            },
            {
              "type": "string",
              "const": "pause"
            },
            {
              "type": "string",
              "const": "resume"
            },
            {
              "type": "string",
              "const": "complete"
            },
            {
              "type": "string",
              "const": "block"
            },
            {
              "type": "string",
              "const": "clear"
            }
          ]
        },
        "sessionId": {
          "type": "string",
          "minLength": 1
        },
        "goalId": {
          "type": "string",
          "minLength": 1
        },
        "goal": {
          "type": "object",
          "required": [
            "schemaVersion",
            "id",
            "objective",
            "status",
            "createdAt",
            "updatedAt",
            "tokenStart",
            "tokensUsed",
            "continuationTurns"
          ],
          "properties": {
            "schemaVersion": {
              "type": "number",
              "const": 1
            },
            "id": {
              "type": "string",
              "minLength": 1
            },
            "objective": {
              "type": "string"
            },
            "status": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "active"
                },
                {
                  "type": "string",
                  "const": "paused"
                },
                {
                  "type": "string",
                  "const": "blocked"
                },
                {
                  "type": "string",
                  "const": "usage_limited"
                },
                {
                  "type": "string",
                  "const": "budget_limited"
                },
                {
                  "type": "string",
                  "const": "complete"
                }
              ]
            },
            "createdAt": {
              "type": "number"
            },
            "updatedAt": {
              "type": "number"
            },
            "tokenStart": {
              "type": "number"
            },
            "tokenStartFresh": {
              "type": "boolean"
            },
            "tokensUsed": {
              "type": "number"
            },
            "tokenBudget": {
              "type": "number"
            },
            "continuationTurns": {
              "type": "number"
            },
            "lastStatusNote": {
              "type": "string"
            },
            "pausedAt": {
              "type": "number"
            },
            "blockedAt": {
              "type": "number"
            },
            "completedAt": {
              "type": "number"
            },
            "usageLimitedAt": {
              "type": "number"
            },
            "budgetLimitedAt": {
              "type": "number"
            }
          },
          "additionalProperties": false
        },
        "runId": {
          "type": "string",
          "minLength": 1
        },
        "replayed": {
          "type": "boolean",
          "const": true
        },
        "status": {
          "anyOf": [
            {
              "type": "string",
              "const": "started"
            },
            {
              "type": "string",
              "const": "updated"
            },
            {
              "type": "string",
              "const": "cleared"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "SessionsCompactionListParams": {
      "type": "object",
      "required": [
        "key"
      ],
      "properties": {
        "key": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "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
              },
              "tokensVersion": {
                "type": "number",
                "const": 1
              },
              "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
            },
            "tokensVersion": {
              "type": "number",
              "const": 1
            },
            "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
            },
            "tokensVersion": {
              "type": "number",
              "const": 1
            },
            "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}$"
        },
        "mimeType": {
          "type": "string",
          "minLength": 1
        },
        "contentEncoding": {
          "anyOf": [
            {
              "type": "string",
              "const": "utf8"
            },
            {
              "type": "string",
              "const": "base64"
            }
          ]
        },
        "previewKind": {
          "anyOf": [
            {
              "type": "string",
              "const": "text"
            },
            {
              "type": "string",
              "const": "image"
            },
            {
              "type": "string",
              "const": "unsupported"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "SessionFilePreviewKind": {
      "anyOf": [
        {
          "type": "string",
          "const": "text"
        },
        {
          "type": "string",
          "const": "image"
        },
        {
          "type": "string",
          "const": "unsupported"
        }
      ]
    },
    "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}$"
              },
              "mimeType": {
                "type": "string",
                "minLength": 1
              },
              "contentEncoding": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "utf8"
                  },
                  {
                    "type": "string",
                    "const": "base64"
                  }
                ]
              },
              "previewKind": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "text"
                  },
                  {
                    "type": "string",
                    "const": "image"
                  },
                  {
                    "type": "string",
                    "const": "unsupported"
                  }
                ]
              }
            },
            "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}$"
            },
            "mimeType": {
              "type": "string",
              "minLength": 1
            },
            "contentEncoding": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "utf8"
                },
                {
                  "type": "string",
                  "const": "base64"
                }
              ]
            },
            "previewKind": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "text"
                },
                {
                  "type": "string",
                  "const": "image"
                },
                {
                  "type": "string",
                  "const": "unsupported"
                }
              ]
            }
          },
          "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}$"
            },
            "mimeType": {
              "type": "string",
              "minLength": 1
            },
            "contentEncoding": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "utf8"
                },
                {
                  "type": "string",
                  "const": "base64"
                }
              ]
            },
            "previewKind": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "text"
                },
                {
                  "type": "string",
                  "const": "image"
                },
                {
                  "type": "string",
                  "const": "unsupported"
                }
              ]
            }
          },
          "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
    },
    "SessionDiffCommit": {
      "type": "object",
      "required": [
        "sha",
        "subject"
      ],
      "properties": {
        "sha": {
          "type": "string",
          "minLength": 1
        },
        "subject": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "SessionDiffScope": {
      "anyOf": [
        {
          "type": "string",
          "const": "all"
        },
        {
          "type": "string",
          "const": "uncommitted"
        },
        {
          "type": "string",
          "const": "commit"
        }
      ]
    },
    "SessionsDiffParams": {
      "type": "object",
      "required": [
        "sessionKey"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "scope": {
          "anyOf": [
            {
              "type": "string",
              "const": "all"
            },
            {
              "type": "string",
              "const": "uncommitted"
            },
            {
              "type": "string",
              "const": "commit"
            }
          ]
        },
        "commit": {
          "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
        },
        "aheadCount": {
          "type": "integer",
          "minimum": 0
        },
        "commits": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "sha",
              "subject"
            ],
            "properties": {
              "sha": {
                "type": "string",
                "minLength": 1
              },
              "subject": {
                "type": "string"
              }
            },
            "additionalProperties": false
          },
          "maxItems": 50
        },
        "mergeBase": {
          "type": "object",
          "required": [
            "sha",
            "subject"
          ],
          "properties": {
            "sha": {
              "type": "string",
              "minLength": 1
            },
            "subject": {
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "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"
            },
            {
              "type": "string",
              "const": "unknown_commit"
            }
          ]
        }
      },
      "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
        },
        "idempotencyKey": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "label": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "category": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "model": {
          "type": "string",
          "minLength": 1
        },
        "contextWindow": {
          "type": "string",
          "minLength": 1
        },
        "thinkingLevel": {
          "type": "string",
          "minLength": 1
        },
        "fastMode": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "string",
              "const": "auto"
            }
          ]
        },
        "permissionMode": {
          "anyOf": [
            {
              "type": "string",
              "const": "read-only"
            },
            {
              "type": "string",
              "const": "guarded"
            },
            {
              "type": "string",
              "const": "workspace"
            },
            {
              "type": "string",
              "const": "full"
            }
          ]
        },
        "toolOverrides": {
          "type": "object",
          "properties": {
            "mcpServers": {
              "type": "object",
              "patternProperties": {
                "^.*$": {
                  "type": "boolean"
                }
              }
            },
            "mcpToolsDeny": {
              "type": "object",
              "patternProperties": {
                "^.*$": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  }
                }
              }
            },
            "skills": {
              "type": "object",
              "patternProperties": {
                "^.*$": {
                  "type": "boolean"
                }
              }
            },
            "webSearch": {
              "type": "boolean"
            }
          },
          "additionalProperties": false
        },
        "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."
        },
        "forkFrom": {
          "type": "string",
          "const": "last-completed",
          "description": "Fork through the parent's last completed assistant message; requires fork=true."
        },
        "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": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string"
              },
              "mimeType": {
                "type": "string"
              },
              "fileName": {
                "type": "string"
              },
              "content": {},
              "sizeBytes": {
                "type": "number"
              },
              "durationMs": {
                "type": "number"
              },
              "width": {
                "type": "number"
              },
              "height": {
                "type": "number"
              }
            },
            "additionalProperties": true
          }
        },
        "projectId": {
          "type": "string",
          "minLength": 1,
          "description": "Start in a registered project; operator.write."
        },
        "projectGitUrl": {
          "type": "string",
          "minLength": 1,
          "maxLength": 2048,
          "description": "Prepare a remote project before the initial agent turn; operator.write."
        },
        "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. Gateway paths outside configured agent workspaces and all execNode paths require 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
    },
    "SessionsRecoverParams": {
      "type": "object",
      "required": [
        "key"
      ],
      "properties": {
        "key": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "SessionsRecoverResult": {
      "type": "object",
      "required": [
        "ok",
        "key",
        "sessionId",
        "continuation"
      ],
      "properties": {
        "ok": {
          "type": "boolean",
          "const": true
        },
        "key": {
          "type": "string",
          "minLength": 1
        },
        "sessionId": {
          "type": "string",
          "minLength": 1
        },
        "continuation": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "status",
                "runId"
              ],
              "properties": {
                "status": {
                  "type": "string",
                  "const": "started"
                },
                "runId": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "status",
                "error"
              ],
              "properties": {
                "status": {
                  "type": "string",
                  "const": "rejected"
                },
                "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
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "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": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string"
              },
              "mimeType": {
                "type": "string"
              },
              "fileName": {
                "type": "string"
              },
              "content": {},
              "sizeBytes": {
                "type": "number"
              },
              "durationMs": {
                "type": "number"
              },
              "width": {
                "type": "number"
              },
              "height": {
                "type": "number"
              }
            },
            "additionalProperties": true
          }
        },
        "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
    },
    "SessionsViewerPresenceSetParams": {
      "type": "object",
      "required": [
        "sessionKeys"
      ],
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "sessionKeys": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512
          },
          "maxItems": 32
        }
      },
      "additionalProperties": false
    },
    "SessionsViewerPresenceSetResult": {
      "type": "object",
      "required": [
        "sessionKeys"
      ],
      "properties": {
        "sessionKeys": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512
          },
          "maxItems": 32
        }
      },
      "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
        },
        "expectedMarkedUnreadAt": {
          "anyOf": [
            {
              "type": "number",
              "minimum": 0
            },
            {
              "type": "null"
            }
          ],
          "description": "Apply an automatic unread=false acknowledgement only if the explicit unread marker still matches; null asserts no marker."
        },
        "label": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            },
            {
              "type": "null"
            }
          ]
        },
        "icon": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "color": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "category": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            },
            {
              "type": "null"
            }
          ]
        },
        "boardFace": {
          "anyOf": [
            {
              "type": "string",
              "const": "chat"
            },
            {
              "type": "string",
              "const": "dashboard"
            }
          ]
        },
        "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."
        },
        "contextWindow": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "thinkingLevel": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "fastMode": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "string",
              "const": "auto"
            },
            {
              "type": "null"
            }
          ]
        },
        "toolOverrides": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "mcpServers": {
                  "type": "object",
                  "patternProperties": {
                    "^.*$": {
                      "type": "boolean"
                    }
                  }
                },
                "mcpToolsDeny": {
                  "type": "object",
                  "patternProperties": {
                    "^.*$": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1
                      }
                    }
                  }
                },
                "skills": {
                  "type": "object",
                  "patternProperties": {
                    "^.*$": {
                      "type": "boolean"
                    }
                  }
                },
                "webSearch": {
                  "type": "boolean"
                }
              },
              "additionalProperties": false
            },
            {
              "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"
            }
          ]
        },
        "permissionMode": {
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "string",
                  "const": "read-only"
                },
                {
                  "type": "string",
                  "const": "guarded"
                },
                {
                  "type": "string",
                  "const": "workspace"
                },
                {
                  "type": "string",
                  "const": "full"
                }
              ]
            },
            {
              "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
    },
    "SessionsPatchMutation": {
      "type": "object",
      "properties": {
        "label": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            },
            {
              "type": "null"
            }
          ]
        },
        "icon": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "color": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "category": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            },
            {
              "type": "null"
            }
          ]
        },
        "boardFace": {
          "anyOf": [
            {
              "type": "string",
              "const": "chat"
            },
            {
              "type": "string",
              "const": "dashboard"
            }
          ]
        },
        "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."
        },
        "contextWindow": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "thinkingLevel": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "fastMode": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "string",
              "const": "auto"
            },
            {
              "type": "null"
            }
          ]
        },
        "toolOverrides": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "mcpServers": {
                  "type": "object",
                  "patternProperties": {
                    "^.*$": {
                      "type": "boolean"
                    }
                  }
                },
                "mcpToolsDeny": {
                  "type": "object",
                  "patternProperties": {
                    "^.*$": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1
                      }
                    }
                  }
                },
                "skills": {
                  "type": "object",
                  "patternProperties": {
                    "^.*$": {
                      "type": "boolean"
                    }
                  }
                },
                "webSearch": {
                  "type": "boolean"
                }
              },
              "additionalProperties": false
            },
            {
              "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"
            }
          ]
        },
        "permissionMode": {
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "string",
                  "const": "read-only"
                },
                {
                  "type": "string",
                  "const": "guarded"
                },
                {
                  "type": "string",
                  "const": "workspace"
                },
                {
                  "type": "string",
                  "const": "full"
                }
              ]
            },
            {
              "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,
      "minProperties": 1
    },
    "SessionsPatchManyTarget": {
      "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
        }
      },
      "additionalProperties": false
    },
    "SessionsPatchManyParams": {
      "type": "object",
      "required": [
        "targets",
        "patch"
      ],
      "properties": {
        "targets": {
          "type": "array",
          "items": {
            "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
              }
            },
            "additionalProperties": false
          },
          "minItems": 1,
          "maxItems": 100
        },
        "patch": {
          "type": "object",
          "properties": {
            "label": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 512
                },
                {
                  "type": "null"
                }
              ]
            },
            "icon": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "color": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "category": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 512
                },
                {
                  "type": "null"
                }
              ]
            },
            "boardFace": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "chat"
                },
                {
                  "type": "string",
                  "const": "dashboard"
                }
              ]
            },
            "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."
            },
            "contextWindow": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1
                },
                {
                  "type": "null"
                }
              ]
            },
            "thinkingLevel": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1
                },
                {
                  "type": "null"
                }
              ]
            },
            "fastMode": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "string",
                  "const": "auto"
                },
                {
                  "type": "null"
                }
              ]
            },
            "toolOverrides": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "mcpServers": {
                      "type": "object",
                      "patternProperties": {
                        "^.*$": {
                          "type": "boolean"
                        }
                      }
                    },
                    "mcpToolsDeny": {
                      "type": "object",
                      "patternProperties": {
                        "^.*$": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "minLength": 1
                          }
                        }
                      }
                    },
                    "skills": {
                      "type": "object",
                      "patternProperties": {
                        "^.*$": {
                          "type": "boolean"
                        }
                      }
                    },
                    "webSearch": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "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"
                }
              ]
            },
            "permissionMode": {
              "anyOf": [
                {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "read-only"
                    },
                    {
                      "type": "string",
                      "const": "guarded"
                    },
                    {
                      "type": "string",
                      "const": "workspace"
                    },
                    {
                      "type": "string",
                      "const": "full"
                    }
                  ]
                },
                {
                  "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,
          "minProperties": 1
        }
      },
      "additionalProperties": false
    },
    "SessionsPatchManyResult": {
      "type": "object",
      "required": [
        "outcomes"
      ],
      "properties": {
        "outcomes": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "object",
                "required": [
                  "ok",
                  "key"
                ],
                "properties": {
                  "ok": {
                    "type": "boolean",
                    "const": true
                  },
                  "key": {
                    "type": "string",
                    "minLength": 1
                  },
                  "agentId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "object",
                "required": [
                  "ok",
                  "key",
                  "error"
                ],
                "properties": {
                  "ok": {
                    "type": "boolean",
                    "const": false
                  },
                  "key": {
                    "type": "string",
                    "minLength": 1
                  },
                  "agentId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "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
              }
            ]
          }
        }
      },
      "additionalProperties": false
    },
    "SessionsPluginPatchParams": {
      "type": "object",
      "required": [
        "key",
        "pluginId",
        "namespace"
      ],
      "properties": {
        "key": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "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
    },
    "WorktreePreservationReason": {
      "enum": [
        "owner-mismatch",
        "busy",
        "foreign-lock",
        "snapshot-failed",
        "cleanup-failed"
      ],
      "type": "string"
    },
    "PreservedSessionWorktree": {
      "type": "object",
      "required": [
        "id",
        "branch",
        "path",
        "reason"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "branch": {
          "type": "string",
          "minLength": 1
        },
        "path": {
          "type": "string",
          "minLength": 1
        },
        "reason": {
          "enum": [
            "owner-mismatch",
            "busy",
            "foreign-lock",
            "snapshot-failed",
            "cleanup-failed"
          ],
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "SessionsDeleteResult": {
      "type": "object",
      "required": [
        "ok",
        "key",
        "deleted",
        "archived"
      ],
      "properties": {
        "ok": {
          "type": "boolean",
          "const": true
        },
        "key": {
          "type": "string",
          "minLength": 1
        },
        "deleted": {
          "type": "boolean"
        },
        "archived": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "worktreePreserved": {
          "type": "object",
          "required": [
            "id",
            "branch",
            "path",
            "reason"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            },
            "branch": {
              "type": "string",
              "minLength": 1
            },
            "path": {
              "type": "string",
              "minLength": 1
            },
            "reason": {
              "enum": [
                "owner-mismatch",
                "busy",
                "foreign-lock",
                "snapshot-failed",
                "cleanup-failed"
              ],
              "type": "string"
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "SessionsAssignOwnerParams": {
      "type": "object",
      "required": [
        "key",
        "owner"
      ],
      "properties": {
        "key": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "owner": {
          "type": "object",
          "required": [
            "type",
            "id"
          ],
          "properties": {
            "type": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "agent"
                },
                {
                  "type": "string",
                  "const": "human"
                }
              ]
            },
            "id": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "SessionsAssignOwnerResult": {
      "type": "object",
      "required": [
        "ok",
        "key",
        "owner"
      ],
      "properties": {
        "ok": {
          "type": "boolean",
          "const": true
        },
        "key": {
          "type": "string",
          "minLength": 1
        },
        "owner": {
          "type": "object",
          "required": [
            "actor"
          ],
          "properties": {
            "actor": {
              "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
                },
                "avatarUrl": {
                  "type": "string",
                  "minLength": 1
                },
                "identity": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "type",
                        "id"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "profile"
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "type",
                        "id"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "agent"
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "type",
                        "pluginId",
                        "domain",
                        "idKind",
                        "id"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "remote"
                        },
                        "pluginId": {
                          "type": "string",
                          "minLength": 1
                        },
                        "domain": {
                          "type": "string",
                          "minLength": 1
                        },
                        "idKind": {
                          "type": "string",
                          "minLength": 1
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "type",
                        "pluginId",
                        "accountId",
                        "senderKind",
                        "id"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "observation"
                        },
                        "pluginId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "accountId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "senderKind": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "human"
                            },
                            {
                              "type": "string",
                              "const": "bot"
                            },
                            {
                              "type": "string",
                              "const": "unknown"
                            }
                          ]
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "type",
                        "actorType",
                        "source",
                        "id"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "legacy"
                        },
                        "actorType": {
                          "type": "string"
                        },
                        "source": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "id": {
                          "type": "string"
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                }
              },
              "additionalProperties": false
            },
            "assignedBy": {
              "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
                },
                "avatarUrl": {
                  "type": "string",
                  "minLength": 1
                },
                "identity": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "type",
                        "id"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "profile"
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "type",
                        "id"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "agent"
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "type",
                        "pluginId",
                        "domain",
                        "idKind",
                        "id"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "remote"
                        },
                        "pluginId": {
                          "type": "string",
                          "minLength": 1
                        },
                        "domain": {
                          "type": "string",
                          "minLength": 1
                        },
                        "idKind": {
                          "type": "string",
                          "minLength": 1
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "type",
                        "pluginId",
                        "accountId",
                        "senderKind",
                        "id"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "observation"
                        },
                        "pluginId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "accountId": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 1
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "senderKind": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "human"
                            },
                            {
                              "type": "string",
                              "const": "bot"
                            },
                            {
                              "type": "string",
                              "const": "unknown"
                            }
                          ]
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "type",
                        "actorType",
                        "source",
                        "id"
                      ],
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "legacy"
                        },
                        "actorType": {
                          "type": "string"
                        },
                        "source": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "id": {
                          "type": "string"
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                }
              },
              "additionalProperties": false
            },
            "assignedAt": {
              "type": "number",
              "minimum": 0
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "SessionGroup": {
      "type": "object",
      "required": [
        "name",
        "position"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "position": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "SessionGroupDefaults": {
      "type": "object",
      "required": [
        "name"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "cwd": {
          "type": "string",
          "minLength": 1
        },
        "worktree": {
          "type": "boolean"
        }
      },
      "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
          }
        }
      },
      "additionalProperties": false
    },
    "SessionsGroupsDefaultsParams": {
      "type": "object",
      "properties": {},
      "additionalProperties": false
    },
    "SessionsGroupsDefaultsResult": {
      "type": "object",
      "required": [
        "defaults"
      ],
      "properties": {
        "defaults": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "name"
            ],
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512
              },
              "cwd": {
                "type": "string",
                "minLength": 1
              },
              "worktree": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "SessionsGroupsPutParams": {
      "type": "object",
      "required": [
        "names"
      ],
      "properties": {
        "names": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512
          }
        },
        "sectionOrder": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512
          }
        }
      },
      "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
    },
    "SessionsGroupsUpdateParams": {
      "type": "object",
      "required": [
        "name",
        "cwd",
        "worktree"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "cwd": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "worktree": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "SessionsGroupsUpdateResult": {
      "type": "object",
      "required": [
        "ok",
        "defaults"
      ],
      "properties": {
        "ok": {
          "type": "boolean",
          "const": true
        },
        "defaults": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "name"
            ],
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512
              },
              "cwd": {
                "type": "string",
                "minLength": 1
              },
              "worktree": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "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
          }
        },
        "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": "active_run_injected"
            },
            {
              "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"
                        },
                        {
                          "type": "string",
                          "const": "active_run_injected"
                        }
                      ]
                    }
                  }
                },
                {
                  "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": "active_run_injected"
                },
                {
                  "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"
                            },
                            {
                              "type": "string",
                              "const": "active_run_injected"
                            }
                          ]
                        }
                      }
                    },
                    {
                      "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": "active_run_injected"
                      },
                      {
                        "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"
                                  },
                                  {
                                    "type": "string",
                                    "const": "active_run_injected"
                                  }
                                ]
                              }
                            }
                          },
                          {
                            "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
    },
    "ExecutionIdentityContextV1": {
      "type": "object",
      "required": [
        "schemaVersion",
        "contextId",
        "executionId",
        "runId",
        "createdAt",
        "trustDomain",
        "invoker",
        "ingress",
        "agentPrincipal",
        "agentDefinition",
        "runtimeInstance",
        "applicableGrants",
        "assurance",
        "coverageState",
        "missingEvidence"
      ],
      "properties": {
        "schemaVersion": {
          "type": "number",
          "const": 1
        },
        "contextId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "executionId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "runId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "createdAt": {
          "type": "integer",
          "minimum": 0
        },
        "trustDomain": {
          "type": "object",
          "required": [
            "kind",
            "domainRef",
            "state"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "gateway-cell"
            },
            "domainRef": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "state": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "present"
                },
                {
                  "type": "string",
                  "const": "absent"
                },
                {
                  "type": "string",
                  "const": "unknown"
                },
                {
                  "type": "string",
                  "const": "unsupported"
                }
              ]
            }
          },
          "additionalProperties": false
        },
        "invoker": {
          "type": "object",
          "required": [
            "state"
          ],
          "properties": {
            "principal": {
              "type": "object",
              "required": [
                "kind",
                "domainRef",
                "principalRef"
              ],
              "properties": {
                "kind": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "person"
                    },
                    {
                      "type": "string",
                      "const": "agent"
                    },
                    {
                      "type": "string",
                      "const": "service"
                    },
                    {
                      "type": "string",
                      "const": "schedule"
                    },
                    {
                      "type": "string",
                      "const": "webhook"
                    },
                    {
                      "type": "string",
                      "const": "system"
                    },
                    {
                      "type": "string",
                      "const": "local-account"
                    },
                    {
                      "type": "string",
                      "const": "runtime"
                    }
                  ]
                },
                "domainRef": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "principalRef": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "displayLabel": {
                  "type": "string",
                  "maxLength": 128
                }
              },
              "additionalProperties": false
            },
            "state": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "present"
                },
                {
                  "type": "string",
                  "const": "absent"
                },
                {
                  "type": "string",
                  "const": "unknown"
                },
                {
                  "type": "string",
                  "const": "unsupported"
                }
              ]
            }
          },
          "additionalProperties": false
        },
        "ingress": {
          "type": "object",
          "required": [
            "kind",
            "boundary",
            "state"
          ],
          "properties": {
            "kind": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "local-cli"
                },
                {
                  "type": "string",
                  "const": "gateway-client"
                },
                {
                  "type": "string",
                  "const": "channel"
                },
                {
                  "type": "string",
                  "const": "api"
                },
                {
                  "type": "string",
                  "const": "schedule"
                },
                {
                  "type": "string",
                  "const": "webhook"
                },
                {
                  "type": "string",
                  "const": "task"
                },
                {
                  "type": "string",
                  "const": "subagent"
                },
                {
                  "type": "string",
                  "const": "acp"
                },
                {
                  "type": "string",
                  "const": "worker"
                },
                {
                  "type": "string",
                  "const": "plugin"
                },
                {
                  "type": "string",
                  "const": "recovery"
                },
                {
                  "type": "string",
                  "const": "system"
                }
              ]
            },
            "sourceRef": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "boundary": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "state": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "present"
                },
                {
                  "type": "string",
                  "const": "absent"
                },
                {
                  "type": "string",
                  "const": "unknown"
                },
                {
                  "type": "string",
                  "const": "unsupported"
                }
              ]
            }
          },
          "additionalProperties": false
        },
        "agentPrincipal": {
          "type": "object",
          "required": [
            "kind",
            "domainRef",
            "principalRef"
          ],
          "properties": {
            "kind": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "person"
                },
                {
                  "type": "string",
                  "const": "agent"
                },
                {
                  "type": "string",
                  "const": "service"
                },
                {
                  "type": "string",
                  "const": "schedule"
                },
                {
                  "type": "string",
                  "const": "webhook"
                },
                {
                  "type": "string",
                  "const": "system"
                },
                {
                  "type": "string",
                  "const": "local-account"
                },
                {
                  "type": "string",
                  "const": "runtime"
                }
              ]
            },
            "domainRef": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "principalRef": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "displayLabel": {
              "type": "string",
              "maxLength": 128
            }
          },
          "additionalProperties": false
        },
        "agentDefinition": {
          "type": "object",
          "required": [
            "definitionRef",
            "state"
          ],
          "properties": {
            "definitionRef": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "revisionRef": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "state": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "present"
                },
                {
                  "type": "string",
                  "const": "absent"
                },
                {
                  "type": "string",
                  "const": "unknown"
                },
                {
                  "type": "string",
                  "const": "unsupported"
                }
              ]
            }
          },
          "additionalProperties": false
        },
        "runtimeInstance": {
          "type": "object",
          "required": [
            "runtimeRef",
            "kind",
            "state"
          ],
          "properties": {
            "runtimeRef": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "kind": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "gateway"
                },
                {
                  "type": "string",
                  "const": "embedded"
                },
                {
                  "type": "string",
                  "const": "worker"
                },
                {
                  "type": "string",
                  "const": "plugin-harness"
                },
                {
                  "type": "string",
                  "const": "acp"
                }
              ]
            },
            "state": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "present"
                },
                {
                  "type": "string",
                  "const": "absent"
                },
                {
                  "type": "string",
                  "const": "unknown"
                },
                {
                  "type": "string",
                  "const": "unsupported"
                }
              ]
            }
          },
          "additionalProperties": false
        },
        "representedSubject": {
          "type": "object",
          "required": [
            "principal",
            "state"
          ],
          "properties": {
            "principal": {
              "type": "object",
              "required": [
                "kind",
                "domainRef",
                "principalRef"
              ],
              "properties": {
                "kind": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "person"
                    },
                    {
                      "type": "string",
                      "const": "agent"
                    },
                    {
                      "type": "string",
                      "const": "service"
                    },
                    {
                      "type": "string",
                      "const": "schedule"
                    },
                    {
                      "type": "string",
                      "const": "webhook"
                    },
                    {
                      "type": "string",
                      "const": "system"
                    },
                    {
                      "type": "string",
                      "const": "local-account"
                    },
                    {
                      "type": "string",
                      "const": "runtime"
                    }
                  ]
                },
                "domainRef": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "principalRef": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "displayLabel": {
                  "type": "string",
                  "maxLength": 128
                }
              },
              "additionalProperties": false
            },
            "state": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "present"
                },
                {
                  "type": "string",
                  "const": "absent"
                },
                {
                  "type": "string",
                  "const": "unknown"
                },
                {
                  "type": "string",
                  "const": "unsupported"
                }
              ]
            }
          },
          "additionalProperties": false
        },
        "sponsor": {
          "type": "object",
          "required": [
            "principal",
            "state"
          ],
          "properties": {
            "principal": {
              "type": "object",
              "required": [
                "kind",
                "domainRef",
                "principalRef"
              ],
              "properties": {
                "kind": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "person"
                    },
                    {
                      "type": "string",
                      "const": "agent"
                    },
                    {
                      "type": "string",
                      "const": "service"
                    },
                    {
                      "type": "string",
                      "const": "schedule"
                    },
                    {
                      "type": "string",
                      "const": "webhook"
                    },
                    {
                      "type": "string",
                      "const": "system"
                    },
                    {
                      "type": "string",
                      "const": "local-account"
                    },
                    {
                      "type": "string",
                      "const": "runtime"
                    }
                  ]
                },
                "domainRef": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "principalRef": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "displayLabel": {
                  "type": "string",
                  "maxLength": 128
                }
              },
              "additionalProperties": false
            },
            "relationshipRef": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "state": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "present"
                },
                {
                  "type": "string",
                  "const": "absent"
                },
                {
                  "type": "string",
                  "const": "unknown"
                },
                {
                  "type": "string",
                  "const": "unsupported"
                }
              ]
            }
          },
          "additionalProperties": false
        },
        "applicableGrants": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "grantRef",
              "state"
            ],
            "properties": {
              "grantRef": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "state": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "present"
                  },
                  {
                    "type": "string",
                    "const": "absent"
                  },
                  {
                    "type": "string",
                    "const": "unknown"
                  },
                  {
                    "type": "string",
                    "const": "unsupported"
                  }
                ]
              }
            },
            "additionalProperties": false
          },
          "maxItems": 16
        },
        "assurance": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "kind",
              "evidenceRef",
              "strength"
            ],
            "properties": {
              "kind": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "durable-profile"
                  },
                  {
                    "type": "string",
                    "const": "trusted-proxy"
                  },
                  {
                    "type": "string",
                    "const": "tailscale-whois"
                  },
                  {
                    "type": "string",
                    "const": "device-proof"
                  },
                  {
                    "type": "string",
                    "const": "channel-admission"
                  },
                  {
                    "type": "string",
                    "const": "local-process"
                  },
                  {
                    "type": "string",
                    "const": "spawn-lineage"
                  },
                  {
                    "type": "string",
                    "const": "worker-admission"
                  },
                  {
                    "type": "string",
                    "const": "runtime-binding"
                  },
                  {
                    "type": "string",
                    "const": "other"
                  }
                ]
              },
              "evidenceRef": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "strength": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "self-asserted"
                  },
                  {
                    "type": "string",
                    "const": "boundary-verified"
                  },
                  {
                    "type": "string",
                    "const": "cryptographic"
                  }
                ]
              }
            },
            "additionalProperties": false
          },
          "maxItems": 16
        },
        "lineage": {
          "type": "object",
          "required": [
            "depth"
          ],
          "properties": {
            "parentContextId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "parentExecutionId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "parentRunId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "parentAgentPrincipal": {
              "type": "object",
              "required": [
                "kind",
                "domainRef",
                "principalRef"
              ],
              "properties": {
                "kind": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "person"
                    },
                    {
                      "type": "string",
                      "const": "agent"
                    },
                    {
                      "type": "string",
                      "const": "service"
                    },
                    {
                      "type": "string",
                      "const": "schedule"
                    },
                    {
                      "type": "string",
                      "const": "webhook"
                    },
                    {
                      "type": "string",
                      "const": "system"
                    },
                    {
                      "type": "string",
                      "const": "local-account"
                    },
                    {
                      "type": "string",
                      "const": "runtime"
                    }
                  ]
                },
                "domainRef": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "principalRef": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "displayLabel": {
                  "type": "string",
                  "maxLength": 128
                }
              },
              "additionalProperties": false
            },
            "delegationRef": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "depth": {
              "type": "integer",
              "minimum": 0,
              "maximum": 64
            }
          },
          "additionalProperties": false
        },
        "coverageState": {
          "anyOf": [
            {
              "type": "string",
              "const": "attribution-only"
            },
            {
              "type": "string",
              "const": "unattributed"
            },
            {
              "type": "string",
              "const": "unknown"
            },
            {
              "type": "string",
              "const": "unsupported"
            }
          ]
        },
        "missingEvidence": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "maxItems": 16
        }
      },
      "additionalProperties": false
    },
    "DecisionReceiptV1": {
      "type": "object",
      "required": [
        "schemaVersion",
        "receiptId",
        "contextId",
        "executionId",
        "runId",
        "occurredAt",
        "action",
        "decision",
        "enforcement",
        "source",
        "missingEvidence",
        "remediation"
      ],
      "properties": {
        "schemaVersion": {
          "type": "number",
          "const": 1
        },
        "receiptId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "contextId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "executionId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "runId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "actionId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "occurredAt": {
          "type": "integer",
          "minimum": 0
        },
        "action": {
          "type": "object",
          "required": [
            "family",
            "operation"
          ],
          "properties": {
            "family": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "operation": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "resourceRef": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "targetRef": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "summary": {
              "type": "string",
              "maxLength": 512
            }
          },
          "additionalProperties": false
        },
        "decision": {
          "type": "object",
          "required": [
            "outcome",
            "reasonCode"
          ],
          "properties": {
            "outcome": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "allowed"
                },
                {
                  "type": "string",
                  "const": "denied"
                },
                {
                  "type": "string",
                  "const": "not-applicable"
                },
                {
                  "type": "string",
                  "const": "unknown"
                }
              ]
            },
            "reasonCode": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          "additionalProperties": false
        },
        "enforcement": {
          "type": "object",
          "required": [
            "coverageState",
            "policyRefs",
            "grantRefs",
            "contextFieldsUsed"
          ],
          "properties": {
            "coverageState": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "enforced"
                },
                {
                  "type": "string",
                  "const": "attribution-only"
                },
                {
                  "type": "string",
                  "const": "unattributed"
                },
                {
                  "type": "string",
                  "const": "unknown"
                },
                {
                  "type": "string",
                  "const": "unsupported"
                }
              ]
            },
            "evaluatorRef": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "policyRefs": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "maxItems": 16
            },
            "grantRefs": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "maxItems": 16
            },
            "contextFieldsUsed": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "maxItems": 16
            }
          },
          "additionalProperties": false
        },
        "source": {
          "type": "object",
          "required": [
            "owner",
            "recordRef",
            "decisionBoundary"
          ],
          "properties": {
            "owner": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "recordRef": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "decisionBoundary": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          "additionalProperties": false
        },
        "missingEvidence": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "maxItems": 16
        },
        "remediation": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "code",
              "text"
            ],
            "properties": {
              "code": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "text": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512
              }
            },
            "additionalProperties": false
          },
          "maxItems": 8
        }
      },
      "additionalProperties": false
    },
    "DecisionReceiptDisplayV1": {
      "type": "object",
      "required": [
        "schemaVersion",
        "selectorId",
        "occurredAt",
        "action",
        "decision",
        "enforcement",
        "provenance",
        "missingEvidence",
        "remediation"
      ],
      "properties": {
        "schemaVersion": {
          "type": "number",
          "const": 1
        },
        "selectorId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "occurredAt": {
          "type": "integer",
          "minimum": 0
        },
        "action": {
          "type": "object",
          "required": [
            "family",
            "operation"
          ],
          "properties": {
            "family": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "operation": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "summary": {
              "type": "string",
              "maxLength": 512
            }
          },
          "additionalProperties": false
        },
        "decision": {
          "type": "object",
          "required": [
            "outcome",
            "reasonCode"
          ],
          "properties": {
            "outcome": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "allowed"
                },
                {
                  "type": "string",
                  "const": "denied"
                },
                {
                  "type": "string",
                  "const": "not-applicable"
                },
                {
                  "type": "string",
                  "const": "unknown"
                }
              ]
            },
            "reasonCode": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          },
          "additionalProperties": false
        },
        "enforcement": {
          "type": "object",
          "required": [
            "coverageState",
            "policyCount",
            "grantCount",
            "contextFieldsUsed"
          ],
          "properties": {
            "coverageState": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "enforced"
                },
                {
                  "type": "string",
                  "const": "attribution-only"
                },
                {
                  "type": "string",
                  "const": "unattributed"
                },
                {
                  "type": "string",
                  "const": "unknown"
                },
                {
                  "type": "string",
                  "const": "unsupported"
                }
              ]
            },
            "policyCount": {
              "type": "integer",
              "minimum": 0,
              "maximum": 16
            },
            "grantCount": {
              "type": "integer",
              "minimum": 0,
              "maximum": 16
            },
            "contextFieldsUsed": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "maxItems": 16
            }
          },
          "additionalProperties": false
        },
        "provenance": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "state",
                "producer"
              ],
              "properties": {
                "state": {
                  "type": "string",
                  "const": "verified"
                },
                "producer": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "run-admission"
                    },
                    {
                      "type": "string",
                      "const": "operator-approval"
                    },
                    {
                      "type": "string",
                      "const": "message-delivery"
                    },
                    {
                      "type": "string",
                      "const": "cron-lifecycle"
                    },
                    {
                      "type": "string",
                      "const": "task-lifecycle"
                    },
                    {
                      "type": "string",
                      "const": "flow-lifecycle"
                    }
                  ]
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "state"
              ],
              "properties": {
                "state": {
                  "type": "string",
                  "const": "unverified"
                }
              },
              "additionalProperties": false
            }
          ]
        },
        "missingEvidence": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "maxItems": 16
        },
        "remediation": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "code",
              "text"
            ],
            "properties": {
              "code": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "text": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512
              }
            },
            "additionalProperties": false
          },
          "maxItems": 8
        }
      },
      "additionalProperties": false
    },
    "AuditRunIdentityPresentV1": {
      "type": "object",
      "required": [
        "state",
        "context"
      ],
      "properties": {
        "state": {
          "type": "string",
          "const": "present"
        },
        "context": {
          "type": "object",
          "required": [
            "schemaVersion",
            "contextId",
            "executionId",
            "runId",
            "createdAt",
            "trustDomain",
            "invoker",
            "ingress",
            "agentPrincipal",
            "agentDefinition",
            "runtimeInstance",
            "applicableGrants",
            "assurance",
            "coverageState",
            "missingEvidence"
          ],
          "properties": {
            "schemaVersion": {
              "type": "number",
              "const": 1
            },
            "contextId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "executionId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "runId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "createdAt": {
              "type": "integer",
              "minimum": 0
            },
            "trustDomain": {
              "type": "object",
              "required": [
                "kind",
                "domainRef",
                "state"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "gateway-cell"
                },
                "domainRef": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "state": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "present"
                    },
                    {
                      "type": "string",
                      "const": "absent"
                    },
                    {
                      "type": "string",
                      "const": "unknown"
                    },
                    {
                      "type": "string",
                      "const": "unsupported"
                    }
                  ]
                }
              },
              "additionalProperties": false
            },
            "invoker": {
              "type": "object",
              "required": [
                "state"
              ],
              "properties": {
                "principal": {
                  "type": "object",
                  "required": [
                    "kind",
                    "domainRef",
                    "principalRef"
                  ],
                  "properties": {
                    "kind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "person"
                        },
                        {
                          "type": "string",
                          "const": "agent"
                        },
                        {
                          "type": "string",
                          "const": "service"
                        },
                        {
                          "type": "string",
                          "const": "schedule"
                        },
                        {
                          "type": "string",
                          "const": "webhook"
                        },
                        {
                          "type": "string",
                          "const": "system"
                        },
                        {
                          "type": "string",
                          "const": "local-account"
                        },
                        {
                          "type": "string",
                          "const": "runtime"
                        }
                      ]
                    },
                    "domainRef": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "principalRef": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "displayLabel": {
                      "type": "string",
                      "maxLength": 128
                    }
                  },
                  "additionalProperties": false
                },
                "state": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "present"
                    },
                    {
                      "type": "string",
                      "const": "absent"
                    },
                    {
                      "type": "string",
                      "const": "unknown"
                    },
                    {
                      "type": "string",
                      "const": "unsupported"
                    }
                  ]
                }
              },
              "additionalProperties": false
            },
            "ingress": {
              "type": "object",
              "required": [
                "kind",
                "boundary",
                "state"
              ],
              "properties": {
                "kind": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "local-cli"
                    },
                    {
                      "type": "string",
                      "const": "gateway-client"
                    },
                    {
                      "type": "string",
                      "const": "channel"
                    },
                    {
                      "type": "string",
                      "const": "api"
                    },
                    {
                      "type": "string",
                      "const": "schedule"
                    },
                    {
                      "type": "string",
                      "const": "webhook"
                    },
                    {
                      "type": "string",
                      "const": "task"
                    },
                    {
                      "type": "string",
                      "const": "subagent"
                    },
                    {
                      "type": "string",
                      "const": "acp"
                    },
                    {
                      "type": "string",
                      "const": "worker"
                    },
                    {
                      "type": "string",
                      "const": "plugin"
                    },
                    {
                      "type": "string",
                      "const": "recovery"
                    },
                    {
                      "type": "string",
                      "const": "system"
                    }
                  ]
                },
                "sourceRef": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "boundary": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "state": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "present"
                    },
                    {
                      "type": "string",
                      "const": "absent"
                    },
                    {
                      "type": "string",
                      "const": "unknown"
                    },
                    {
                      "type": "string",
                      "const": "unsupported"
                    }
                  ]
                }
              },
              "additionalProperties": false
            },
            "agentPrincipal": {
              "type": "object",
              "required": [
                "kind",
                "domainRef",
                "principalRef"
              ],
              "properties": {
                "kind": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "person"
                    },
                    {
                      "type": "string",
                      "const": "agent"
                    },
                    {
                      "type": "string",
                      "const": "service"
                    },
                    {
                      "type": "string",
                      "const": "schedule"
                    },
                    {
                      "type": "string",
                      "const": "webhook"
                    },
                    {
                      "type": "string",
                      "const": "system"
                    },
                    {
                      "type": "string",
                      "const": "local-account"
                    },
                    {
                      "type": "string",
                      "const": "runtime"
                    }
                  ]
                },
                "domainRef": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "principalRef": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "displayLabel": {
                  "type": "string",
                  "maxLength": 128
                }
              },
              "additionalProperties": false
            },
            "agentDefinition": {
              "type": "object",
              "required": [
                "definitionRef",
                "state"
              ],
              "properties": {
                "definitionRef": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "revisionRef": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "state": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "present"
                    },
                    {
                      "type": "string",
                      "const": "absent"
                    },
                    {
                      "type": "string",
                      "const": "unknown"
                    },
                    {
                      "type": "string",
                      "const": "unsupported"
                    }
                  ]
                }
              },
              "additionalProperties": false
            },
            "runtimeInstance": {
              "type": "object",
              "required": [
                "runtimeRef",
                "kind",
                "state"
              ],
              "properties": {
                "runtimeRef": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "kind": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "gateway"
                    },
                    {
                      "type": "string",
                      "const": "embedded"
                    },
                    {
                      "type": "string",
                      "const": "worker"
                    },
                    {
                      "type": "string",
                      "const": "plugin-harness"
                    },
                    {
                      "type": "string",
                      "const": "acp"
                    }
                  ]
                },
                "state": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "present"
                    },
                    {
                      "type": "string",
                      "const": "absent"
                    },
                    {
                      "type": "string",
                      "const": "unknown"
                    },
                    {
                      "type": "string",
                      "const": "unsupported"
                    }
                  ]
                }
              },
              "additionalProperties": false
            },
            "representedSubject": {
              "type": "object",
              "required": [
                "principal",
                "state"
              ],
              "properties": {
                "principal": {
                  "type": "object",
                  "required": [
                    "kind",
                    "domainRef",
                    "principalRef"
                  ],
                  "properties": {
                    "kind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "person"
                        },
                        {
                          "type": "string",
                          "const": "agent"
                        },
                        {
                          "type": "string",
                          "const": "service"
                        },
                        {
                          "type": "string",
                          "const": "schedule"
                        },
                        {
                          "type": "string",
                          "const": "webhook"
                        },
                        {
                          "type": "string",
                          "const": "system"
                        },
                        {
                          "type": "string",
                          "const": "local-account"
                        },
                        {
                          "type": "string",
                          "const": "runtime"
                        }
                      ]
                    },
                    "domainRef": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "principalRef": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "displayLabel": {
                      "type": "string",
                      "maxLength": 128
                    }
                  },
                  "additionalProperties": false
                },
                "state": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "present"
                    },
                    {
                      "type": "string",
                      "const": "absent"
                    },
                    {
                      "type": "string",
                      "const": "unknown"
                    },
                    {
                      "type": "string",
                      "const": "unsupported"
                    }
                  ]
                }
              },
              "additionalProperties": false
            },
            "sponsor": {
              "type": "object",
              "required": [
                "principal",
                "state"
              ],
              "properties": {
                "principal": {
                  "type": "object",
                  "required": [
                    "kind",
                    "domainRef",
                    "principalRef"
                  ],
                  "properties": {
                    "kind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "person"
                        },
                        {
                          "type": "string",
                          "const": "agent"
                        },
                        {
                          "type": "string",
                          "const": "service"
                        },
                        {
                          "type": "string",
                          "const": "schedule"
                        },
                        {
                          "type": "string",
                          "const": "webhook"
                        },
                        {
                          "type": "string",
                          "const": "system"
                        },
                        {
                          "type": "string",
                          "const": "local-account"
                        },
                        {
                          "type": "string",
                          "const": "runtime"
                        }
                      ]
                    },
                    "domainRef": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "principalRef": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "displayLabel": {
                      "type": "string",
                      "maxLength": 128
                    }
                  },
                  "additionalProperties": false
                },
                "relationshipRef": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "state": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "present"
                    },
                    {
                      "type": "string",
                      "const": "absent"
                    },
                    {
                      "type": "string",
                      "const": "unknown"
                    },
                    {
                      "type": "string",
                      "const": "unsupported"
                    }
                  ]
                }
              },
              "additionalProperties": false
            },
            "applicableGrants": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "grantRef",
                  "state"
                ],
                "properties": {
                  "grantRef": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256
                  },
                  "state": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "present"
                      },
                      {
                        "type": "string",
                        "const": "absent"
                      },
                      {
                        "type": "string",
                        "const": "unknown"
                      },
                      {
                        "type": "string",
                        "const": "unsupported"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              },
              "maxItems": 16
            },
            "assurance": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "kind",
                  "evidenceRef",
                  "strength"
                ],
                "properties": {
                  "kind": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "durable-profile"
                      },
                      {
                        "type": "string",
                        "const": "trusted-proxy"
                      },
                      {
                        "type": "string",
                        "const": "tailscale-whois"
                      },
                      {
                        "type": "string",
                        "const": "device-proof"
                      },
                      {
                        "type": "string",
                        "const": "channel-admission"
                      },
                      {
                        "type": "string",
                        "const": "local-process"
                      },
                      {
                        "type": "string",
                        "const": "spawn-lineage"
                      },
                      {
                        "type": "string",
                        "const": "worker-admission"
                      },
                      {
                        "type": "string",
                        "const": "runtime-binding"
                      },
                      {
                        "type": "string",
                        "const": "other"
                      }
                    ]
                  },
                  "evidenceRef": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256
                  },
                  "strength": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "self-asserted"
                      },
                      {
                        "type": "string",
                        "const": "boundary-verified"
                      },
                      {
                        "type": "string",
                        "const": "cryptographic"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              },
              "maxItems": 16
            },
            "lineage": {
              "type": "object",
              "required": [
                "depth"
              ],
              "properties": {
                "parentContextId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "parentExecutionId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "parentRunId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "parentAgentPrincipal": {
                  "type": "object",
                  "required": [
                    "kind",
                    "domainRef",
                    "principalRef"
                  ],
                  "properties": {
                    "kind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "person"
                        },
                        {
                          "type": "string",
                          "const": "agent"
                        },
                        {
                          "type": "string",
                          "const": "service"
                        },
                        {
                          "type": "string",
                          "const": "schedule"
                        },
                        {
                          "type": "string",
                          "const": "webhook"
                        },
                        {
                          "type": "string",
                          "const": "system"
                        },
                        {
                          "type": "string",
                          "const": "local-account"
                        },
                        {
                          "type": "string",
                          "const": "runtime"
                        }
                      ]
                    },
                    "domainRef": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "principalRef": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "displayLabel": {
                      "type": "string",
                      "maxLength": 128
                    }
                  },
                  "additionalProperties": false
                },
                "delegationRef": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "depth": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 64
                }
              },
              "additionalProperties": false
            },
            "coverageState": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "attribution-only"
                },
                {
                  "type": "string",
                  "const": "unattributed"
                },
                {
                  "type": "string",
                  "const": "unknown"
                },
                {
                  "type": "string",
                  "const": "unsupported"
                }
              ]
            },
            "missingEvidence": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "maxItems": 16
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "AuditRunIdentityUnknownV1": {
      "type": "object",
      "required": [
        "state",
        "reasonCode",
        "missingEvidence",
        "remediation"
      ],
      "properties": {
        "state": {
          "type": "string",
          "const": "unknown"
        },
        "reasonCode": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "missingEvidence": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "maxItems": 16
        },
        "remediation": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "code",
              "text"
            ],
            "properties": {
              "code": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "text": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512
              }
            },
            "additionalProperties": false
          },
          "maxItems": 8
        }
      },
      "additionalProperties": false
    },
    "AuditRunIdentityUnsupportedV1": {
      "type": "object",
      "required": [
        "state",
        "reasonCode",
        "missingEvidence",
        "remediation"
      ],
      "properties": {
        "state": {
          "type": "string",
          "const": "unsupported"
        },
        "reasonCode": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "missingEvidence": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "maxItems": 16
        },
        "remediation": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "code",
              "text"
            ],
            "properties": {
              "code": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "text": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512
              }
            },
            "additionalProperties": false
          },
          "maxItems": 8
        }
      },
      "additionalProperties": false
    },
    "AuditRunIdentityAmbiguousV1": {
      "type": "object",
      "required": [
        "state",
        "reasonCode",
        "candidates",
        "missingEvidence",
        "remediation"
      ],
      "properties": {
        "state": {
          "type": "string",
          "const": "ambiguous"
        },
        "reasonCode": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "candidates": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "executionId",
              "contextId",
              "createdAt"
            ],
            "properties": {
              "executionId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "contextId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "createdAt": {
                "type": "integer",
                "minimum": 0
              }
            },
            "additionalProperties": false
          },
          "maxItems": 50
        },
        "missingEvidence": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "maxItems": 16
        },
        "remediation": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "code",
              "text"
            ],
            "properties": {
              "code": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "text": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512
              }
            },
            "additionalProperties": false
          },
          "maxItems": 8
        }
      },
      "additionalProperties": false
    },
    "AuditRunIdentityV1": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "state",
            "context"
          ],
          "properties": {
            "state": {
              "type": "string",
              "const": "present"
            },
            "context": {
              "type": "object",
              "required": [
                "schemaVersion",
                "contextId",
                "executionId",
                "runId",
                "createdAt",
                "trustDomain",
                "invoker",
                "ingress",
                "agentPrincipal",
                "agentDefinition",
                "runtimeInstance",
                "applicableGrants",
                "assurance",
                "coverageState",
                "missingEvidence"
              ],
              "properties": {
                "schemaVersion": {
                  "type": "number",
                  "const": 1
                },
                "contextId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "executionId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "runId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "createdAt": {
                  "type": "integer",
                  "minimum": 0
                },
                "trustDomain": {
                  "type": "object",
                  "required": [
                    "kind",
                    "domainRef",
                    "state"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "gateway-cell"
                    },
                    "domainRef": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "state": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "present"
                        },
                        {
                          "type": "string",
                          "const": "absent"
                        },
                        {
                          "type": "string",
                          "const": "unknown"
                        },
                        {
                          "type": "string",
                          "const": "unsupported"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                },
                "invoker": {
                  "type": "object",
                  "required": [
                    "state"
                  ],
                  "properties": {
                    "principal": {
                      "type": "object",
                      "required": [
                        "kind",
                        "domainRef",
                        "principalRef"
                      ],
                      "properties": {
                        "kind": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "person"
                            },
                            {
                              "type": "string",
                              "const": "agent"
                            },
                            {
                              "type": "string",
                              "const": "service"
                            },
                            {
                              "type": "string",
                              "const": "schedule"
                            },
                            {
                              "type": "string",
                              "const": "webhook"
                            },
                            {
                              "type": "string",
                              "const": "system"
                            },
                            {
                              "type": "string",
                              "const": "local-account"
                            },
                            {
                              "type": "string",
                              "const": "runtime"
                            }
                          ]
                        },
                        "domainRef": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256
                        },
                        "principalRef": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256
                        },
                        "displayLabel": {
                          "type": "string",
                          "maxLength": 128
                        }
                      },
                      "additionalProperties": false
                    },
                    "state": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "present"
                        },
                        {
                          "type": "string",
                          "const": "absent"
                        },
                        {
                          "type": "string",
                          "const": "unknown"
                        },
                        {
                          "type": "string",
                          "const": "unsupported"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                },
                "ingress": {
                  "type": "object",
                  "required": [
                    "kind",
                    "boundary",
                    "state"
                  ],
                  "properties": {
                    "kind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "local-cli"
                        },
                        {
                          "type": "string",
                          "const": "gateway-client"
                        },
                        {
                          "type": "string",
                          "const": "channel"
                        },
                        {
                          "type": "string",
                          "const": "api"
                        },
                        {
                          "type": "string",
                          "const": "schedule"
                        },
                        {
                          "type": "string",
                          "const": "webhook"
                        },
                        {
                          "type": "string",
                          "const": "task"
                        },
                        {
                          "type": "string",
                          "const": "subagent"
                        },
                        {
                          "type": "string",
                          "const": "acp"
                        },
                        {
                          "type": "string",
                          "const": "worker"
                        },
                        {
                          "type": "string",
                          "const": "plugin"
                        },
                        {
                          "type": "string",
                          "const": "recovery"
                        },
                        {
                          "type": "string",
                          "const": "system"
                        }
                      ]
                    },
                    "sourceRef": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "boundary": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "state": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "present"
                        },
                        {
                          "type": "string",
                          "const": "absent"
                        },
                        {
                          "type": "string",
                          "const": "unknown"
                        },
                        {
                          "type": "string",
                          "const": "unsupported"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                },
                "agentPrincipal": {
                  "type": "object",
                  "required": [
                    "kind",
                    "domainRef",
                    "principalRef"
                  ],
                  "properties": {
                    "kind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "person"
                        },
                        {
                          "type": "string",
                          "const": "agent"
                        },
                        {
                          "type": "string",
                          "const": "service"
                        },
                        {
                          "type": "string",
                          "const": "schedule"
                        },
                        {
                          "type": "string",
                          "const": "webhook"
                        },
                        {
                          "type": "string",
                          "const": "system"
                        },
                        {
                          "type": "string",
                          "const": "local-account"
                        },
                        {
                          "type": "string",
                          "const": "runtime"
                        }
                      ]
                    },
                    "domainRef": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "principalRef": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "displayLabel": {
                      "type": "string",
                      "maxLength": 128
                    }
                  },
                  "additionalProperties": false
                },
                "agentDefinition": {
                  "type": "object",
                  "required": [
                    "definitionRef",
                    "state"
                  ],
                  "properties": {
                    "definitionRef": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "revisionRef": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "state": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "present"
                        },
                        {
                          "type": "string",
                          "const": "absent"
                        },
                        {
                          "type": "string",
                          "const": "unknown"
                        },
                        {
                          "type": "string",
                          "const": "unsupported"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                },
                "runtimeInstance": {
                  "type": "object",
                  "required": [
                    "runtimeRef",
                    "kind",
                    "state"
                  ],
                  "properties": {
                    "runtimeRef": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "kind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "gateway"
                        },
                        {
                          "type": "string",
                          "const": "embedded"
                        },
                        {
                          "type": "string",
                          "const": "worker"
                        },
                        {
                          "type": "string",
                          "const": "plugin-harness"
                        },
                        {
                          "type": "string",
                          "const": "acp"
                        }
                      ]
                    },
                    "state": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "present"
                        },
                        {
                          "type": "string",
                          "const": "absent"
                        },
                        {
                          "type": "string",
                          "const": "unknown"
                        },
                        {
                          "type": "string",
                          "const": "unsupported"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                },
                "representedSubject": {
                  "type": "object",
                  "required": [
                    "principal",
                    "state"
                  ],
                  "properties": {
                    "principal": {
                      "type": "object",
                      "required": [
                        "kind",
                        "domainRef",
                        "principalRef"
                      ],
                      "properties": {
                        "kind": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "person"
                            },
                            {
                              "type": "string",
                              "const": "agent"
                            },
                            {
                              "type": "string",
                              "const": "service"
                            },
                            {
                              "type": "string",
                              "const": "schedule"
                            },
                            {
                              "type": "string",
                              "const": "webhook"
                            },
                            {
                              "type": "string",
                              "const": "system"
                            },
                            {
                              "type": "string",
                              "const": "local-account"
                            },
                            {
                              "type": "string",
                              "const": "runtime"
                            }
                          ]
                        },
                        "domainRef": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256
                        },
                        "principalRef": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256
                        },
                        "displayLabel": {
                          "type": "string",
                          "maxLength": 128
                        }
                      },
                      "additionalProperties": false
                    },
                    "state": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "present"
                        },
                        {
                          "type": "string",
                          "const": "absent"
                        },
                        {
                          "type": "string",
                          "const": "unknown"
                        },
                        {
                          "type": "string",
                          "const": "unsupported"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                },
                "sponsor": {
                  "type": "object",
                  "required": [
                    "principal",
                    "state"
                  ],
                  "properties": {
                    "principal": {
                      "type": "object",
                      "required": [
                        "kind",
                        "domainRef",
                        "principalRef"
                      ],
                      "properties": {
                        "kind": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "person"
                            },
                            {
                              "type": "string",
                              "const": "agent"
                            },
                            {
                              "type": "string",
                              "const": "service"
                            },
                            {
                              "type": "string",
                              "const": "schedule"
                            },
                            {
                              "type": "string",
                              "const": "webhook"
                            },
                            {
                              "type": "string",
                              "const": "system"
                            },
                            {
                              "type": "string",
                              "const": "local-account"
                            },
                            {
                              "type": "string",
                              "const": "runtime"
                            }
                          ]
                        },
                        "domainRef": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256
                        },
                        "principalRef": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256
                        },
                        "displayLabel": {
                          "type": "string",
                          "maxLength": 128
                        }
                      },
                      "additionalProperties": false
                    },
                    "relationshipRef": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "state": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "present"
                        },
                        {
                          "type": "string",
                          "const": "absent"
                        },
                        {
                          "type": "string",
                          "const": "unknown"
                        },
                        {
                          "type": "string",
                          "const": "unsupported"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                },
                "applicableGrants": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "grantRef",
                      "state"
                    ],
                    "properties": {
                      "grantRef": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 256
                      },
                      "state": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "present"
                          },
                          {
                            "type": "string",
                            "const": "absent"
                          },
                          {
                            "type": "string",
                            "const": "unknown"
                          },
                          {
                            "type": "string",
                            "const": "unsupported"
                          }
                        ]
                      }
                    },
                    "additionalProperties": false
                  },
                  "maxItems": 16
                },
                "assurance": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "kind",
                      "evidenceRef",
                      "strength"
                    ],
                    "properties": {
                      "kind": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "durable-profile"
                          },
                          {
                            "type": "string",
                            "const": "trusted-proxy"
                          },
                          {
                            "type": "string",
                            "const": "tailscale-whois"
                          },
                          {
                            "type": "string",
                            "const": "device-proof"
                          },
                          {
                            "type": "string",
                            "const": "channel-admission"
                          },
                          {
                            "type": "string",
                            "const": "local-process"
                          },
                          {
                            "type": "string",
                            "const": "spawn-lineage"
                          },
                          {
                            "type": "string",
                            "const": "worker-admission"
                          },
                          {
                            "type": "string",
                            "const": "runtime-binding"
                          },
                          {
                            "type": "string",
                            "const": "other"
                          }
                        ]
                      },
                      "evidenceRef": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 256
                      },
                      "strength": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "self-asserted"
                          },
                          {
                            "type": "string",
                            "const": "boundary-verified"
                          },
                          {
                            "type": "string",
                            "const": "cryptographic"
                          }
                        ]
                      }
                    },
                    "additionalProperties": false
                  },
                  "maxItems": 16
                },
                "lineage": {
                  "type": "object",
                  "required": [
                    "depth"
                  ],
                  "properties": {
                    "parentContextId": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "parentExecutionId": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "parentRunId": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "parentAgentPrincipal": {
                      "type": "object",
                      "required": [
                        "kind",
                        "domainRef",
                        "principalRef"
                      ],
                      "properties": {
                        "kind": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "person"
                            },
                            {
                              "type": "string",
                              "const": "agent"
                            },
                            {
                              "type": "string",
                              "const": "service"
                            },
                            {
                              "type": "string",
                              "const": "schedule"
                            },
                            {
                              "type": "string",
                              "const": "webhook"
                            },
                            {
                              "type": "string",
                              "const": "system"
                            },
                            {
                              "type": "string",
                              "const": "local-account"
                            },
                            {
                              "type": "string",
                              "const": "runtime"
                            }
                          ]
                        },
                        "domainRef": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256
                        },
                        "principalRef": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256
                        },
                        "displayLabel": {
                          "type": "string",
                          "maxLength": 128
                        }
                      },
                      "additionalProperties": false
                    },
                    "delegationRef": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "depth": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 64
                    }
                  },
                  "additionalProperties": false
                },
                "coverageState": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "attribution-only"
                    },
                    {
                      "type": "string",
                      "const": "unattributed"
                    },
                    {
                      "type": "string",
                      "const": "unknown"
                    },
                    {
                      "type": "string",
                      "const": "unsupported"
                    }
                  ]
                },
                "missingEvidence": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256
                  },
                  "maxItems": 16
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "state",
            "reasonCode",
            "missingEvidence",
            "remediation"
          ],
          "properties": {
            "state": {
              "type": "string",
              "const": "unknown"
            },
            "reasonCode": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "missingEvidence": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "maxItems": 16
            },
            "remediation": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "code",
                  "text"
                ],
                "properties": {
                  "code": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256
                  },
                  "text": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  }
                },
                "additionalProperties": false
              },
              "maxItems": 8
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "state",
            "reasonCode",
            "missingEvidence",
            "remediation"
          ],
          "properties": {
            "state": {
              "type": "string",
              "const": "unsupported"
            },
            "reasonCode": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "missingEvidence": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "maxItems": 16
            },
            "remediation": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "code",
                  "text"
                ],
                "properties": {
                  "code": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256
                  },
                  "text": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  }
                },
                "additionalProperties": false
              },
              "maxItems": 8
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "state",
            "reasonCode",
            "candidates",
            "missingEvidence",
            "remediation"
          ],
          "properties": {
            "state": {
              "type": "string",
              "const": "ambiguous"
            },
            "reasonCode": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "candidates": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "executionId",
                  "contextId",
                  "createdAt"
                ],
                "properties": {
                  "executionId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256
                  },
                  "contextId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256
                  },
                  "createdAt": {
                    "type": "integer",
                    "minimum": 0
                  }
                },
                "additionalProperties": false
              },
              "maxItems": 50
            },
            "missingEvidence": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "maxItems": 16
            },
            "remediation": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "code",
                  "text"
                ],
                "properties": {
                  "code": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256
                  },
                  "text": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  }
                },
                "additionalProperties": false
              },
              "maxItems": 8
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "AuditRunInspectParams": {
      "type": "object",
      "properties": {
        "runId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "executionId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "executionCursor": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "executionLimit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 50
        },
        "decisionCursor": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "decisionLimit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100
        }
      },
      "additionalProperties": false,
      "oneOf": [
        {
          "required": [
            "runId"
          ],
          "not": {
            "required": [
              "executionId"
            ]
          }
        },
        {
          "required": [
            "executionId"
          ],
          "not": {
            "anyOf": [
              {
                "required": [
                  "runId"
                ]
              },
              {
                "required": [
                  "executionCursor"
                ]
              },
              {
                "required": [
                  "executionLimit"
                ]
              }
            ]
          }
        }
      ]
    },
    "AuditRunInspectResult": {
      "type": "object",
      "required": [
        "schemaVersion",
        "run",
        "identity",
        "decisionDisplays",
        "coverage"
      ],
      "properties": {
        "schemaVersion": {
          "type": "number",
          "const": 1
        },
        "run": {
          "type": "object",
          "required": [
            "status"
          ],
          "properties": {
            "runId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "executionId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "status": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "known"
                },
                {
                  "type": "string",
                  "const": "unknown"
                }
              ]
            }
          },
          "additionalProperties": false
        },
        "identity": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "state",
                "context"
              ],
              "properties": {
                "state": {
                  "type": "string",
                  "const": "present"
                },
                "context": {
                  "type": "object",
                  "required": [
                    "schemaVersion",
                    "contextId",
                    "executionId",
                    "runId",
                    "createdAt",
                    "trustDomain",
                    "invoker",
                    "ingress",
                    "agentPrincipal",
                    "agentDefinition",
                    "runtimeInstance",
                    "applicableGrants",
                    "assurance",
                    "coverageState",
                    "missingEvidence"
                  ],
                  "properties": {
                    "schemaVersion": {
                      "type": "number",
                      "const": 1
                    },
                    "contextId": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "executionId": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "runId": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "createdAt": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "trustDomain": {
                      "type": "object",
                      "required": [
                        "kind",
                        "domainRef",
                        "state"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "gateway-cell"
                        },
                        "domainRef": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256
                        },
                        "state": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "present"
                            },
                            {
                              "type": "string",
                              "const": "absent"
                            },
                            {
                              "type": "string",
                              "const": "unknown"
                            },
                            {
                              "type": "string",
                              "const": "unsupported"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    "invoker": {
                      "type": "object",
                      "required": [
                        "state"
                      ],
                      "properties": {
                        "principal": {
                          "type": "object",
                          "required": [
                            "kind",
                            "domainRef",
                            "principalRef"
                          ],
                          "properties": {
                            "kind": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "person"
                                },
                                {
                                  "type": "string",
                                  "const": "agent"
                                },
                                {
                                  "type": "string",
                                  "const": "service"
                                },
                                {
                                  "type": "string",
                                  "const": "schedule"
                                },
                                {
                                  "type": "string",
                                  "const": "webhook"
                                },
                                {
                                  "type": "string",
                                  "const": "system"
                                },
                                {
                                  "type": "string",
                                  "const": "local-account"
                                },
                                {
                                  "type": "string",
                                  "const": "runtime"
                                }
                              ]
                            },
                            "domainRef": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 256
                            },
                            "principalRef": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 256
                            },
                            "displayLabel": {
                              "type": "string",
                              "maxLength": 128
                            }
                          },
                          "additionalProperties": false
                        },
                        "state": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "present"
                            },
                            {
                              "type": "string",
                              "const": "absent"
                            },
                            {
                              "type": "string",
                              "const": "unknown"
                            },
                            {
                              "type": "string",
                              "const": "unsupported"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    "ingress": {
                      "type": "object",
                      "required": [
                        "kind",
                        "boundary",
                        "state"
                      ],
                      "properties": {
                        "kind": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "local-cli"
                            },
                            {
                              "type": "string",
                              "const": "gateway-client"
                            },
                            {
                              "type": "string",
                              "const": "channel"
                            },
                            {
                              "type": "string",
                              "const": "api"
                            },
                            {
                              "type": "string",
                              "const": "schedule"
                            },
                            {
                              "type": "string",
                              "const": "webhook"
                            },
                            {
                              "type": "string",
                              "const": "task"
                            },
                            {
                              "type": "string",
                              "const": "subagent"
                            },
                            {
                              "type": "string",
                              "const": "acp"
                            },
                            {
                              "type": "string",
                              "const": "worker"
                            },
                            {
                              "type": "string",
                              "const": "plugin"
                            },
                            {
                              "type": "string",
                              "const": "recovery"
                            },
                            {
                              "type": "string",
                              "const": "system"
                            }
                          ]
                        },
                        "sourceRef": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256
                        },
                        "boundary": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256
                        },
                        "state": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "present"
                            },
                            {
                              "type": "string",
                              "const": "absent"
                            },
                            {
                              "type": "string",
                              "const": "unknown"
                            },
                            {
                              "type": "string",
                              "const": "unsupported"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    "agentPrincipal": {
                      "type": "object",
                      "required": [
                        "kind",
                        "domainRef",
                        "principalRef"
                      ],
                      "properties": {
                        "kind": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "person"
                            },
                            {
                              "type": "string",
                              "const": "agent"
                            },
                            {
                              "type": "string",
                              "const": "service"
                            },
                            {
                              "type": "string",
                              "const": "schedule"
                            },
                            {
                              "type": "string",
                              "const": "webhook"
                            },
                            {
                              "type": "string",
                              "const": "system"
                            },
                            {
                              "type": "string",
                              "const": "local-account"
                            },
                            {
                              "type": "string",
                              "const": "runtime"
                            }
                          ]
                        },
                        "domainRef": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256
                        },
                        "principalRef": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256
                        },
                        "displayLabel": {
                          "type": "string",
                          "maxLength": 128
                        }
                      },
                      "additionalProperties": false
                    },
                    "agentDefinition": {
                      "type": "object",
                      "required": [
                        "definitionRef",
                        "state"
                      ],
                      "properties": {
                        "definitionRef": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256
                        },
                        "revisionRef": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256
                        },
                        "state": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "present"
                            },
                            {
                              "type": "string",
                              "const": "absent"
                            },
                            {
                              "type": "string",
                              "const": "unknown"
                            },
                            {
                              "type": "string",
                              "const": "unsupported"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    "runtimeInstance": {
                      "type": "object",
                      "required": [
                        "runtimeRef",
                        "kind",
                        "state"
                      ],
                      "properties": {
                        "runtimeRef": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256
                        },
                        "kind": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "gateway"
                            },
                            {
                              "type": "string",
                              "const": "embedded"
                            },
                            {
                              "type": "string",
                              "const": "worker"
                            },
                            {
                              "type": "string",
                              "const": "plugin-harness"
                            },
                            {
                              "type": "string",
                              "const": "acp"
                            }
                          ]
                        },
                        "state": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "present"
                            },
                            {
                              "type": "string",
                              "const": "absent"
                            },
                            {
                              "type": "string",
                              "const": "unknown"
                            },
                            {
                              "type": "string",
                              "const": "unsupported"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    "representedSubject": {
                      "type": "object",
                      "required": [
                        "principal",
                        "state"
                      ],
                      "properties": {
                        "principal": {
                          "type": "object",
                          "required": [
                            "kind",
                            "domainRef",
                            "principalRef"
                          ],
                          "properties": {
                            "kind": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "person"
                                },
                                {
                                  "type": "string",
                                  "const": "agent"
                                },
                                {
                                  "type": "string",
                                  "const": "service"
                                },
                                {
                                  "type": "string",
                                  "const": "schedule"
                                },
                                {
                                  "type": "string",
                                  "const": "webhook"
                                },
                                {
                                  "type": "string",
                                  "const": "system"
                                },
                                {
                                  "type": "string",
                                  "const": "local-account"
                                },
                                {
                                  "type": "string",
                                  "const": "runtime"
                                }
                              ]
                            },
                            "domainRef": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 256
                            },
                            "principalRef": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 256
                            },
                            "displayLabel": {
                              "type": "string",
                              "maxLength": 128
                            }
                          },
                          "additionalProperties": false
                        },
                        "state": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "present"
                            },
                            {
                              "type": "string",
                              "const": "absent"
                            },
                            {
                              "type": "string",
                              "const": "unknown"
                            },
                            {
                              "type": "string",
                              "const": "unsupported"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    "sponsor": {
                      "type": "object",
                      "required": [
                        "principal",
                        "state"
                      ],
                      "properties": {
                        "principal": {
                          "type": "object",
                          "required": [
                            "kind",
                            "domainRef",
                            "principalRef"
                          ],
                          "properties": {
                            "kind": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "person"
                                },
                                {
                                  "type": "string",
                                  "const": "agent"
                                },
                                {
                                  "type": "string",
                                  "const": "service"
                                },
                                {
                                  "type": "string",
                                  "const": "schedule"
                                },
                                {
                                  "type": "string",
                                  "const": "webhook"
                                },
                                {
                                  "type": "string",
                                  "const": "system"
                                },
                                {
                                  "type": "string",
                                  "const": "local-account"
                                },
                                {
                                  "type": "string",
                                  "const": "runtime"
                                }
                              ]
                            },
                            "domainRef": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 256
                            },
                            "principalRef": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 256
                            },
                            "displayLabel": {
                              "type": "string",
                              "maxLength": 128
                            }
                          },
                          "additionalProperties": false
                        },
                        "relationshipRef": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256
                        },
                        "state": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "present"
                            },
                            {
                              "type": "string",
                              "const": "absent"
                            },
                            {
                              "type": "string",
                              "const": "unknown"
                            },
                            {
                              "type": "string",
                              "const": "unsupported"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    "applicableGrants": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "grantRef",
                          "state"
                        ],
                        "properties": {
                          "grantRef": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 256
                          },
                          "state": {
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "present"
                              },
                              {
                                "type": "string",
                                "const": "absent"
                              },
                              {
                                "type": "string",
                                "const": "unknown"
                              },
                              {
                                "type": "string",
                                "const": "unsupported"
                              }
                            ]
                          }
                        },
                        "additionalProperties": false
                      },
                      "maxItems": 16
                    },
                    "assurance": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "kind",
                          "evidenceRef",
                          "strength"
                        ],
                        "properties": {
                          "kind": {
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "durable-profile"
                              },
                              {
                                "type": "string",
                                "const": "trusted-proxy"
                              },
                              {
                                "type": "string",
                                "const": "tailscale-whois"
                              },
                              {
                                "type": "string",
                                "const": "device-proof"
                              },
                              {
                                "type": "string",
                                "const": "channel-admission"
                              },
                              {
                                "type": "string",
                                "const": "local-process"
                              },
                              {
                                "type": "string",
                                "const": "spawn-lineage"
                              },
                              {
                                "type": "string",
                                "const": "worker-admission"
                              },
                              {
                                "type": "string",
                                "const": "runtime-binding"
                              },
                              {
                                "type": "string",
                                "const": "other"
                              }
                            ]
                          },
                          "evidenceRef": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 256
                          },
                          "strength": {
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "self-asserted"
                              },
                              {
                                "type": "string",
                                "const": "boundary-verified"
                              },
                              {
                                "type": "string",
                                "const": "cryptographic"
                              }
                            ]
                          }
                        },
                        "additionalProperties": false
                      },
                      "maxItems": 16
                    },
                    "lineage": {
                      "type": "object",
                      "required": [
                        "depth"
                      ],
                      "properties": {
                        "parentContextId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256
                        },
                        "parentExecutionId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256
                        },
                        "parentRunId": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256
                        },
                        "parentAgentPrincipal": {
                          "type": "object",
                          "required": [
                            "kind",
                            "domainRef",
                            "principalRef"
                          ],
                          "properties": {
                            "kind": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "person"
                                },
                                {
                                  "type": "string",
                                  "const": "agent"
                                },
                                {
                                  "type": "string",
                                  "const": "service"
                                },
                                {
                                  "type": "string",
                                  "const": "schedule"
                                },
                                {
                                  "type": "string",
                                  "const": "webhook"
                                },
                                {
                                  "type": "string",
                                  "const": "system"
                                },
                                {
                                  "type": "string",
                                  "const": "local-account"
                                },
                                {
                                  "type": "string",
                                  "const": "runtime"
                                }
                              ]
                            },
                            "domainRef": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 256
                            },
                            "principalRef": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 256
                            },
                            "displayLabel": {
                              "type": "string",
                              "maxLength": 128
                            }
                          },
                          "additionalProperties": false
                        },
                        "delegationRef": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256
                        },
                        "depth": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 64
                        }
                      },
                      "additionalProperties": false
                    },
                    "coverageState": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "attribution-only"
                        },
                        {
                          "type": "string",
                          "const": "unattributed"
                        },
                        {
                          "type": "string",
                          "const": "unknown"
                        },
                        {
                          "type": "string",
                          "const": "unsupported"
                        }
                      ]
                    },
                    "missingEvidence": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 256
                      },
                      "maxItems": 16
                    }
                  },
                  "additionalProperties": false
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "state",
                "reasonCode",
                "missingEvidence",
                "remediation"
              ],
              "properties": {
                "state": {
                  "type": "string",
                  "const": "unknown"
                },
                "reasonCode": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "missingEvidence": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256
                  },
                  "maxItems": 16
                },
                "remediation": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "code",
                      "text"
                    ],
                    "properties": {
                      "code": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 256
                      },
                      "text": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      }
                    },
                    "additionalProperties": false
                  },
                  "maxItems": 8
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "state",
                "reasonCode",
                "missingEvidence",
                "remediation"
              ],
              "properties": {
                "state": {
                  "type": "string",
                  "const": "unsupported"
                },
                "reasonCode": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "missingEvidence": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256
                  },
                  "maxItems": 16
                },
                "remediation": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "code",
                      "text"
                    ],
                    "properties": {
                      "code": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 256
                      },
                      "text": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      }
                    },
                    "additionalProperties": false
                  },
                  "maxItems": 8
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "state",
                "reasonCode",
                "candidates",
                "missingEvidence",
                "remediation"
              ],
              "properties": {
                "state": {
                  "type": "string",
                  "const": "ambiguous"
                },
                "reasonCode": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "candidates": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "executionId",
                      "contextId",
                      "createdAt"
                    ],
                    "properties": {
                      "executionId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 256
                      },
                      "contextId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 256
                      },
                      "createdAt": {
                        "type": "integer",
                        "minimum": 0
                      }
                    },
                    "additionalProperties": false
                  },
                  "maxItems": 50
                },
                "missingEvidence": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256
                  },
                  "maxItems": 16
                },
                "remediation": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "code",
                      "text"
                    ],
                    "properties": {
                      "code": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 256
                      },
                      "text": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      }
                    },
                    "additionalProperties": false
                  },
                  "maxItems": 8
                }
              },
              "additionalProperties": false
            }
          ]
        },
        "decisionDisplays": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "schemaVersion",
              "selectorId",
              "occurredAt",
              "action",
              "decision",
              "enforcement",
              "provenance",
              "missingEvidence",
              "remediation"
            ],
            "properties": {
              "schemaVersion": {
                "type": "number",
                "const": 1
              },
              "selectorId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "occurredAt": {
                "type": "integer",
                "minimum": 0
              },
              "action": {
                "type": "object",
                "required": [
                  "family",
                  "operation"
                ],
                "properties": {
                  "family": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256
                  },
                  "operation": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256
                  },
                  "summary": {
                    "type": "string",
                    "maxLength": 512
                  }
                },
                "additionalProperties": false
              },
              "decision": {
                "type": "object",
                "required": [
                  "outcome",
                  "reasonCode"
                ],
                "properties": {
                  "outcome": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "allowed"
                      },
                      {
                        "type": "string",
                        "const": "denied"
                      },
                      {
                        "type": "string",
                        "const": "not-applicable"
                      },
                      {
                        "type": "string",
                        "const": "unknown"
                      }
                    ]
                  },
                  "reasonCode": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256
                  }
                },
                "additionalProperties": false
              },
              "enforcement": {
                "type": "object",
                "required": [
                  "coverageState",
                  "policyCount",
                  "grantCount",
                  "contextFieldsUsed"
                ],
                "properties": {
                  "coverageState": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "enforced"
                      },
                      {
                        "type": "string",
                        "const": "attribution-only"
                      },
                      {
                        "type": "string",
                        "const": "unattributed"
                      },
                      {
                        "type": "string",
                        "const": "unknown"
                      },
                      {
                        "type": "string",
                        "const": "unsupported"
                      }
                    ]
                  },
                  "policyCount": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 16
                  },
                  "grantCount": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 16
                  },
                  "contextFieldsUsed": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "maxItems": 16
                  }
                },
                "additionalProperties": false
              },
              "provenance": {
                "anyOf": [
                  {
                    "type": "object",
                    "required": [
                      "state",
                      "producer"
                    ],
                    "properties": {
                      "state": {
                        "type": "string",
                        "const": "verified"
                      },
                      "producer": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "run-admission"
                          },
                          {
                            "type": "string",
                            "const": "operator-approval"
                          },
                          {
                            "type": "string",
                            "const": "message-delivery"
                          },
                          {
                            "type": "string",
                            "const": "cron-lifecycle"
                          },
                          {
                            "type": "string",
                            "const": "task-lifecycle"
                          },
                          {
                            "type": "string",
                            "const": "flow-lifecycle"
                          }
                        ]
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "required": [
                      "state"
                    ],
                    "properties": {
                      "state": {
                        "type": "string",
                        "const": "unverified"
                      }
                    },
                    "additionalProperties": false
                  }
                ]
              },
              "missingEvidence": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "maxItems": 16
              },
              "remediation": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "code",
                    "text"
                  ],
                  "properties": {
                    "code": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "text": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 512
                    }
                  },
                  "additionalProperties": false
                },
                "maxItems": 8
              }
            },
            "additionalProperties": false
          },
          "maxItems": 100
        },
        "coverage": {
          "type": "object",
          "required": [
            "state",
            "missingEvidence"
          ],
          "properties": {
            "state": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "enforced"
                },
                {
                  "type": "string",
                  "const": "attribution-only"
                },
                {
                  "type": "string",
                  "const": "unattributed"
                },
                {
                  "type": "string",
                  "const": "unknown"
                },
                {
                  "type": "string",
                  "const": "unsupported"
                }
              ]
            },
            "missingEvidence": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256
              },
              "maxItems": 16
            }
          },
          "additionalProperties": false
        },
        "nextDecisionCursor": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "nextExecutionCursor": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        }
      },
      "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
    },
    "UsersPrefsChangedEvent": {
      "type": "object",
      "required": [
        "profileId",
        "keys"
      ],
      "properties": {
        "profileId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "keys": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^.{1,256}$"
          },
          "maxItems": 32,
          "uniqueItems": true
        }
      },
      "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,
          "pattern": "\\S"
        },
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 32768,
          "pattern": "\\S"
        },
        "tldr": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024,
          "pattern": "\\S"
        },
        "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,
                  "pattern": "\\S"
                },
                "prompt": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 32768,
                  "pattern": "\\S"
                },
                "tldr": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1024,
                  "pattern": "\\S"
                },
                "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
        },
        "mode": {
          "enum": [
            "worktree",
            "local",
            "cloud",
            "session"
          ],
          "type": "string"
        },
        "cloudProfileId": {
          "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,
          "pattern": "\\S"
        },
        "prompt": {
          "type": "string",
          "minLength": 1,
          "maxLength": 32768,
          "pattern": "\\S"
        },
        "tldr": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024,
          "pattern": "\\S"
        },
        "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,
              "pattern": "\\S"
            },
            "prompt": {
              "type": "string",
              "minLength": 1,
              "maxLength": 32768,
              "pattern": "\\S"
            },
            "tldr": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024,
              "pattern": "\\S"
            },
            "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,
                "pattern": "\\S"
              },
              "prompt": {
                "type": "string",
                "minLength": 1,
                "maxLength": 32768,
                "pattern": "\\S"
              },
              "tldr": {
                "type": "string",
                "minLength": 1,
                "maxLength": 1024,
                "pattern": "\\S"
              },
              "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"
        },
        "lastActivity": {
          "type": "string",
          "maxLength": 200,
          "x-openclaw-since": "2026.8"
        },
        "diffStat": {
          "type": "object",
          "required": [
            "files",
            "added",
            "removed"
          ],
          "properties": {
            "files": {
              "type": "integer",
              "minimum": 0
            },
            "added": {
              "type": "integer",
              "minimum": 0
            },
            "removed": {
              "type": "integer",
              "minimum": 0
            }
          },
          "additionalProperties": false,
          "x-openclaw-since": "2026.8"
        },
        "progressSummary": {
          "type": "string"
        },
        "terminalSummary": {
          "type": "string"
        },
        "error": {
          "type": "string"
        },
        "deliveryStatus": {
          "anyOf": [
            {
              "type": "string",
              "const": "pending"
            },
            {
              "type": "string",
              "const": "delivered"
            },
            {
              "type": "string",
              "const": "session_queued"
            },
            {
              "type": "string",
              "const": "failed"
            },
            {
              "type": "string",
              "const": "dismissed"
            },
            {
              "type": "string",
              "const": "parent_missing"
            },
            {
              "type": "string",
              "const": "not_applicable"
            }
          ]
        },
        "terminalOutcome": {
          "anyOf": [
            {
              "type": "string",
              "const": "succeeded"
            },
            {
              "type": "string",
              "const": "blocked"
            }
          ]
        },
        "result": {
          "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"
              },
              "lastActivity": {
                "type": "string",
                "maxLength": 200,
                "x-openclaw-since": "2026.8"
              },
              "diffStat": {
                "type": "object",
                "required": [
                  "files",
                  "added",
                  "removed"
                ],
                "properties": {
                  "files": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "added": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "removed": {
                    "type": "integer",
                    "minimum": 0
                  }
                },
                "additionalProperties": false,
                "x-openclaw-since": "2026.8"
              },
              "progressSummary": {
                "type": "string"
              },
              "terminalSummary": {
                "type": "string"
              },
              "error": {
                "type": "string"
              },
              "deliveryStatus": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "pending"
                  },
                  {
                    "type": "string",
                    "const": "delivered"
                  },
                  {
                    "type": "string",
                    "const": "session_queued"
                  },
                  {
                    "type": "string",
                    "const": "failed"
                  },
                  {
                    "type": "string",
                    "const": "dismissed"
                  },
                  {
                    "type": "string",
                    "const": "parent_missing"
                  },
                  {
                    "type": "string",
                    "const": "not_applicable"
                  }
                ]
              },
              "terminalOutcome": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "succeeded"
                  },
                  {
                    "type": "string",
                    "const": "blocked"
                  }
                ]
              },
              "result": {
                "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"
            },
            "lastActivity": {
              "type": "string",
              "maxLength": 200,
              "x-openclaw-since": "2026.8"
            },
            "diffStat": {
              "type": "object",
              "required": [
                "files",
                "added",
                "removed"
              ],
              "properties": {
                "files": {
                  "type": "integer",
                  "minimum": 0
                },
                "added": {
                  "type": "integer",
                  "minimum": 0
                },
                "removed": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "additionalProperties": false,
              "x-openclaw-since": "2026.8"
            },
            "progressSummary": {
              "type": "string"
            },
            "terminalSummary": {
              "type": "string"
            },
            "error": {
              "type": "string"
            },
            "deliveryStatus": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "pending"
                },
                {
                  "type": "string",
                  "const": "delivered"
                },
                {
                  "type": "string",
                  "const": "session_queued"
                },
                {
                  "type": "string",
                  "const": "failed"
                },
                {
                  "type": "string",
                  "const": "dismissed"
                },
                {
                  "type": "string",
                  "const": "parent_missing"
                },
                {
                  "type": "string",
                  "const": "not_applicable"
                }
              ]
            },
            "terminalOutcome": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "succeeded"
                },
                {
                  "type": "string",
                  "const": "blocked"
                }
              ]
            },
            "result": {
              "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"
            },
            "lastActivity": {
              "type": "string",
              "maxLength": 200,
              "x-openclaw-since": "2026.8"
            },
            "diffStat": {
              "type": "object",
              "required": [
                "files",
                "added",
                "removed"
              ],
              "properties": {
                "files": {
                  "type": "integer",
                  "minimum": 0
                },
                "added": {
                  "type": "integer",
                  "minimum": 0
                },
                "removed": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "additionalProperties": false,
              "x-openclaw-since": "2026.8"
            },
            "progressSummary": {
              "type": "string"
            },
            "terminalSummary": {
              "type": "string"
            },
            "error": {
              "type": "string"
            },
            "deliveryStatus": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "pending"
                },
                {
                  "type": "string",
                  "const": "delivered"
                },
                {
                  "type": "string",
                  "const": "session_queued"
                },
                {
                  "type": "string",
                  "const": "failed"
                },
                {
                  "type": "string",
                  "const": "dismissed"
                },
                {
                  "type": "string",
                  "const": "parent_missing"
                },
                {
                  "type": "string",
                  "const": "not_applicable"
                }
              ]
            },
            "terminalOutcome": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "succeeded"
                },
                {
                  "type": "string",
                  "const": "blocked"
                }
              ]
            },
            "result": {
              "type": "string"
            },
            "prompt": {
              "type": "string"
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "TasksRecoveryParams": {
      "type": "object",
      "required": [
        "taskIds"
      ],
      "properties": {
        "taskIds": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "minItems": 1,
          "maxItems": 10
        }
      },
      "additionalProperties": false
    },
    "TasksRecoveryResult": {
      "type": "object",
      "required": [
        "results"
      ],
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "taskId",
              "ok"
            ],
            "properties": {
              "taskId": {
                "type": "string",
                "minLength": 1
              },
              "ok": {
                "type": "boolean"
              },
              "reason": {
                "type": "string"
              },
              "duplicateRisk": {
                "type": "boolean"
              },
              "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"
                  },
                  "lastActivity": {
                    "type": "string",
                    "maxLength": 200,
                    "x-openclaw-since": "2026.8"
                  },
                  "diffStat": {
                    "type": "object",
                    "required": [
                      "files",
                      "added",
                      "removed"
                    ],
                    "properties": {
                      "files": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "added": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "removed": {
                        "type": "integer",
                        "minimum": 0
                      }
                    },
                    "additionalProperties": false,
                    "x-openclaw-since": "2026.8"
                  },
                  "progressSummary": {
                    "type": "string"
                  },
                  "terminalSummary": {
                    "type": "string"
                  },
                  "error": {
                    "type": "string"
                  },
                  "deliveryStatus": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "pending"
                      },
                      {
                        "type": "string",
                        "const": "delivered"
                      },
                      {
                        "type": "string",
                        "const": "session_queued"
                      },
                      {
                        "type": "string",
                        "const": "failed"
                      },
                      {
                        "type": "string",
                        "const": "dismissed"
                      },
                      {
                        "type": "string",
                        "const": "parent_missing"
                      },
                      {
                        "type": "string",
                        "const": "not_applicable"
                      }
                    ]
                  },
                  "terminalOutcome": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "succeeded"
                      },
                      {
                        "type": "string",
                        "const": "blocked"
                      }
                    ]
                  },
                  "result": {
                    "type": "string"
                  },
                  "prompt": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "maxItems": 10
        }
      },
      "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"
                },
                "docsUrl": {
                  "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"
            },
            "docsUrl": {
              "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"
                  },
                  "docsUrl": {
                    "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"
        },
        "wizardAnswer": {
          "type": "object",
          "required": [
            "stepId"
          ],
          "properties": {
            "stepId": {
              "type": "string",
              "minLength": 1
            },
            "value": {}
          },
          "additionalProperties": false
        },
        "wizardCancel": {
          "type": "object",
          "required": [
            "stepId"
          ],
          "properties": {
            "stepId": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        "welcomeVariant": {
          "anyOf": [
            {
              "type": "string",
              "const": "onboarding"
            },
            {
              "type": "string",
              "const": "new-agent"
            }
          ]
        },
        "reset": {
          "type": "boolean"
        },
        "context": {
          "type": "object",
          "required": [
            "page"
          ],
          "properties": {
            "page": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "pattern": "^[A-Za-z0-9/_-]{1,64}$"
            }
          },
          "additionalProperties": false
        },
        "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
        },
        "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
        }
      },
      "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": {
        "agentId": {
          "type": "string",
          "minLength": 1
        }
      },
      "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
              },
              "brandId": {
                "type": "string",
                "minLength": 1
              },
              "label": {
                "type": "string",
                "minLength": 1
              },
              "detail": {
                "type": "string"
              },
              "reason": {
                "type": "string",
                "minLength": 1
              },
              "authOptionId": {
                "type": "string",
                "minLength": 1
              },
              "manualProviderId": {
                "type": "string",
                "minLength": 1
              },
              "icon": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2048,
                "pattern": "^https://"
              },
              "website": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2048,
                "pattern": "^https://"
              }
            },
            "additionalProperties": false
          }
        },
        "manualProviders": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "label"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "brandId": {
                "type": "string",
                "minLength": 1
              },
              "groupLabel": {
                "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
          }
        },
        "prepareOptions": {
          "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"
              },
              "actionLabel": {
                "type": "string",
                "minLength": 1
              },
              "icon": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2048,
                "pattern": "^https://"
              },
              "website": {
                "type": "string",
                "minLength": 1,
                "maxLength": 2048,
                "pattern": "^https://"
              }
            },
            "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": {
        "agentId": {
          "type": "string",
          "minLength": 1
        }
      },
      "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": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "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"
          }
        },
        "gatewayRestartRequired": {
          "type": "boolean",
          "const": true
        },
        "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
        },
        "agentId": {
          "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
          }
        },
        "preparedModelRef": {
          "type": "string",
          "minLength": 1
        },
        "modelActivation": {
          "type": "object",
          "required": [
            "modelRef"
          ],
          "properties": {
            "modelRef": {
              "type": "string",
              "minLength": 1
            },
            "gatewayRestartRequired": {
              "type": "boolean",
              "const": true
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "WizardStartParams": {
      "type": "object",
      "properties": {
        "mode": {
          "anyOf": [
            {
              "type": "string",
              "const": "local"
            },
            {
              "type": "string",
              "const": "remote"
            }
          ]
        },
        "workspace": {
          "type": "string"
        },
        "installDaemon": {
          "type": "boolean"
        },
        "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
          }
        },
        "preparedModelRef": {
          "type": "string",
          "minLength": 1
        },
        "modelActivation": {
          "type": "object",
          "required": [
            "modelRef"
          ],
          "properties": {
            "modelRef": {
              "type": "string",
              "minLength": 1
            },
            "gatewayRestartRequired": {
              "type": "boolean",
              "const": true
            }
          },
          "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
          }
        },
        "preparedModelRef": {
          "type": "string",
          "minLength": 1
        },
        "modelActivation": {
          "type": "object",
          "required": [
            "modelRef"
          ],
          "properties": {
            "modelRef": {
              "type": "string",
              "minLength": 1
            },
            "gatewayRestartRequired": {
              "type": "boolean",
              "const": true
            }
          },
          "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"
                    }
                  },
                  "voicesByModel": {
                    "type": "object",
                    "patternProperties": {
                      "^.*$": {
                        "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"
                    }
                  },
                  "voicesByModel": {
                    "type": "object",
                    "patternProperties": {
                      "^.*$": {
                        "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"
                    }
                  },
                  "voicesByModel": {
                    "type": "object",
                    "patternProperties": {
                      "^.*$": {
                        "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"
              },
              {
                "type": "string",
                "const": "gateway-control-v1"
              }
            ]
          },
          "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"
            },
            "clientControl": {
              "type": "object",
              "required": [
                "owner"
              ],
              "properties": {
                "owner": {
                  "type": "string",
                  "const": "gateway"
                }
              },
              "additionalProperties": false
            }
          },
          "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
                                },
                                {
                                  "type": "object",
                                  "required": [
                                    "source",
                                    "provider",
                                    "id"
                                  ],
                                  "properties": {
                                    "source": {
                                      "type": "string",
                                      "const": "store"
                                    },
                                    "provider": {
                                      "type": "string",
                                      "pattern": "^[a-z][a-z0-9_-]{0,63}$"
                                    },
                                    "id": {
                                      "type": "string",
                                      "pattern": "^[A-Z][A-Z0-9_]{0,127}$"
                                    }
                                  },
                                  "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
                                    },
                                    {
                                      "type": "object",
                                      "required": [
                                        "source",
                                        "provider",
                                        "id"
                                      ],
                                      "properties": {
                                        "source": {
                                          "type": "string",
                                          "const": "store"
                                        },
                                        "provider": {
                                          "type": "string",
                                          "pattern": "^[a-z][a-z0-9_-]{0,63}$"
                                        },
                                        "id": {
                                          "type": "string",
                                          "pattern": "^[A-Z][A-Z0-9_]{0,127}$"
                                        }
                                      },
                                      "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
                                },
                                {
                                  "type": "object",
                                  "required": [
                                    "source",
                                    "provider",
                                    "id"
                                  ],
                                  "properties": {
                                    "source": {
                                      "type": "string",
                                      "const": "store"
                                    },
                                    "provider": {
                                      "type": "string",
                                      "pattern": "^[a-z][a-z0-9_-]{0,63}$"
                                    },
                                    "id": {
                                      "type": "string",
                                      "pattern": "^[A-Z][A-Z0-9_]{0,127}$"
                                    }
                                  },
                                  "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
    },
    "TalkSessionCancelOutputResult": {
      "type": "object",
      "required": [
        "ok"
      ],
      "properties": {
        "ok": {
          "type": "boolean",
          "const": true
        },
        "status": {
          "anyOf": [
            {
              "type": "string",
              "const": "applied"
            },
            {
              "type": "string",
              "const": "stale"
            },
            {
              "type": "string",
              "const": "idle"
            }
          ]
        },
        "turnId": {
          "type": "string",
          "minLength": 1
        }
      },
      "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
    },
    "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": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "lastError": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "healthState": {
                    "type": "string"
                  },
                  "lastStartAt": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "lastStopAt": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "lastInboundAt": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "lastOutboundAt": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "lastTransportActivityAt": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "busy": {
                    "type": "boolean"
                  },
                  "activeRuns": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "lastRunActivityAt": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "activeRunStartedAt": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "lastProbeAt": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "mode": {
                    "type": "string"
                  },
                  "dmPolicy": {
                    "type": "string"
                  },
                  "allowFrom": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "tokenSource": {
                    "type": "string"
                  },
                  "botTokenSource": {
                    "type": "string"
                  },
                  "appTokenSource": {
                    "type": "string"
                  },
                  "credentialSource": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "audienceType": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "audience": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "webhookPath": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "webhookUrl": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "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"
            },
            "degradedSinceMs": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ]
            },
            "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"
            }
          ]
        },
        "createdVia": {
          "anyOf": [
            {
              "type": "string",
              "const": "operator"
            },
            {
              "type": "string",
              "const": "agent"
            },
            {
              "type": "string",
              "const": "claw"
            }
          ]
        },
        "creatorAgentId": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "createdAt": {
          "type": "integer",
          "minimum": 0
        },
        "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"
                }
              ]
            },
            "cloudPlacementSupported": {
              "type": "boolean"
            },
            "cloudPlacementExecutionMode": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "worker-turn"
                },
                {
                  "type": "string",
                  "const": "remote-exec"
                }
              ]
            },
            "devicePlacement": {
              "type": "object",
              "required": [
                "requiredNodeCommands",
                "consumesWorkerSlot"
              ],
              "properties": {
                "requiredNodeCommands": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "maxItems": 32,
                  "uniqueItems": true
                },
                "consumesWorkerSlot": {
                  "type": "boolean"
                }
              },
              "additionalProperties": false
            },
            "devicePlacementSupported": {
              "type": "boolean"
            },
            "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
        },
        "defaultPermissionMode": {
          "anyOf": [
            {
              "type": "string",
              "const": "read-only"
            },
            {
              "type": "string",
              "const": "guarded"
            },
            {
              "type": "string",
              "const": "workspace"
            },
            {
              "type": "string",
              "const": "full"
            }
          ]
        }
      },
      "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
          }
        },
        "purgeFailed": {
          "type": "boolean",
          "const": true
        }
      },
      "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
        },
        "expiresAt": {
          "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
        },
        "ownership": {
          "anyOf": [
            {
              "type": "string",
              "const": "sole"
            },
            {
              "type": "string",
              "const": "legacy"
            },
            {
              "type": "string",
              "const": "explicit"
            }
          ]
        },
        "selectionRequired": {
          "type": "boolean"
        },
        "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"
                  }
                ]
              },
              "createdVia": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "operator"
                  },
                  {
                    "type": "string",
                    "const": "agent"
                  },
                  {
                    "type": "string",
                    "const": "claw"
                  }
                ]
              },
              "creatorAgentId": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "createdAt": {
                "type": "integer",
                "minimum": 0
              },
              "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"
                      }
                    ]
                  },
                  "cloudPlacementSupported": {
                    "type": "boolean"
                  },
                  "cloudPlacementExecutionMode": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "worker-turn"
                      },
                      {
                        "type": "string",
                        "const": "remote-exec"
                      }
                    ]
                  },
                  "devicePlacement": {
                    "type": "object",
                    "required": [
                      "requiredNodeCommands",
                      "consumesWorkerSlot"
                    ],
                    "properties": {
                      "requiredNodeCommands": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "maxItems": 32,
                        "uniqueItems": true
                      },
                      "consumesWorkerSlot": {
                        "type": "boolean"
                      }
                    },
                    "additionalProperties": false
                  },
                  "devicePlacementSupported": {
                    "type": "boolean"
                  },
                  "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
              },
              "defaultPermissionMode": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "read-only"
                  },
                  {
                    "type": "string",
                    "const": "guarded"
                  },
                  {
                    "type": "string",
                    "const": "workspace"
                  },
                  {
                    "type": "string",
                    "const": "full"
                  }
                ]
              }
            },
            "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
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "available": {
          "type": "boolean"
        },
        "unavailableReason": {
          "anyOf": [
            {
              "type": "string",
              "const": "missing-auth"
            },
            {
              "type": "string",
              "const": "auth-failed"
            },
            {
              "type": "string",
              "const": "cooldown"
            }
          ]
        },
        "unavailableUntil": {
          "type": "integer",
          "minimum": 0
        },
        "contextWindow": {
          "type": "integer",
          "minimum": 1
        },
        "contextWindows": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "label",
              "contextWindow"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "label": {
                "type": "string",
                "minLength": 1
              },
              "contextWindow": {
                "type": "integer",
                "minimum": 1
              }
            },
            "additionalProperties": false
          }
        },
        "contextWindowDefault": {
          "type": "string",
          "minLength": 1
        },
        "reasoning": {
          "type": "boolean"
        },
        "thinkingLevels": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "label"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "label": {
                "type": "string",
                "minLength": 1
              }
            },
            "additionalProperties": false
          }
        },
        "thinkingDefault": {
          "type": "string",
          "minLength": 1
        },
        "effectiveFastMode": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "string",
              "const": "auto"
            }
          ]
        },
        "supportsTools": {
          "type": "boolean"
        },
        "agentRuntime": {
          "type": "object",
          "required": [
            "id",
            "source"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            },
            "fallback": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "openclaw"
                },
                {
                  "type": "string",
                  "const": "none"
                }
              ]
            },
            "cloudPlacementSupported": {
              "type": "boolean"
            },
            "cloudPlacementExecutionMode": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "worker-turn"
                },
                {
                  "type": "string",
                  "const": "remote-exec"
                }
              ]
            },
            "devicePlacement": {
              "type": "object",
              "required": [
                "requiredNodeCommands",
                "consumesWorkerSlot"
              ],
              "properties": {
                "requiredNodeCommands": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "maxItems": 32,
                  "uniqueItems": true
                },
                "consumesWorkerSlot": {
                  "type": "boolean"
                }
              },
              "additionalProperties": false
            },
            "devicePlacementSupported": {
              "type": "boolean"
            },
            "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": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "includeProviderCapabilities": {
          "type": "boolean"
        },
        "preparedOnly": {
          "type": "boolean"
        },
        "refresh": {
          "type": "boolean"
        },
        "view": {
          "anyOf": [
            {
              "type": "string",
              "const": "default"
            },
            {
              "type": "string",
              "const": "configured"
            },
            {
              "type": "string",
              "const": "provider-config"
            },
            {
              "type": "string",
              "const": "all"
            }
          ]
        }
      },
      "additionalProperties": false,
      "not": {
        "properties": {
          "preparedOnly": {
            "const": true
          },
          "refresh": {
            "const": true
          }
        },
        "required": [
          "preparedOnly",
          "refresh"
        ]
      }
    },
    "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
              },
              "tags": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "available": {
                "type": "boolean"
              },
              "unavailableReason": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "missing-auth"
                  },
                  {
                    "type": "string",
                    "const": "auth-failed"
                  },
                  {
                    "type": "string",
                    "const": "cooldown"
                  }
                ]
              },
              "unavailableUntil": {
                "type": "integer",
                "minimum": 0
              },
              "contextWindow": {
                "type": "integer",
                "minimum": 1
              },
              "contextWindows": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "id",
                    "label",
                    "contextWindow"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "minLength": 1
                    },
                    "label": {
                      "type": "string",
                      "minLength": 1
                    },
                    "contextWindow": {
                      "type": "integer",
                      "minimum": 1
                    }
                  },
                  "additionalProperties": false
                }
              },
              "contextWindowDefault": {
                "type": "string",
                "minLength": 1
              },
              "reasoning": {
                "type": "boolean"
              },
              "thinkingLevels": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "id",
                    "label"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "minLength": 1
                    },
                    "label": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                }
              },
              "thinkingDefault": {
                "type": "string",
                "minLength": 1
              },
              "effectiveFastMode": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "string",
                    "const": "auto"
                  }
                ]
              },
              "supportsTools": {
                "type": "boolean"
              },
              "agentRuntime": {
                "type": "object",
                "required": [
                  "id",
                  "source"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "minLength": 1
                  },
                  "fallback": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "openclaw"
                      },
                      {
                        "type": "string",
                        "const": "none"
                      }
                    ]
                  },
                  "cloudPlacementSupported": {
                    "type": "boolean"
                  },
                  "cloudPlacementExecutionMode": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "worker-turn"
                      },
                      {
                        "type": "string",
                        "const": "remote-exec"
                      }
                    ]
                  },
                  "devicePlacement": {
                    "type": "object",
                    "required": [
                      "requiredNodeCommands",
                      "consumesWorkerSlot"
                    ],
                    "properties": {
                      "requiredNodeCommands": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "maxItems": 32,
                        "uniqueItems": true
                      },
                      "consumesWorkerSlot": {
                        "type": "boolean"
                      }
                    },
                    "additionalProperties": false
                  },
                  "devicePlacementSupported": {
                    "type": "boolean"
                  },
                  "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
          }
        },
        "providerOutcomes": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "provider",
              "status"
            ],
            "properties": {
              "provider": {
                "type": "string",
                "minLength": 1
              },
              "profileId": {
                "type": "string",
                "minLength": 1
              },
              "status": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "ready"
                  },
                  {
                    "type": "string",
                    "const": "auth-rejected"
                  },
                  {
                    "type": "string",
                    "const": "unavailable"
                  }
                ]
              }
            },
            "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"
            }
          ]
        },
        "skillDisplayName": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "skillModelVisible": {
          "type": "boolean"
        },
        "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
        },
        "clientPresentation": {
          "type": "object",
          "required": [
            "when",
            "action"
          ],
          "properties": {
            "when": {
              "type": "string",
              "const": "no-arguments"
            },
            "action": {
              "anyOf": [
                {
                  "type": "object",
                  "required": [
                    "kind"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "device-pairing"
                    }
                  },
                  "additionalProperties": false
                }
              ]
            }
          },
          "additionalProperties": false
        }
      },
      "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"
                  }
                ]
              },
              "skillDisplayName": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "skillModelVisible": {
                "type": "boolean"
              },
              "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
              },
              "clientPresentation": {
                "type": "object",
                "required": [
                  "when",
                  "action"
                ],
                "properties": {
                  "when": {
                    "type": "string",
                    "const": "no-arguments"
                  },
                  "action": {
                    "anyOf": [
                      {
                        "type": "object",
                        "required": [
                          "kind"
                        ],
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "device-pairing"
                          }
                        },
                        "additionalProperties": false
                      }
                    ]
                  }
                },
                "additionalProperties": false
              }
            },
            "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
    },
    "GitHubIdentitySource": {
      "anyOf": [
        {
          "type": "string",
          "const": "system-detected"
        },
        {
          "type": "string",
          "const": "system-configured"
        },
        {
          "type": "string",
          "const": "agent-override"
        }
      ]
    },
    "GitHubAuthor": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "pattern": "\\S"
        },
        "email": {
          "type": "string",
          "minLength": 1,
          "pattern": "\\S"
        }
      },
      "additionalProperties": false
    },
    "GitHubIdentityFacts": {
      "type": "object",
      "required": [
        "source",
        "credentialKind",
        "credentialState",
        "account",
        "gitAuthor",
        "evidence",
        "accessExpiresAtMs",
        "refreshState",
        "oauthScopes",
        "repositoryGrants"
      ],
      "properties": {
        "source": {
          "anyOf": [
            {
              "type": "string",
              "const": "system-detected"
            },
            {
              "type": "string",
              "const": "system-configured"
            },
            {
              "type": "string",
              "const": "agent-override"
            }
          ]
        },
        "credentialKind": {
          "anyOf": [
            {
              "type": "string",
              "const": "native"
            },
            {
              "type": "string",
              "const": "managed-pat"
            },
            {
              "type": "string",
              "const": "managed-oauth"
            }
          ]
        },
        "credentialState": {
          "anyOf": [
            {
              "type": "string",
              "const": "available"
            },
            {
              "type": "string",
              "const": "unavailable"
            },
            {
              "type": "string",
              "const": "configured_unavailable"
            },
            {
              "type": "string",
              "const": "unverified"
            },
            {
              "type": "string",
              "const": "rate_limited"
            }
          ]
        },
        "account": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "login"
              ],
              "properties": {
                "login": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        },
        "gitAuthor": {
          "type": "object",
          "required": [
            "name",
            "email"
          ],
          "properties": {
            "name": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "email": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "additionalProperties": false
        },
        "evidence": {
          "anyOf": [
            {
              "type": "string",
              "const": "github-api"
            },
            {
              "type": "string",
              "const": "none"
            },
            {
              "type": "string",
              "const": "unverified"
            },
            {
              "type": "string",
              "const": "rate-limited"
            }
          ]
        },
        "accessExpiresAtMs": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0
            },
            {
              "type": "null"
            }
          ]
        },
        "refreshState": {
          "anyOf": [
            {
              "type": "string",
              "const": "not_applicable"
            },
            {
              "type": "string",
              "const": "available"
            },
            {
              "type": "string",
              "const": "expired"
            },
            {
              "type": "string",
              "const": "unavailable"
            },
            {
              "type": "string",
              "const": "refreshing"
            },
            {
              "type": "string",
              "const": "failed"
            }
          ]
        },
        "oauthScopes": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "\\S"
          },
          "maxItems": 32
        },
        "repositoryGrants": {
          "type": "string",
          "const": "unknown"
        }
      },
      "additionalProperties": false
    },
    "GitHubIdentityScope": {
      "anyOf": [
        {
          "type": "string",
          "const": "system"
        },
        {
          "type": "string",
          "const": "agent"
        }
      ]
    },
    "GitHubSelectedIdentity": {
      "type": "object",
      "required": [
        "scope",
        "configured",
        "identity"
      ],
      "properties": {
        "scope": {
          "anyOf": [
            {
              "type": "string",
              "const": "system"
            },
            {
              "type": "string",
              "const": "agent"
            }
          ]
        },
        "configured": {
          "type": "boolean"
        },
        "identity": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "source",
                "credentialKind",
                "credentialState",
                "account",
                "gitAuthor",
                "evidence",
                "accessExpiresAtMs",
                "refreshState",
                "oauthScopes",
                "repositoryGrants"
              ],
              "properties": {
                "source": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "system-detected"
                    },
                    {
                      "type": "string",
                      "const": "system-configured"
                    },
                    {
                      "type": "string",
                      "const": "agent-override"
                    }
                  ]
                },
                "credentialKind": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "native"
                    },
                    {
                      "type": "string",
                      "const": "managed-pat"
                    },
                    {
                      "type": "string",
                      "const": "managed-oauth"
                    }
                  ]
                },
                "credentialState": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "available"
                    },
                    {
                      "type": "string",
                      "const": "unavailable"
                    },
                    {
                      "type": "string",
                      "const": "configured_unavailable"
                    },
                    {
                      "type": "string",
                      "const": "unverified"
                    },
                    {
                      "type": "string",
                      "const": "rate_limited"
                    }
                  ]
                },
                "account": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "login"
                      ],
                      "properties": {
                        "login": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "gitAuthor": {
                  "type": "object",
                  "required": [
                    "name",
                    "email"
                  ],
                  "properties": {
                    "name": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "email": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                },
                "evidence": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "github-api"
                    },
                    {
                      "type": "string",
                      "const": "none"
                    },
                    {
                      "type": "string",
                      "const": "unverified"
                    },
                    {
                      "type": "string",
                      "const": "rate-limited"
                    }
                  ]
                },
                "accessExpiresAtMs": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 0
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "refreshState": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "not_applicable"
                    },
                    {
                      "type": "string",
                      "const": "available"
                    },
                    {
                      "type": "string",
                      "const": "expired"
                    },
                    {
                      "type": "string",
                      "const": "unavailable"
                    },
                    {
                      "type": "string",
                      "const": "refreshing"
                    },
                    {
                      "type": "string",
                      "const": "failed"
                    }
                  ]
                },
                "oauthScopes": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128,
                    "pattern": "\\S"
                  },
                  "maxItems": 32
                },
                "repositoryGrants": {
                  "type": "string",
                  "const": "unknown"
                }
              },
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "ToolsGitHubStatusParams": {
      "type": "object",
      "required": [
        "agentId",
        "selectedScope"
      ],
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "selectedScope": {
          "anyOf": [
            {
              "type": "string",
              "const": "system"
            },
            {
              "type": "string",
              "const": "agent"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "ToolsGitHubStatusResult": {
      "type": "object",
      "required": [
        "agentId",
        "selectedScope",
        "selected",
        "effective"
      ],
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "selectedScope": {
          "anyOf": [
            {
              "type": "string",
              "const": "system"
            },
            {
              "type": "string",
              "const": "agent"
            }
          ]
        },
        "selected": {
          "type": "object",
          "required": [
            "scope",
            "configured",
            "identity"
          ],
          "properties": {
            "scope": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "system"
                },
                {
                  "type": "string",
                  "const": "agent"
                }
              ]
            },
            "configured": {
              "type": "boolean"
            },
            "identity": {
              "anyOf": [
                {
                  "type": "object",
                  "required": [
                    "source",
                    "credentialKind",
                    "credentialState",
                    "account",
                    "gitAuthor",
                    "evidence",
                    "accessExpiresAtMs",
                    "refreshState",
                    "oauthScopes",
                    "repositoryGrants"
                  ],
                  "properties": {
                    "source": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "system-detected"
                        },
                        {
                          "type": "string",
                          "const": "system-configured"
                        },
                        {
                          "type": "string",
                          "const": "agent-override"
                        }
                      ]
                    },
                    "credentialKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "native"
                        },
                        {
                          "type": "string",
                          "const": "managed-pat"
                        },
                        {
                          "type": "string",
                          "const": "managed-oauth"
                        }
                      ]
                    },
                    "credentialState": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "available"
                        },
                        {
                          "type": "string",
                          "const": "unavailable"
                        },
                        {
                          "type": "string",
                          "const": "configured_unavailable"
                        },
                        {
                          "type": "string",
                          "const": "unverified"
                        },
                        {
                          "type": "string",
                          "const": "rate_limited"
                        }
                      ]
                    },
                    "account": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "login"
                          ],
                          "properties": {
                            "login": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "gitAuthor": {
                      "type": "object",
                      "required": [
                        "name",
                        "email"
                      ],
                      "properties": {
                        "name": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "email": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    "evidence": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "github-api"
                        },
                        {
                          "type": "string",
                          "const": "none"
                        },
                        {
                          "type": "string",
                          "const": "unverified"
                        },
                        {
                          "type": "string",
                          "const": "rate-limited"
                        }
                      ]
                    },
                    "accessExpiresAtMs": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "refreshState": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "not_applicable"
                        },
                        {
                          "type": "string",
                          "const": "available"
                        },
                        {
                          "type": "string",
                          "const": "expired"
                        },
                        {
                          "type": "string",
                          "const": "unavailable"
                        },
                        {
                          "type": "string",
                          "const": "refreshing"
                        },
                        {
                          "type": "string",
                          "const": "failed"
                        }
                      ]
                    },
                    "oauthScopes": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128,
                        "pattern": "\\S"
                      },
                      "maxItems": 32
                    },
                    "repositoryGrants": {
                      "type": "string",
                      "const": "unknown"
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "additionalProperties": false
        },
        "effective": {
          "type": "object",
          "required": [
            "source",
            "credentialKind",
            "credentialState",
            "account",
            "gitAuthor",
            "evidence",
            "accessExpiresAtMs",
            "refreshState",
            "oauthScopes",
            "repositoryGrants"
          ],
          "properties": {
            "source": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "system-detected"
                },
                {
                  "type": "string",
                  "const": "system-configured"
                },
                {
                  "type": "string",
                  "const": "agent-override"
                }
              ]
            },
            "credentialKind": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "native"
                },
                {
                  "type": "string",
                  "const": "managed-pat"
                },
                {
                  "type": "string",
                  "const": "managed-oauth"
                }
              ]
            },
            "credentialState": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "available"
                },
                {
                  "type": "string",
                  "const": "unavailable"
                },
                {
                  "type": "string",
                  "const": "configured_unavailable"
                },
                {
                  "type": "string",
                  "const": "unverified"
                },
                {
                  "type": "string",
                  "const": "rate_limited"
                }
              ]
            },
            "account": {
              "anyOf": [
                {
                  "type": "object",
                  "required": [
                    "login"
                  ],
                  "properties": {
                    "login": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "null"
                }
              ]
            },
            "gitAuthor": {
              "type": "object",
              "required": [
                "name",
                "email"
              ],
              "properties": {
                "name": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "email": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "additionalProperties": false
            },
            "evidence": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "github-api"
                },
                {
                  "type": "string",
                  "const": "none"
                },
                {
                  "type": "string",
                  "const": "unverified"
                },
                {
                  "type": "string",
                  "const": "rate-limited"
                }
              ]
            },
            "accessExpiresAtMs": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ]
            },
            "refreshState": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "not_applicable"
                },
                {
                  "type": "string",
                  "const": "available"
                },
                {
                  "type": "string",
                  "const": "expired"
                },
                {
                  "type": "string",
                  "const": "unavailable"
                },
                {
                  "type": "string",
                  "const": "refreshing"
                },
                {
                  "type": "string",
                  "const": "failed"
                }
              ]
            },
            "oauthScopes": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128,
                "pattern": "\\S"
              },
              "maxItems": 32
            },
            "repositoryGrants": {
              "type": "string",
              "const": "unknown"
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "ToolsGitHubManagedConfigureParams": {
      "type": "object",
      "required": [
        "scope",
        "agentId",
        "mode",
        "secretName"
      ],
      "properties": {
        "scope": {
          "anyOf": [
            {
              "type": "string",
              "const": "system"
            },
            {
              "type": "string",
              "const": "agent"
            }
          ]
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "mode": {
          "type": "string",
          "const": "managed"
        },
        "secretName": {
          "type": "string",
          "pattern": "^github-setup-[a-f0-9]{32}$"
        },
        "gitAuthor": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1,
              "pattern": "\\S"
            },
            "email": {
              "type": "string",
              "minLength": 1,
              "pattern": "\\S"
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "ToolsGitHubInheritConfigureParams": {
      "type": "object",
      "required": [
        "scope",
        "agentId",
        "mode"
      ],
      "properties": {
        "scope": {
          "anyOf": [
            {
              "type": "string",
              "const": "system"
            },
            {
              "type": "string",
              "const": "agent"
            }
          ]
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "mode": {
          "type": "string",
          "const": "inherit"
        }
      },
      "additionalProperties": false
    },
    "ToolsGitHubConfigureParams": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "scope",
            "agentId",
            "mode",
            "secretName"
          ],
          "properties": {
            "scope": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "system"
                },
                {
                  "type": "string",
                  "const": "agent"
                }
              ]
            },
            "agentId": {
              "type": "string",
              "minLength": 1
            },
            "mode": {
              "type": "string",
              "const": "managed"
            },
            "secretName": {
              "type": "string",
              "pattern": "^github-setup-[a-f0-9]{32}$"
            },
            "gitAuthor": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "pattern": "\\S"
                },
                "email": {
                  "type": "string",
                  "minLength": 1,
                  "pattern": "\\S"
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "scope",
            "agentId",
            "mode"
          ],
          "properties": {
            "scope": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "system"
                },
                {
                  "type": "string",
                  "const": "agent"
                }
              ]
            },
            "agentId": {
              "type": "string",
              "minLength": 1
            },
            "mode": {
              "type": "string",
              "const": "inherit"
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "ToolsGitHubAuthorizeStartParams": {
      "type": "object",
      "required": [
        "scope",
        "agentId"
      ],
      "properties": {
        "scope": {
          "anyOf": [
            {
              "type": "string",
              "const": "system"
            },
            {
              "type": "string",
              "const": "agent"
            }
          ]
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "ToolsGitHubAuthorizeStartResult": {
      "type": "object",
      "required": [
        "requestId",
        "userCode",
        "verificationUri",
        "expiresInMs",
        "pollAfterMs"
      ],
      "properties": {
        "requestId": {
          "type": "string",
          "pattern": "^github-device-[a-f0-9]{32}$"
        },
        "userCode": {
          "type": "string",
          "pattern": "^[A-Z0-9]{4}-[A-Z0-9]{4}$"
        },
        "verificationUri": {
          "type": "string",
          "const": "https://github.com/login/device"
        },
        "expiresInMs": {
          "type": "integer",
          "minimum": 1,
          "maximum": 900000
        },
        "pollAfterMs": {
          "type": "integer",
          "minimum": 1000,
          "maximum": 60000
        }
      },
      "additionalProperties": false
    },
    "ToolsGitHubAuthorizePollParams": {
      "type": "object",
      "required": [
        "requestId"
      ],
      "properties": {
        "requestId": {
          "type": "string",
          "pattern": "^github-device-[a-f0-9]{32}$"
        }
      },
      "additionalProperties": false
    },
    "ToolsGitHubAuthorizePendingResult": {
      "type": "object",
      "required": [
        "status",
        "retryAfterMs"
      ],
      "properties": {
        "status": {
          "type": "string",
          "const": "pending"
        },
        "retryAfterMs": {
          "type": "integer",
          "minimum": 1,
          "maximum": 60000
        }
      },
      "additionalProperties": false
    },
    "ToolsGitHubAuthorizeSlowDownResult": {
      "type": "object",
      "required": [
        "status",
        "retryAfterMs"
      ],
      "properties": {
        "status": {
          "type": "string",
          "const": "slow_down"
        },
        "retryAfterMs": {
          "type": "integer",
          "minimum": 1,
          "maximum": 60000
        }
      },
      "additionalProperties": false
    },
    "ToolsGitHubAuthorizeAccessDeniedResult": {
      "type": "object",
      "required": [
        "status"
      ],
      "properties": {
        "status": {
          "type": "string",
          "const": "access_denied"
        }
      },
      "additionalProperties": false
    },
    "ToolsGitHubAuthorizeExpiredResult": {
      "type": "object",
      "required": [
        "status"
      ],
      "properties": {
        "status": {
          "type": "string",
          "const": "expired"
        }
      },
      "additionalProperties": false
    },
    "ToolsGitHubAuthorizeIncorrectDeviceCodeResult": {
      "type": "object",
      "required": [
        "status"
      ],
      "properties": {
        "status": {
          "type": "string",
          "const": "incorrect_device_code"
        }
      },
      "additionalProperties": false
    },
    "ToolsGitHubAuthorizeNetworkErrorResult": {
      "type": "object",
      "required": [
        "status",
        "retryAfterMs"
      ],
      "properties": {
        "status": {
          "type": "string",
          "const": "network_error"
        },
        "retryAfterMs": {
          "type": "integer",
          "minimum": 1,
          "maximum": 60000
        }
      },
      "additionalProperties": false
    },
    "ToolsGitHubAuthorizeFailedResult": {
      "type": "object",
      "required": [
        "status",
        "reason"
      ],
      "properties": {
        "status": {
          "type": "string",
          "const": "failed"
        },
        "reason": {
          "anyOf": [
            {
              "type": "string",
              "const": "identity_changed"
            },
            {
              "type": "string",
              "const": "setup_failed"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "ToolsGitHubAuthorizeSuccessResult": {
      "type": "object",
      "required": [
        "status",
        "githubStatus"
      ],
      "properties": {
        "status": {
          "type": "string",
          "const": "success"
        },
        "githubStatus": {
          "type": "object",
          "required": [
            "agentId",
            "selectedScope",
            "selected",
            "effective"
          ],
          "properties": {
            "agentId": {
              "type": "string",
              "minLength": 1
            },
            "selectedScope": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "system"
                },
                {
                  "type": "string",
                  "const": "agent"
                }
              ]
            },
            "selected": {
              "type": "object",
              "required": [
                "scope",
                "configured",
                "identity"
              ],
              "properties": {
                "scope": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "system"
                    },
                    {
                      "type": "string",
                      "const": "agent"
                    }
                  ]
                },
                "configured": {
                  "type": "boolean"
                },
                "identity": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "source",
                        "credentialKind",
                        "credentialState",
                        "account",
                        "gitAuthor",
                        "evidence",
                        "accessExpiresAtMs",
                        "refreshState",
                        "oauthScopes",
                        "repositoryGrants"
                      ],
                      "properties": {
                        "source": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "system-detected"
                            },
                            {
                              "type": "string",
                              "const": "system-configured"
                            },
                            {
                              "type": "string",
                              "const": "agent-override"
                            }
                          ]
                        },
                        "credentialKind": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "native"
                            },
                            {
                              "type": "string",
                              "const": "managed-pat"
                            },
                            {
                              "type": "string",
                              "const": "managed-oauth"
                            }
                          ]
                        },
                        "credentialState": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "available"
                            },
                            {
                              "type": "string",
                              "const": "unavailable"
                            },
                            {
                              "type": "string",
                              "const": "configured_unavailable"
                            },
                            {
                              "type": "string",
                              "const": "unverified"
                            },
                            {
                              "type": "string",
                              "const": "rate_limited"
                            }
                          ]
                        },
                        "account": {
                          "anyOf": [
                            {
                              "type": "object",
                              "required": [
                                "login"
                              ],
                              "properties": {
                                "login": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "gitAuthor": {
                          "type": "object",
                          "required": [
                            "name",
                            "email"
                          ],
                          "properties": {
                            "name": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "email": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        "evidence": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "github-api"
                            },
                            {
                              "type": "string",
                              "const": "none"
                            },
                            {
                              "type": "string",
                              "const": "unverified"
                            },
                            {
                              "type": "string",
                              "const": "rate-limited"
                            }
                          ]
                        },
                        "accessExpiresAtMs": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "refreshState": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "not_applicable"
                            },
                            {
                              "type": "string",
                              "const": "available"
                            },
                            {
                              "type": "string",
                              "const": "expired"
                            },
                            {
                              "type": "string",
                              "const": "unavailable"
                            },
                            {
                              "type": "string",
                              "const": "refreshing"
                            },
                            {
                              "type": "string",
                              "const": "failed"
                            }
                          ]
                        },
                        "oauthScopes": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128,
                            "pattern": "\\S"
                          },
                          "maxItems": 32
                        },
                        "repositoryGrants": {
                          "type": "string",
                          "const": "unknown"
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "additionalProperties": false
            },
            "effective": {
              "type": "object",
              "required": [
                "source",
                "credentialKind",
                "credentialState",
                "account",
                "gitAuthor",
                "evidence",
                "accessExpiresAtMs",
                "refreshState",
                "oauthScopes",
                "repositoryGrants"
              ],
              "properties": {
                "source": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "system-detected"
                    },
                    {
                      "type": "string",
                      "const": "system-configured"
                    },
                    {
                      "type": "string",
                      "const": "agent-override"
                    }
                  ]
                },
                "credentialKind": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "native"
                    },
                    {
                      "type": "string",
                      "const": "managed-pat"
                    },
                    {
                      "type": "string",
                      "const": "managed-oauth"
                    }
                  ]
                },
                "credentialState": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "available"
                    },
                    {
                      "type": "string",
                      "const": "unavailable"
                    },
                    {
                      "type": "string",
                      "const": "configured_unavailable"
                    },
                    {
                      "type": "string",
                      "const": "unverified"
                    },
                    {
                      "type": "string",
                      "const": "rate_limited"
                    }
                  ]
                },
                "account": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "login"
                      ],
                      "properties": {
                        "login": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "gitAuthor": {
                  "type": "object",
                  "required": [
                    "name",
                    "email"
                  ],
                  "properties": {
                    "name": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "email": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                },
                "evidence": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "github-api"
                    },
                    {
                      "type": "string",
                      "const": "none"
                    },
                    {
                      "type": "string",
                      "const": "unverified"
                    },
                    {
                      "type": "string",
                      "const": "rate-limited"
                    }
                  ]
                },
                "accessExpiresAtMs": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 0
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "refreshState": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "not_applicable"
                    },
                    {
                      "type": "string",
                      "const": "available"
                    },
                    {
                      "type": "string",
                      "const": "expired"
                    },
                    {
                      "type": "string",
                      "const": "unavailable"
                    },
                    {
                      "type": "string",
                      "const": "refreshing"
                    },
                    {
                      "type": "string",
                      "const": "failed"
                    }
                  ]
                },
                "oauthScopes": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128,
                    "pattern": "\\S"
                  },
                  "maxItems": 32
                },
                "repositoryGrants": {
                  "type": "string",
                  "const": "unknown"
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "ToolsGitHubAuthorizePollResult": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "status",
            "retryAfterMs"
          ],
          "properties": {
            "status": {
              "type": "string",
              "const": "pending"
            },
            "retryAfterMs": {
              "type": "integer",
              "minimum": 1,
              "maximum": 60000
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "status",
            "retryAfterMs"
          ],
          "properties": {
            "status": {
              "type": "string",
              "const": "slow_down"
            },
            "retryAfterMs": {
              "type": "integer",
              "minimum": 1,
              "maximum": 60000
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "status"
          ],
          "properties": {
            "status": {
              "type": "string",
              "const": "access_denied"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "status"
          ],
          "properties": {
            "status": {
              "type": "string",
              "const": "expired"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "status"
          ],
          "properties": {
            "status": {
              "type": "string",
              "const": "incorrect_device_code"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "status",
            "retryAfterMs"
          ],
          "properties": {
            "status": {
              "type": "string",
              "const": "network_error"
            },
            "retryAfterMs": {
              "type": "integer",
              "minimum": 1,
              "maximum": 60000
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "status",
            "reason"
          ],
          "properties": {
            "status": {
              "type": "string",
              "const": "failed"
            },
            "reason": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "identity_changed"
                },
                {
                  "type": "string",
                  "const": "setup_failed"
                }
              ]
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "status",
            "githubStatus"
          ],
          "properties": {
            "status": {
              "type": "string",
              "const": "success"
            },
            "githubStatus": {
              "type": "object",
              "required": [
                "agentId",
                "selectedScope",
                "selected",
                "effective"
              ],
              "properties": {
                "agentId": {
                  "type": "string",
                  "minLength": 1
                },
                "selectedScope": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "system"
                    },
                    {
                      "type": "string",
                      "const": "agent"
                    }
                  ]
                },
                "selected": {
                  "type": "object",
                  "required": [
                    "scope",
                    "configured",
                    "identity"
                  ],
                  "properties": {
                    "scope": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "system"
                        },
                        {
                          "type": "string",
                          "const": "agent"
                        }
                      ]
                    },
                    "configured": {
                      "type": "boolean"
                    },
                    "identity": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "source",
                            "credentialKind",
                            "credentialState",
                            "account",
                            "gitAuthor",
                            "evidence",
                            "accessExpiresAtMs",
                            "refreshState",
                            "oauthScopes",
                            "repositoryGrants"
                          ],
                          "properties": {
                            "source": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "system-detected"
                                },
                                {
                                  "type": "string",
                                  "const": "system-configured"
                                },
                                {
                                  "type": "string",
                                  "const": "agent-override"
                                }
                              ]
                            },
                            "credentialKind": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "native"
                                },
                                {
                                  "type": "string",
                                  "const": "managed-pat"
                                },
                                {
                                  "type": "string",
                                  "const": "managed-oauth"
                                }
                              ]
                            },
                            "credentialState": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "available"
                                },
                                {
                                  "type": "string",
                                  "const": "unavailable"
                                },
                                {
                                  "type": "string",
                                  "const": "configured_unavailable"
                                },
                                {
                                  "type": "string",
                                  "const": "unverified"
                                },
                                {
                                  "type": "string",
                                  "const": "rate_limited"
                                }
                              ]
                            },
                            "account": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "required": [
                                    "login"
                                  ],
                                  "properties": {
                                    "login": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "gitAuthor": {
                              "type": "object",
                              "required": [
                                "name",
                                "email"
                              ],
                              "properties": {
                                "name": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "email": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            "evidence": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "github-api"
                                },
                                {
                                  "type": "string",
                                  "const": "none"
                                },
                                {
                                  "type": "string",
                                  "const": "unverified"
                                },
                                {
                                  "type": "string",
                                  "const": "rate-limited"
                                }
                              ]
                            },
                            "accessExpiresAtMs": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "refreshState": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "not_applicable"
                                },
                                {
                                  "type": "string",
                                  "const": "available"
                                },
                                {
                                  "type": "string",
                                  "const": "expired"
                                },
                                {
                                  "type": "string",
                                  "const": "unavailable"
                                },
                                {
                                  "type": "string",
                                  "const": "refreshing"
                                },
                                {
                                  "type": "string",
                                  "const": "failed"
                                }
                              ]
                            },
                            "oauthScopes": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 128,
                                "pattern": "\\S"
                              },
                              "maxItems": 32
                            },
                            "repositoryGrants": {
                              "type": "string",
                              "const": "unknown"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                },
                "effective": {
                  "type": "object",
                  "required": [
                    "source",
                    "credentialKind",
                    "credentialState",
                    "account",
                    "gitAuthor",
                    "evidence",
                    "accessExpiresAtMs",
                    "refreshState",
                    "oauthScopes",
                    "repositoryGrants"
                  ],
                  "properties": {
                    "source": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "system-detected"
                        },
                        {
                          "type": "string",
                          "const": "system-configured"
                        },
                        {
                          "type": "string",
                          "const": "agent-override"
                        }
                      ]
                    },
                    "credentialKind": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "native"
                        },
                        {
                          "type": "string",
                          "const": "managed-pat"
                        },
                        {
                          "type": "string",
                          "const": "managed-oauth"
                        }
                      ]
                    },
                    "credentialState": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "available"
                        },
                        {
                          "type": "string",
                          "const": "unavailable"
                        },
                        {
                          "type": "string",
                          "const": "configured_unavailable"
                        },
                        {
                          "type": "string",
                          "const": "unverified"
                        },
                        {
                          "type": "string",
                          "const": "rate_limited"
                        }
                      ]
                    },
                    "account": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "login"
                          ],
                          "properties": {
                            "login": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "gitAuthor": {
                      "type": "object",
                      "required": [
                        "name",
                        "email"
                      ],
                      "properties": {
                        "name": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "email": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    "evidence": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "github-api"
                        },
                        {
                          "type": "string",
                          "const": "none"
                        },
                        {
                          "type": "string",
                          "const": "unverified"
                        },
                        {
                          "type": "string",
                          "const": "rate-limited"
                        }
                      ]
                    },
                    "accessExpiresAtMs": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "refreshState": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "not_applicable"
                        },
                        {
                          "type": "string",
                          "const": "available"
                        },
                        {
                          "type": "string",
                          "const": "expired"
                        },
                        {
                          "type": "string",
                          "const": "unavailable"
                        },
                        {
                          "type": "string",
                          "const": "refreshing"
                        },
                        {
                          "type": "string",
                          "const": "failed"
                        }
                      ]
                    },
                    "oauthScopes": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128,
                        "pattern": "\\S"
                      },
                      "maxItems": 32
                    },
                    "repositoryGrants": {
                      "type": "string",
                      "const": "unknown"
                    }
                  },
                  "additionalProperties": false
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "ToolsGitHubAuthorizeCancelParams": {
      "type": "object",
      "required": [
        "requestId"
      ],
      "properties": {
        "requestId": {
          "type": "string",
          "pattern": "^github-device-[a-f0-9]{32}$"
        }
      },
      "additionalProperties": false
    },
    "ToolsGitHubAuthorizeCancelResult": {
      "type": "object",
      "required": [
        "cancelled"
      ],
      "properties": {
        "cancelled": {
          "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
        },
        "mcpServer": {
          "type": "string",
          "minLength": 1
        },
        "mcpToolName": {
          "type": "string",
          "minLength": 1
        },
        "deniedBySession": {
          "type": "boolean",
          "const": true
        },
        "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
              },
              "mcpServer": {
                "type": "string",
                "minLength": 1
              },
              "mcpToolName": {
                "type": "string",
                "minLength": 1
              },
              "deniedBySession": {
                "type": "boolean",
                "const": true
              },
              "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"
        },
        "servers": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "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
                    },
                    "mcpServer": {
                      "type": "string",
                      "minLength": 1
                    },
                    "mcpToolName": {
                      "type": "string",
                      "minLength": 1
                    },
                    "deniedBySession": {
                      "type": "boolean",
                      "const": true
                    },
                    "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"
              },
              "servers": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                }
              }
            },
            "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",
              "installRef",
              "displayName"
            ],
            "properties": {
              "score": {
                "type": "number"
              },
              "slug": {
                "type": "string",
                "minLength": 1
              },
              "installRef": {
                "type": "string",
                "minLength": 1,
                "description": "Source-qualified reference for this result. Send it as `slug` to skills.install; several publishers can share one slug."
              },
              "installOnly": {
                "type": "boolean",
                "const": true,
                "description": "Present when ClawHub serves this result install-only: offer install directly with `installRef`, because skills.detail cannot answer for it. Absence means the ordinary review-then-install flow, so results from servers that predate this field keep their existing behavior."
              },
              "trustState": {
                "type": "string",
                "const": "not-scanned-by-clawhub",
                "description": "Present when ClawHub resolves this result from a source it has not scanned."
              },
              "displayName": {
                "type": "string",
                "minLength": 1
              },
              "summary": {
                "type": "string"
              },
              "icon": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "version": {
                "type": "string",
                "minLength": 1
              },
              "updatedAt": {
                "type": "integer"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "SkillsDetailParams": {
      "type": "object",
      "required": [
        "slug"
      ],
      "properties": {
        "slug": {
          "type": "string",
          "minLength": 1,
          "description": "ClawHub skill reference: `@owner/slug`, `skills-sh:owner/repo/slug`, or a bare `slug` when no publisher is known."
        }
      },
      "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"
            }
          ]
        },
        "collectionReview": {
          "type": "object",
          "patternProperties": {
            "^.*$": {
              "type": "object",
              "required": [
                "attemptedAtMs"
              ],
              "properties": {
                "attemptedAtMs": {
                  "type": "number"
                },
                "succeededAtMs": {
                  "type": "number"
                },
                "error": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            }
          }
        },
        "experienceReview": {
          "type": "object",
          "patternProperties": {
            "^.*$": {
              "type": "object",
              "required": [
                "attemptedAtMs",
                "outcome"
              ],
              "properties": {
                "attemptedAtMs": {
                  "type": "number"
                },
                "outcome": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "applied"
                    },
                    {
                      "type": "string",
                      "const": "proposed"
                    },
                    {
                      "type": "string",
                      "const": "nothing"
                    },
                    {
                      "type": "string",
                      "const": "failed"
                    }
                  ]
                },
                "proposalId": {
                  "type": "string"
                },
                "error": {
                  "type": "string"
                },
                "usage": {
                  "type": "object",
                  "required": [
                    "inputTokens",
                    "cachedInputTokens",
                    "outputTokens"
                  ],
                  "properties": {
                    "inputTokens": {
                      "type": "number"
                    },
                    "cachedInputTokens": {
                      "type": "number"
                    },
                    "outputTokens": {
                      "type": "number"
                    }
                  },
                  "additionalProperties": false
                }
              },
              "additionalProperties": false
            }
          }
        },
        "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
    },
    "SkillsProposalEvaluateParams": {
      "type": "object",
      "required": [
        "proposalId"
      ],
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "proposalId": {
          "type": "string",
          "minLength": 1
        },
        "expectedRevisionHash": {
          "type": "string",
          "minLength": 64,
          "maxLength": 64,
          "pattern": "^[a-fA-F0-9]{64}$"
        },
        "correlationId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        }
      },
      "additionalProperties": false
    },
    "SkillsProposalEvaluateResult": {
      "type": "object",
      "required": [
        "record",
        "evaluation"
      ],
      "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"
            },
            "evaluation": {
              "type": "object",
              "required": [
                "id",
                "proposedVersion",
                "revisionHash",
                "trigger",
                "startedAt",
                "completedAt",
                "outcomes"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1
                },
                "proposedVersion": {
                  "type": "string",
                  "minLength": 1
                },
                "revisionHash": {
                  "type": "string",
                  "minLength": 64,
                  "maxLength": 64,
                  "pattern": "^[a-fA-F0-9]{64}$"
                },
                "trigger": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "manual"
                    },
                    {
                      "type": "string",
                      "const": "apply"
                    }
                  ]
                },
                "startedAt": {
                  "type": "string",
                  "minLength": 1
                },
                "completedAt": {
                  "type": "string",
                  "minLength": 1
                },
                "correlationId": {
                  "type": "string",
                  "minLength": 1
                },
                "targetTreeSha256": {
                  "type": "string",
                  "minLength": 64,
                  "maxLength": 64,
                  "pattern": "^[a-fA-F0-9]{64}$"
                },
                "outcomes": {
                  "type": "array",
                  "items": {
                    "anyOf": [
                      {
                        "type": "object",
                        "required": [
                          "pluginId",
                          "evaluatorId",
                          "status",
                          "result"
                        ],
                        "properties": {
                          "pluginId": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          },
                          "pluginVersion": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          },
                          "evaluatorId": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          },
                          "status": {
                            "type": "string",
                            "const": "completed"
                          },
                          "result": {
                            "type": "object",
                            "properties": {
                              "summary": {
                                "type": "string",
                                "maxLength": 8000
                              },
                              "findings": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "required": [
                                    "ruleId",
                                    "severity",
                                    "message"
                                  ],
                                  "properties": {
                                    "ruleId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 256
                                    },
                                    "severity": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "const": "info"
                                        },
                                        {
                                          "type": "string",
                                          "const": "warn"
                                        },
                                        {
                                          "type": "string",
                                          "const": "critical"
                                        }
                                      ]
                                    },
                                    "message": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 4000
                                    },
                                    "file": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 1024
                                    },
                                    "line": {
                                      "type": "integer",
                                      "minimum": 1
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "maxItems": 200
                              },
                              "metrics": {
                                "type": "object",
                                "patternProperties": {
                                  "^.*$": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "maxLength": 4000
                                      },
                                      {
                                        "type": "number"
                                      },
                                      {
                                        "type": "boolean"
                                      }
                                    ]
                                  }
                                },
                                "maxProperties": 64,
                                "propertyNames": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                }
                              },
                              "evaluatorVersion": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 128
                              },
                              "mode": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 128
                              },
                              "decision": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "const": "pass"
                                  },
                                  {
                                    "type": "string",
                                    "const": "revise"
                                  },
                                  {
                                    "type": "string",
                                    "const": "block"
                                  }
                                ]
                              },
                              "decisionReason": {
                                "type": "string",
                                "maxLength": 2000
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "required": [
                          "pluginId",
                          "evaluatorId",
                          "status"
                        ],
                        "properties": {
                          "pluginId": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          },
                          "pluginVersion": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          },
                          "evaluatorId": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          },
                          "status": {
                            "type": "string",
                            "const": "skipped"
                          }
                        },
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "required": [
                          "pluginId",
                          "evaluatorId",
                          "status",
                          "error"
                        ],
                        "properties": {
                          "pluginId": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          },
                          "pluginVersion": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          },
                          "evaluatorId": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          },
                          "status": {
                            "type": "string",
                            "const": "error"
                          },
                          "error": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 2000
                          }
                        },
                        "additionalProperties": false
                      }
                    ]
                  },
                  "maxItems": 64
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        "evaluation": {
          "type": "object",
          "required": [
            "id",
            "proposedVersion",
            "revisionHash",
            "trigger",
            "startedAt",
            "completedAt",
            "outcomes"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            },
            "proposedVersion": {
              "type": "string",
              "minLength": 1
            },
            "revisionHash": {
              "type": "string",
              "minLength": 64,
              "maxLength": 64,
              "pattern": "^[a-fA-F0-9]{64}$"
            },
            "trigger": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "manual"
                },
                {
                  "type": "string",
                  "const": "apply"
                }
              ]
            },
            "startedAt": {
              "type": "string",
              "minLength": 1
            },
            "completedAt": {
              "type": "string",
              "minLength": 1
            },
            "correlationId": {
              "type": "string",
              "minLength": 1
            },
            "targetTreeSha256": {
              "type": "string",
              "minLength": 64,
              "maxLength": 64,
              "pattern": "^[a-fA-F0-9]{64}$"
            },
            "outcomes": {
              "type": "array",
              "items": {
                "anyOf": [
                  {
                    "type": "object",
                    "required": [
                      "pluginId",
                      "evaluatorId",
                      "status",
                      "result"
                    ],
                    "properties": {
                      "pluginId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128
                      },
                      "pluginVersion": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128
                      },
                      "evaluatorId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128
                      },
                      "status": {
                        "type": "string",
                        "const": "completed"
                      },
                      "result": {
                        "type": "object",
                        "properties": {
                          "summary": {
                            "type": "string",
                            "maxLength": 8000
                          },
                          "findings": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "ruleId",
                                "severity",
                                "message"
                              ],
                              "properties": {
                                "ruleId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 256
                                },
                                "severity": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "info"
                                    },
                                    {
                                      "type": "string",
                                      "const": "warn"
                                    },
                                    {
                                      "type": "string",
                                      "const": "critical"
                                    }
                                  ]
                                },
                                "message": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 4000
                                },
                                "file": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 1024
                                },
                                "line": {
                                  "type": "integer",
                                  "minimum": 1
                                }
                              },
                              "additionalProperties": false
                            },
                            "maxItems": 200
                          },
                          "metrics": {
                            "type": "object",
                            "patternProperties": {
                              "^.*$": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "maxLength": 4000
                                  },
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "boolean"
                                  }
                                ]
                              }
                            },
                            "maxProperties": 64,
                            "propertyNames": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            }
                          },
                          "evaluatorVersion": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          },
                          "mode": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          },
                          "decision": {
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "pass"
                              },
                              {
                                "type": "string",
                                "const": "revise"
                              },
                              {
                                "type": "string",
                                "const": "block"
                              }
                            ]
                          },
                          "decisionReason": {
                            "type": "string",
                            "maxLength": 2000
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "required": [
                      "pluginId",
                      "evaluatorId",
                      "status"
                    ],
                    "properties": {
                      "pluginId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128
                      },
                      "pluginVersion": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128
                      },
                      "evaluatorId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128
                      },
                      "status": {
                        "type": "string",
                        "const": "skipped"
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "required": [
                      "pluginId",
                      "evaluatorId",
                      "status",
                      "error"
                    ],
                    "properties": {
                      "pluginId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128
                      },
                      "pluginVersion": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128
                      },
                      "evaluatorId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128
                      },
                      "status": {
                        "type": "string",
                        "const": "error"
                      },
                      "error": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 2000
                      }
                    },
                    "additionalProperties": false
                  }
                ]
              },
              "maxItems": 64
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "SkillsProposalEventsListParams": {
      "type": "object",
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "proposalId": {
          "type": "string",
          "minLength": 1
        },
        "afterSequence": {
          "type": "integer",
          "minimum": 0
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 200
        }
      },
      "additionalProperties": false
    },
    "SkillsProposalEventsListResult": {
      "type": "object",
      "required": [
        "events"
      ],
      "properties": {
        "events": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "sequence",
              "eventId",
              "proposalId",
              "proposedVersion",
              "revisionHash",
              "type",
              "occurredAt",
              "actor"
            ],
            "properties": {
              "sequence": {
                "type": "integer",
                "minimum": 1
              },
              "eventId": {
                "type": "string",
                "minLength": 1
              },
              "proposalId": {
                "type": "string",
                "minLength": 1
              },
              "proposedVersion": {
                "type": "string",
                "minLength": 1
              },
              "revisionHash": {
                "type": "string",
                "minLength": 64,
                "maxLength": 64,
                "pattern": "^[a-fA-F0-9]{64}$"
              },
              "type": {
                "anyOf": [
                  {
                    "type": "string",
                    "const": "created"
                  },
                  {
                    "type": "string",
                    "const": "revised"
                  },
                  {
                    "type": "string",
                    "const": "evaluation_completed"
                  },
                  {
                    "type": "string",
                    "const": "applied"
                  },
                  {
                    "type": "string",
                    "const": "rejected"
                  },
                  {
                    "type": "string",
                    "const": "quarantined"
                  },
                  {
                    "type": "string",
                    "const": "stale"
                  }
                ]
              },
              "occurredAt": {
                "type": "string",
                "minLength": 1
              },
              "actor": {
                "type": "object",
                "required": [
                  "type"
                ],
                "properties": {
                  "type": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "agent"
                      },
                      {
                        "type": "string",
                        "const": "gateway"
                      },
                      {
                        "type": "string",
                        "const": "plugin"
                      },
                      {
                        "type": "string",
                        "const": "system"
                      }
                    ]
                  },
                  "id": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "additionalProperties": false
              },
              "correlationId": {
                "type": "string",
                "minLength": 1
              },
              "payload": {
                "type": "object",
                "patternProperties": {
                  "^.*$": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 4000
                      },
                      {
                        "type": "number"
                      },
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "maxProperties": 32,
                "propertyNames": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                }
              },
              "evaluation": {
                "type": "object",
                "required": [
                  "id",
                  "proposedVersion",
                  "revisionHash",
                  "trigger",
                  "startedAt",
                  "completedAt",
                  "outcomes"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "minLength": 1
                  },
                  "proposedVersion": {
                    "type": "string",
                    "minLength": 1
                  },
                  "revisionHash": {
                    "type": "string",
                    "minLength": 64,
                    "maxLength": 64,
                    "pattern": "^[a-fA-F0-9]{64}$"
                  },
                  "trigger": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "manual"
                      },
                      {
                        "type": "string",
                        "const": "apply"
                      }
                    ]
                  },
                  "startedAt": {
                    "type": "string",
                    "minLength": 1
                  },
                  "completedAt": {
                    "type": "string",
                    "minLength": 1
                  },
                  "correlationId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "targetTreeSha256": {
                    "type": "string",
                    "minLength": 64,
                    "maxLength": 64,
                    "pattern": "^[a-fA-F0-9]{64}$"
                  },
                  "outcomes": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "pluginId",
                            "evaluatorId",
                            "status",
                            "result"
                          ],
                          "properties": {
                            "pluginId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "pluginVersion": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "evaluatorId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "status": {
                              "type": "string",
                              "const": "completed"
                            },
                            "result": {
                              "type": "object",
                              "properties": {
                                "summary": {
                                  "type": "string",
                                  "maxLength": 8000
                                },
                                "findings": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "required": [
                                      "ruleId",
                                      "severity",
                                      "message"
                                    ],
                                    "properties": {
                                      "ruleId": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 256
                                      },
                                      "severity": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "const": "info"
                                          },
                                          {
                                            "type": "string",
                                            "const": "warn"
                                          },
                                          {
                                            "type": "string",
                                            "const": "critical"
                                          }
                                        ]
                                      },
                                      "message": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 4000
                                      },
                                      "file": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 1024
                                      },
                                      "line": {
                                        "type": "integer",
                                        "minimum": 1
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "maxItems": 200
                                },
                                "metrics": {
                                  "type": "object",
                                  "patternProperties": {
                                    "^.*$": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "maxLength": 4000
                                        },
                                        {
                                          "type": "number"
                                        },
                                        {
                                          "type": "boolean"
                                        }
                                      ]
                                    }
                                  },
                                  "maxProperties": 64,
                                  "propertyNames": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  }
                                },
                                "evaluatorVersion": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "mode": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "decision": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "pass"
                                    },
                                    {
                                      "type": "string",
                                      "const": "revise"
                                    },
                                    {
                                      "type": "string",
                                      "const": "block"
                                    }
                                  ]
                                },
                                "decisionReason": {
                                  "type": "string",
                                  "maxLength": 2000
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "pluginId",
                            "evaluatorId",
                            "status"
                          ],
                          "properties": {
                            "pluginId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "pluginVersion": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "evaluatorId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "status": {
                              "type": "string",
                              "const": "skipped"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "pluginId",
                            "evaluatorId",
                            "status",
                            "error"
                          ],
                          "properties": {
                            "pluginId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "pluginVersion": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "evaluatorId": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "status": {
                              "type": "string",
                              "const": "error"
                            },
                            "error": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 2000
                            }
                          },
                          "additionalProperties": false
                        }
                      ]
                    },
                    "maxItems": 64
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "maxItems": 200
        },
        "nextSequence": {
          "type": "integer",
          "minimum": 1
        }
      },
      "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"
            },
            "evaluation": {
              "type": "object",
              "required": [
                "id",
                "proposedVersion",
                "revisionHash",
                "trigger",
                "startedAt",
                "completedAt",
                "outcomes"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1
                },
                "proposedVersion": {
                  "type": "string",
                  "minLength": 1
                },
                "revisionHash": {
                  "type": "string",
                  "minLength": 64,
                  "maxLength": 64,
                  "pattern": "^[a-fA-F0-9]{64}$"
                },
                "trigger": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "manual"
                    },
                    {
                      "type": "string",
                      "const": "apply"
                    }
                  ]
                },
                "startedAt": {
                  "type": "string",
                  "minLength": 1
                },
                "completedAt": {
                  "type": "string",
                  "minLength": 1
                },
                "correlationId": {
                  "type": "string",
                  "minLength": 1
                },
                "targetTreeSha256": {
                  "type": "string",
                  "minLength": 64,
                  "maxLength": 64,
                  "pattern": "^[a-fA-F0-9]{64}$"
                },
                "outcomes": {
                  "type": "array",
                  "items": {
                    "anyOf": [
                      {
                        "type": "object",
                        "required": [
                          "pluginId",
                          "evaluatorId",
                          "status",
                          "result"
                        ],
                        "properties": {
                          "pluginId": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          },
                          "pluginVersion": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          },
                          "evaluatorId": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          },
                          "status": {
                            "type": "string",
                            "const": "completed"
                          },
                          "result": {
                            "type": "object",
                            "properties": {
                              "summary": {
                                "type": "string",
                                "maxLength": 8000
                              },
                              "findings": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "required": [
                                    "ruleId",
                                    "severity",
                                    "message"
                                  ],
                                  "properties": {
                                    "ruleId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 256
                                    },
                                    "severity": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "const": "info"
                                        },
                                        {
                                          "type": "string",
                                          "const": "warn"
                                        },
                                        {
                                          "type": "string",
                                          "const": "critical"
                                        }
                                      ]
                                    },
                                    "message": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 4000
                                    },
                                    "file": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 1024
                                    },
                                    "line": {
                                      "type": "integer",
                                      "minimum": 1
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "maxItems": 200
                              },
                              "metrics": {
                                "type": "object",
                                "patternProperties": {
                                  "^.*$": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "maxLength": 4000
                                      },
                                      {
                                        "type": "number"
                                      },
                                      {
                                        "type": "boolean"
                                      }
                                    ]
                                  }
                                },
                                "maxProperties": 64,
                                "propertyNames": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                }
                              },
                              "evaluatorVersion": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 128
                              },
                              "mode": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 128
                              },
                              "decision": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "const": "pass"
                                  },
                                  {
                                    "type": "string",
                                    "const": "revise"
                                  },
                                  {
                                    "type": "string",
                                    "const": "block"
                                  }
                                ]
                              },
                              "decisionReason": {
                                "type": "string",
                                "maxLength": 2000
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "required": [
                          "pluginId",
                          "evaluatorId",
                          "status"
                        ],
                        "properties": {
                          "pluginId": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          },
                          "pluginVersion": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          },
                          "evaluatorId": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          },
                          "status": {
                            "type": "string",
                            "const": "skipped"
                          }
                        },
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "required": [
                          "pluginId",
                          "evaluatorId",
                          "status",
                          "error"
                        ],
                        "properties": {
                          "pluginId": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          },
                          "pluginVersion": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          },
                          "evaluatorId": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          },
                          "status": {
                            "type": "string",
                            "const": "error"
                          },
                          "error": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 2000
                          }
                        },
                        "additionalProperties": false
                      }
                    ]
                  },
                  "maxItems": 64
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        "revisionHash": {
          "type": "string",
          "minLength": 64,
          "maxLength": 64,
          "pattern": "^[a-fA-F0-9]{64}$"
        },
        "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"
      ],
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "proposalId": {
          "type": "string",
          "minLength": 1
        },
        "expectedRevisionHash": {
          "type": "string",
          "minLength": 64,
          "maxLength": 64,
          "pattern": "^[a-fA-F0-9]{64}$"
        },
        "correlationId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "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",
        "expectedRevisionHash",
        "instructions",
        "sessionKey",
        "idempotencyKey"
      ],
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "targetAgentId": {
          "type": "string",
          "minLength": 1
        },
        "proposalId": {
          "type": "string",
          "minLength": 1
        },
        "expectedRevisionHash": {
          "type": "string",
          "minLength": 64,
          "maxLength": 64,
          "pattern": "^[a-fA-F0-9]{64}$"
        },
        "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
    },
    "SkillsProposalDecisionParams": {
      "type": "object",
      "required": [
        "proposalId",
        "expectedRevisionHash"
      ],
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "proposalId": {
          "type": "string",
          "minLength": 1
        },
        "expectedRevisionHash": {
          "type": "string",
          "minLength": 64,
          "maxLength": 64,
          "pattern": "^[a-fA-F0-9]{64}$"
        },
        "correlationId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "reason": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "SkillsProposalActionParams": {
      "type": "object",
      "required": [
        "proposalId"
      ],
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "proposalId": {
          "type": "string",
          "minLength": 1
        },
        "expectedRevisionHash": {
          "type": "string",
          "minLength": 64,
          "maxLength": 64,
          "pattern": "^[a-fA-F0-9]{64}$"
        },
        "correlationId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "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"
            },
            "evaluation": {
              "type": "object",
              "required": [
                "id",
                "proposedVersion",
                "revisionHash",
                "trigger",
                "startedAt",
                "completedAt",
                "outcomes"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1
                },
                "proposedVersion": {
                  "type": "string",
                  "minLength": 1
                },
                "revisionHash": {
                  "type": "string",
                  "minLength": 64,
                  "maxLength": 64,
                  "pattern": "^[a-fA-F0-9]{64}$"
                },
                "trigger": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "manual"
                    },
                    {
                      "type": "string",
                      "const": "apply"
                    }
                  ]
                },
                "startedAt": {
                  "type": "string",
                  "minLength": 1
                },
                "completedAt": {
                  "type": "string",
                  "minLength": 1
                },
                "correlationId": {
                  "type": "string",
                  "minLength": 1
                },
                "targetTreeSha256": {
                  "type": "string",
                  "minLength": 64,
                  "maxLength": 64,
                  "pattern": "^[a-fA-F0-9]{64}$"
                },
                "outcomes": {
                  "type": "array",
                  "items": {
                    "anyOf": [
                      {
                        "type": "object",
                        "required": [
                          "pluginId",
                          "evaluatorId",
                          "status",
                          "result"
                        ],
                        "properties": {
                          "pluginId": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          },
                          "pluginVersion": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          },
                          "evaluatorId": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          },
                          "status": {
                            "type": "string",
                            "const": "completed"
                          },
                          "result": {
                            "type": "object",
                            "properties": {
                              "summary": {
                                "type": "string",
                                "maxLength": 8000
                              },
                              "findings": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "required": [
                                    "ruleId",
                                    "severity",
                                    "message"
                                  ],
                                  "properties": {
                                    "ruleId": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 256
                                    },
                                    "severity": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "const": "info"
                                        },
                                        {
                                          "type": "string",
                                          "const": "warn"
                                        },
                                        {
                                          "type": "string",
                                          "const": "critical"
                                        }
                                      ]
                                    },
                                    "message": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 4000
                                    },
                                    "file": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 1024
                                    },
                                    "line": {
                                      "type": "integer",
                                      "minimum": 1
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "maxItems": 200
                              },
                              "metrics": {
                                "type": "object",
                                "patternProperties": {
                                  "^.*$": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "maxLength": 4000
                                      },
                                      {
                                        "type": "number"
                                      },
                                      {
                                        "type": "boolean"
                                      }
                                    ]
                                  }
                                },
                                "maxProperties": 64,
                                "propertyNames": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                }
                              },
                              "evaluatorVersion": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 128
                              },
                              "mode": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 128
                              },
                              "decision": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "const": "pass"
                                  },
                                  {
                                    "type": "string",
                                    "const": "revise"
                                  },
                                  {
                                    "type": "string",
                                    "const": "block"
                                  }
                                ]
                              },
                              "decisionReason": {
                                "type": "string",
                                "maxLength": 2000
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "required": [
                          "pluginId",
                          "evaluatorId",
                          "status"
                        ],
                        "properties": {
                          "pluginId": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          },
                          "pluginVersion": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          },
                          "evaluatorId": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          },
                          "status": {
                            "type": "string",
                            "const": "skipped"
                          }
                        },
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "required": [
                          "pluginId",
                          "evaluatorId",
                          "status",
                          "error"
                        ],
                        "properties": {
                          "pluginId": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          },
                          "pluginVersion": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          },
                          "evaluatorId": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          },
                          "status": {
                            "type": "string",
                            "const": "error"
                          },
                          "error": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 2000
                          }
                        },
                        "additionalProperties": false
                      }
                    ]
                  },
                  "maxItems": 64
                }
              },
              "additionalProperties": false
            }
          },
          "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"
        },
        "evaluation": {
          "type": "object",
          "required": [
            "id",
            "proposedVersion",
            "revisionHash",
            "trigger",
            "startedAt",
            "completedAt",
            "outcomes"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            },
            "proposedVersion": {
              "type": "string",
              "minLength": 1
            },
            "revisionHash": {
              "type": "string",
              "minLength": 64,
              "maxLength": 64,
              "pattern": "^[a-fA-F0-9]{64}$"
            },
            "trigger": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "manual"
                },
                {
                  "type": "string",
                  "const": "apply"
                }
              ]
            },
            "startedAt": {
              "type": "string",
              "minLength": 1
            },
            "completedAt": {
              "type": "string",
              "minLength": 1
            },
            "correlationId": {
              "type": "string",
              "minLength": 1
            },
            "targetTreeSha256": {
              "type": "string",
              "minLength": 64,
              "maxLength": 64,
              "pattern": "^[a-fA-F0-9]{64}$"
            },
            "outcomes": {
              "type": "array",
              "items": {
                "anyOf": [
                  {
                    "type": "object",
                    "required": [
                      "pluginId",
                      "evaluatorId",
                      "status",
                      "result"
                    ],
                    "properties": {
                      "pluginId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128
                      },
                      "pluginVersion": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128
                      },
                      "evaluatorId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128
                      },
                      "status": {
                        "type": "string",
                        "const": "completed"
                      },
                      "result": {
                        "type": "object",
                        "properties": {
                          "summary": {
                            "type": "string",
                            "maxLength": 8000
                          },
                          "findings": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "ruleId",
                                "severity",
                                "message"
                              ],
                              "properties": {
                                "ruleId": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 256
                                },
                                "severity": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "info"
                                    },
                                    {
                                      "type": "string",
                                      "const": "warn"
                                    },
                                    {
                                      "type": "string",
                                      "const": "critical"
                                    }
                                  ]
                                },
                                "message": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 4000
                                },
                                "file": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 1024
                                },
                                "line": {
                                  "type": "integer",
                                  "minimum": 1
                                }
                              },
                              "additionalProperties": false
                            },
                            "maxItems": 200
                          },
                          "metrics": {
                            "type": "object",
                            "patternProperties": {
                              "^.*$": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "maxLength": 4000
                                  },
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "boolean"
                                  }
                                ]
                              }
                            },
                            "maxProperties": 64,
                            "propertyNames": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            }
                          },
                          "evaluatorVersion": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          },
                          "mode": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          },
                          "decision": {
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "pass"
                              },
                              {
                                "type": "string",
                                "const": "revise"
                              },
                              {
                                "type": "string",
                                "const": "block"
                              }
                            ]
                          },
                          "decisionReason": {
                            "type": "string",
                            "maxLength": 2000
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "required": [
                      "pluginId",
                      "evaluatorId",
                      "status"
                    ],
                    "properties": {
                      "pluginId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128
                      },
                      "pluginVersion": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128
                      },
                      "evaluatorId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128
                      },
                      "status": {
                        "type": "string",
                        "const": "skipped"
                      }
                    },
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "required": [
                      "pluginId",
                      "evaluatorId",
                      "status",
                      "error"
                    ],
                    "properties": {
                      "pluginId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128
                      },
                      "pluginVersion": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128
                      },
                      "evaluatorId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128
                      },
                      "status": {
                        "type": "string",
                        "const": "error"
                      },
                      "error": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 2000
                      }
                    },
                    "additionalProperties": false
                  }
                ]
              },
              "maxItems": 64
            }
          },
          "additionalProperties": false
        }
      },
      "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
              },
              "requestedOwnerHandle": {
                "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,
              "description": "ClawHub skill reference: `@owner/slug`, `skills-sh:owner/repo/slug`, or a bare `slug` when no publisher is known."
            },
            "version": {
              "type": "string",
              "minLength": 1
            },
            "force": {
              "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"
            },
            "force": {
              "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,
          "maximum": 8640000000000000
        },
        "updatedAtMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 8640000000000000
        },
        "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": 8640000000000000
                },
                "anchorMs": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 8640000000000000
                }
              },
              "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": 8640000000000000
                }
              },
              "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
            },
            {
              "type": "object",
              "required": [
                "kind"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "skillCollectionReview"
                }
              },
              "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,
              "maximum": 8640000000000000
            },
            "scheduleActivatedAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 8640000000000000
            },
            "runningAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 8640000000000000
            },
            "lastRunAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 8640000000000000
            },
            "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": "tls_certificate"
                },
                {
                  "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
            },
            "autoDisabled": {
              "type": "object",
              "required": [
                "reason",
                "atMs",
                "consecutiveErrors"
              ],
              "properties": {
                "reason": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "consecutive-failures"
                    },
                    {
                      "type": "string",
                      "const": "schedule-errors"
                    }
                  ]
                },
                "atMs": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 8640000000000000
                },
                "consecutiveErrors": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "additionalProperties": false
            },
            "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"
            },
            "deliverySuppressionReason": {
              "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,
              "maximum": 8640000000000000
            },
            "lastTriggerEvalAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 8640000000000000
            },
            "triggerEvalCount": {
              "type": "integer",
              "minimum": 0
            },
            "lastTriggerFireAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 8640000000000000
            },
            "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,
              "maximum": 8640000000000000
            },
            "streamLastExitAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 8640000000000000
            }
          },
          "additionalProperties": false
        },
        "nextRunAtMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 8640000000000000
        },
        "lastRunAtMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 8640000000000000
        },
        "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"
        },
        "deliverySuppressionReason": {
          "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"
            }
          ]
        },
        "trigger": {
          "anyOf": [
            {
              "type": "string",
              "const": "all"
            },
            {
              "type": "string",
              "const": "conditional"
            },
            {
              "type": "string",
              "const": "unconditional"
            }
          ]
        },
        "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": 8640000000000000
                },
                "anchorMs": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 8640000000000000
                }
              },
              "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": 8640000000000000
                }
              },
              "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,
              "maximum": 8640000000000000
            },
            "updatedAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 8640000000000000
            },
            "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": 8640000000000000
                    },
                    "anchorMs": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 8640000000000000
                    }
                  },
                  "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": 8640000000000000
                    }
                  },
                  "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
                },
                {
                  "type": "object",
                  "required": [
                    "kind"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "skillCollectionReview"
                    }
                  },
                  "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,
                  "maximum": 8640000000000000
                },
                "scheduleActivatedAtMs": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 8640000000000000
                },
                "runningAtMs": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 8640000000000000
                },
                "lastRunAtMs": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 8640000000000000
                },
                "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": "tls_certificate"
                    },
                    {
                      "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
                },
                "autoDisabled": {
                  "type": "object",
                  "required": [
                    "reason",
                    "atMs",
                    "consecutiveErrors"
                  ],
                  "properties": {
                    "reason": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "consecutive-failures"
                        },
                        {
                          "type": "string",
                          "const": "schedule-errors"
                        }
                      ]
                    },
                    "atMs": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 8640000000000000
                    },
                    "consecutiveErrors": {
                      "type": "integer",
                      "minimum": 1
                    }
                  },
                  "additionalProperties": false
                },
                "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"
                },
                "deliverySuppressionReason": {
                  "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,
                  "maximum": 8640000000000000
                },
                "lastTriggerEvalAtMs": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 8640000000000000
                },
                "triggerEvalCount": {
                  "type": "integer",
                  "minimum": 0
                },
                "lastTriggerFireAtMs": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 8640000000000000
                },
                "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,
                  "maximum": 8640000000000000
                },
                "streamLastExitAtMs": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 8640000000000000
                }
              },
              "additionalProperties": false
            },
            "nextRunAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 8640000000000000
            },
            "lastRunAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 8640000000000000
            },
            "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"
            },
            "deliverySuppressionReason": {
              "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,
                  "maximum": 8640000000000000
                },
                "updatedAtMs": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 8640000000000000
                },
                "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": 8640000000000000
                        },
                        "anchorMs": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 8640000000000000
                        }
                      },
                      "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": 8640000000000000
                        }
                      },
                      "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
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "skillCollectionReview"
                        }
                      },
                      "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,
                      "maximum": 8640000000000000
                    },
                    "scheduleActivatedAtMs": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 8640000000000000
                    },
                    "runningAtMs": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 8640000000000000
                    },
                    "lastRunAtMs": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 8640000000000000
                    },
                    "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": "tls_certificate"
                        },
                        {
                          "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
                    },
                    "autoDisabled": {
                      "type": "object",
                      "required": [
                        "reason",
                        "atMs",
                        "consecutiveErrors"
                      ],
                      "properties": {
                        "reason": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "consecutive-failures"
                            },
                            {
                              "type": "string",
                              "const": "schedule-errors"
                            }
                          ]
                        },
                        "atMs": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 8640000000000000
                        },
                        "consecutiveErrors": {
                          "type": "integer",
                          "minimum": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    "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"
                    },
                    "deliverySuppressionReason": {
                      "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,
                      "maximum": 8640000000000000
                    },
                    "lastTriggerEvalAtMs": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 8640000000000000
                    },
                    "triggerEvalCount": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "lastTriggerFireAtMs": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 8640000000000000
                    },
                    "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,
                      "maximum": 8640000000000000
                    },
                    "streamLastExitAtMs": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 8640000000000000
                    }
                  },
                  "additionalProperties": false
                },
                "nextRunAtMs": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 8640000000000000
                },
                "lastRunAtMs": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 8640000000000000
                },
                "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"
                },
                "deliverySuppressionReason": {
                  "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,
              "maximum": 8640000000000000
            },
            "updatedAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 8640000000000000
            },
            "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": 8640000000000000
                    },
                    "anchorMs": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 8640000000000000
                    }
                  },
                  "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": 8640000000000000
                    }
                  },
                  "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
                },
                {
                  "type": "object",
                  "required": [
                    "kind"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "skillCollectionReview"
                    }
                  },
                  "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,
                  "maximum": 8640000000000000
                },
                "scheduleActivatedAtMs": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 8640000000000000
                },
                "runningAtMs": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 8640000000000000
                },
                "lastRunAtMs": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 8640000000000000
                },
                "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": "tls_certificate"
                    },
                    {
                      "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
                },
                "autoDisabled": {
                  "type": "object",
                  "required": [
                    "reason",
                    "atMs",
                    "consecutiveErrors"
                  ],
                  "properties": {
                    "reason": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "consecutive-failures"
                        },
                        {
                          "type": "string",
                          "const": "schedule-errors"
                        }
                      ]
                    },
                    "atMs": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 8640000000000000
                    },
                    "consecutiveErrors": {
                      "type": "integer",
                      "minimum": 1
                    }
                  },
                  "additionalProperties": false
                },
                "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"
                },
                "deliverySuppressionReason": {
                  "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,
                  "maximum": 8640000000000000
                },
                "lastTriggerEvalAtMs": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 8640000000000000
                },
                "triggerEvalCount": {
                  "type": "integer",
                  "minimum": 0
                },
                "lastTriggerFireAtMs": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 8640000000000000
                },
                "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,
                  "maximum": 8640000000000000
                },
                "streamLastExitAtMs": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 8640000000000000
                }
              },
              "additionalProperties": false
            },
            "nextRunAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 8640000000000000
            },
            "lastRunAtMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 8640000000000000
            },
            "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"
            },
            "deliverySuppressionReason": {
              "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": 8640000000000000
                        },
                        "anchorMs": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 8640000000000000
                        }
                      },
                      "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": 8640000000000000
                        }
                      },
                      "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,
                      "maximum": 8640000000000000
                    },
                    "runningAtMs": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 8640000000000000
                    },
                    "lastRunAtMs": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 8640000000000000
                    },
                    "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": "tls_certificate"
                        },
                        {
                          "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,
                      "maximum": 8640000000000000
                    },
                    "lastTriggerEvalAtMs": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 8640000000000000
                    },
                    "triggerEvalCount": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "lastTriggerFireAtMs": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 8640000000000000
                    },
                    "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,
                      "maximum": 8640000000000000
                    },
                    "streamLastExitAtMs": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 8640000000000000
                    }
                  },
                  "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": 8640000000000000
                        },
                        "anchorMs": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 8640000000000000
                        }
                      },
                      "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": 8640000000000000
                        }
                      },
                      "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,
                      "maximum": 8640000000000000
                    },
                    "runningAtMs": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 8640000000000000
                    },
                    "lastRunAtMs": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 8640000000000000
                    },
                    "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": "tls_certificate"
                        },
                        {
                          "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,
                      "maximum": 8640000000000000
                    },
                    "lastTriggerEvalAtMs": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 8640000000000000
                    },
                    "triggerEvalCount": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "lastTriggerFireAtMs": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 8640000000000000
                    },
                    "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,
                      "maximum": 8640000000000000
                    },
                    "streamLastExitAtMs": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 8640000000000000
                    }
                  },
                  "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"
                },
                {
                  "type": "string",
                  "const": "if-enabled"
                }
              ]
            },
            "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"
                },
                {
                  "type": "string",
                  "const": "if-enabled"
                }
              ]
            },
            "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"
            }
          ]
        },
        "completionStatus": {
          "anyOf": [
            {
              "type": "string",
              "const": "succeeded"
            },
            {
              "type": "string",
              "const": "failed"
            },
            {
              "type": "string",
              "const": "unknown"
            }
          ]
        },
        "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": "tls_certificate"
            },
            {
              "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"
        },
        "deliverySuppressionReason": {
          "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
        },
        "delivery": {
          "type": "object",
          "properties": {
            "intended": {
              "type": "object",
              "properties": {
                "channel": {
                  "type": "string"
                },
                "to": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "accountId": {
                  "type": "string"
                },
                "threadId": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "number"
                    }
                  ]
                },
                "source": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "explicit"
                    },
                    {
                      "type": "string",
                      "const": "last"
                    }
                  ]
                }
              },
              "additionalProperties": false
            },
            "resolved": {
              "type": "object",
              "required": [
                "ok"
              ],
              "properties": {
                "channel": {
                  "type": "string"
                },
                "to": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "accountId": {
                  "type": "string"
                },
                "threadId": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "number"
                    }
                  ]
                },
                "source": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "explicit"
                    },
                    {
                      "type": "string",
                      "const": "last"
                    }
                  ]
                },
                "ok": {
                  "type": "boolean"
                },
                "error": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "messageToolSentTo": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "channel"
                ],
                "properties": {
                  "channel": {
                    "type": "string"
                  },
                  "to": {
                    "type": "string"
                  },
                  "accountId": {
                    "type": "string"
                  },
                  "threadId": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              }
            },
            "fallbackUsed": {
              "type": "boolean"
            },
            "delivered": {
              "type": "boolean"
            }
          },
          "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"
        },
        "skippedBytes": {
          "type": "integer",
          "minimum": 0
        }
      },
      "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
        },
        "sessionKey": {
          "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
            },
            "agentId": {
              "type": "string",
              "minLength": 1
            },
            "sourceHomeId": {
              "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
    },
    "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"
        }
      ]
    },
    "MessageSendApprovalScope": {
      "type": "object",
      "required": [
        "kind",
        "target",
        "recipientCount"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "const": "message-send"
        },
        "target": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "recipientCount": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1000000
        },
        "recipients": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "maxItems": 5
        },
        "audience": {
          "anyOf": [
            {
              "type": "string",
              "const": "internal"
            },
            {
              "type": "string",
              "const": "external"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "PaymentApprovalScope": {
      "type": "object",
      "required": [
        "kind",
        "amount",
        "currency",
        "target"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "const": "payment"
        },
        "amount": {
          "type": "string",
          "minLength": 1,
          "maxLength": 40
        },
        "currency": {
          "type": "string",
          "minLength": 1,
          "maxLength": 12
        },
        "target": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        }
      },
      "additionalProperties": false
    },
    "ExternalPostApprovalScope": {
      "type": "object",
      "required": [
        "kind",
        "target",
        "visibility"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "const": "external-post"
        },
        "target": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "visibility": {
          "anyOf": [
            {
              "type": "string",
              "const": "public"
            },
            {
              "type": "string",
              "const": "restricted"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "StandingGrantApprovalScope": {
      "type": "object",
      "required": [
        "kind",
        "automation",
        "command"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "const": "standing-grant"
        },
        "automation": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "command": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "expiresInDays": {
          "type": "integer",
          "minimum": 1,
          "maximum": 3650
        }
      },
      "additionalProperties": false
    },
    "ApprovalScope": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "kind",
            "target",
            "recipientCount"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "message-send"
            },
            "target": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "recipientCount": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000000
            },
            "recipients": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "maxItems": 5
            },
            "audience": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "internal"
                },
                {
                  "type": "string",
                  "const": "external"
                }
              ]
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "kind",
            "amount",
            "currency",
            "target"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "payment"
            },
            "amount": {
              "type": "string",
              "minLength": 1,
              "maxLength": 40
            },
            "currency": {
              "type": "string",
              "minLength": 1,
              "maxLength": 12
            },
            "target": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "kind",
            "target",
            "visibility"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "external-post"
            },
            "target": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "visibility": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "public"
                },
                {
                  "type": "string",
                  "const": "restricted"
                }
              ]
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "kind",
            "automation",
            "command"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "standing-grant"
            },
            "automation": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "command": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "expiresInDays": {
              "type": "integer",
              "minimum": 1,
              "maximum": 3650
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "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"
            }
          ]
        },
        "scope": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "kind",
                "target",
                "recipientCount"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "message-send"
                },
                "target": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                },
                "recipientCount": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 1000000
                },
                "recipients": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "maxItems": 5
                },
                "audience": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "internal"
                    },
                    {
                      "type": "string",
                      "const": "external"
                    }
                  ]
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "kind",
                "amount",
                "currency",
                "target"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "payment"
                },
                "amount": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 40
                },
                "currency": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 12
                },
                "target": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "kind",
                "target",
                "visibility"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "external-post"
                },
                "target": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                },
                "visibility": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "public"
                    },
                    {
                      "type": "string",
                      "const": "restricted"
                    }
                  ]
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "kind",
                "automation",
                "command"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "standing-grant"
                },
                "automation": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                },
                "command": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "expiresInDays": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 3650
                }
              },
              "additionalProperties": false
            }
          ]
        },
        "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"
            }
          ]
        },
        "scope": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "kind",
                "target",
                "recipientCount"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "message-send"
                },
                "target": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                },
                "recipientCount": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 1000000
                },
                "recipients": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "maxItems": 5
                },
                "audience": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "internal"
                    },
                    {
                      "type": "string",
                      "const": "external"
                    }
                  ]
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "kind",
                "amount",
                "currency",
                "target"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "payment"
                },
                "amount": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 40
                },
                "currency": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 12
                },
                "target": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "kind",
                "target",
                "visibility"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "external-post"
                },
                "target": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                },
                "visibility": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "public"
                    },
                    {
                      "type": "string",
                      "const": "restricted"
                    }
                  ]
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "kind",
                "automation",
                "command"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "standing-grant"
                },
                "automation": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                },
                "command": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "expiresInDays": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 3650
                }
              },
              "additionalProperties": false
            }
          ]
        },
        "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"
                }
              ]
            },
            "scope": {
              "anyOf": [
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "target",
                    "recipientCount"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "message-send"
                    },
                    "target": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 128
                    },
                    "recipientCount": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 1000000
                    },
                    "recipients": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128
                      },
                      "maxItems": 5
                    },
                    "audience": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "internal"
                        },
                        {
                          "type": "string",
                          "const": "external"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "amount",
                    "currency",
                    "target"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "payment"
                    },
                    "amount": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 40
                    },
                    "currency": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 12
                    },
                    "target": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 128
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "target",
                    "visibility"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "external-post"
                    },
                    "target": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 128
                    },
                    "visibility": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "public"
                        },
                        {
                          "type": "string",
                          "const": "restricted"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "automation",
                    "command"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "standing-grant"
                    },
                    "automation": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 128
                    },
                    "command": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "expiresInDays": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 3650
                    }
                  },
                  "additionalProperties": false
                }
              ]
            },
            "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"
                }
              ]
            },
            "scope": {
              "anyOf": [
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "target",
                    "recipientCount"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "message-send"
                    },
                    "target": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 128
                    },
                    "recipientCount": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 1000000
                    },
                    "recipients": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128
                      },
                      "maxItems": 5
                    },
                    "audience": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "internal"
                        },
                        {
                          "type": "string",
                          "const": "external"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "amount",
                    "currency",
                    "target"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "payment"
                    },
                    "amount": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 40
                    },
                    "currency": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 12
                    },
                    "target": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 128
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "target",
                    "visibility"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "external-post"
                    },
                    "target": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 128
                    },
                    "visibility": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "public"
                        },
                        {
                          "type": "string",
                          "const": "restricted"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "automation",
                    "command"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "standing-grant"
                    },
                    "automation": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 128
                    },
                    "command": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256
                    },
                    "expiresInDays": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 3650
                    }
                  },
                  "additionalProperties": false
                }
              ]
            },
            "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"
                    }
                  ]
                },
                "scope": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "target",
                        "recipientCount"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "message-send"
                        },
                        "target": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "recipientCount": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 1000000
                        },
                        "recipients": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          },
                          "maxItems": 5
                        },
                        "audience": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "internal"
                            },
                            {
                              "type": "string",
                              "const": "external"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "amount",
                        "currency",
                        "target"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "payment"
                        },
                        "amount": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 40
                        },
                        "currency": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 12
                        },
                        "target": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "target",
                        "visibility"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "external-post"
                        },
                        "target": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "visibility": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "public"
                            },
                            {
                              "type": "string",
                              "const": "restricted"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "automation",
                        "command"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "standing-grant"
                        },
                        "automation": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "command": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256
                        },
                        "expiresInDays": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 3650
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                },
                "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"
                    }
                  ]
                },
                "scope": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "target",
                        "recipientCount"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "message-send"
                        },
                        "target": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "recipientCount": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 1000000
                        },
                        "recipients": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          },
                          "maxItems": 5
                        },
                        "audience": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "internal"
                            },
                            {
                              "type": "string",
                              "const": "external"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "amount",
                        "currency",
                        "target"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "payment"
                        },
                        "amount": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 40
                        },
                        "currency": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 12
                        },
                        "target": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "target",
                        "visibility"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "external-post"
                        },
                        "target": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "visibility": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "public"
                            },
                            {
                              "type": "string",
                              "const": "restricted"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "automation",
                        "command"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "standing-grant"
                        },
                        "automation": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "command": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256
                        },
                        "expiresInDays": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 3650
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                },
                "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"
        },
        "sourceSessionKey": {
          "type": "string",
          "minLength": 1
        }
      },
      "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"
                    }
                  ]
                },
                "scope": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "target",
                        "recipientCount"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "message-send"
                        },
                        "target": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "recipientCount": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 1000000
                        },
                        "recipients": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          },
                          "maxItems": 5
                        },
                        "audience": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "internal"
                            },
                            {
                              "type": "string",
                              "const": "external"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "amount",
                        "currency",
                        "target"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "payment"
                        },
                        "amount": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 40
                        },
                        "currency": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 12
                        },
                        "target": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "target",
                        "visibility"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "external-post"
                        },
                        "target": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "visibility": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "public"
                            },
                            {
                              "type": "string",
                              "const": "restricted"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "automation",
                        "command"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "standing-grant"
                        },
                        "automation": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "command": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256
                        },
                        "expiresInDays": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 3650
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                },
                "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"
                    }
                  ]
                },
                "scope": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "target",
                        "recipientCount"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "message-send"
                        },
                        "target": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "recipientCount": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 1000000
                        },
                        "recipients": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          },
                          "maxItems": 5
                        },
                        "audience": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "internal"
                            },
                            {
                              "type": "string",
                              "const": "external"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "amount",
                        "currency",
                        "target"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "payment"
                        },
                        "amount": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 40
                        },
                        "currency": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 12
                        },
                        "target": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "target",
                        "visibility"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "external-post"
                        },
                        "target": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "visibility": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "public"
                            },
                            {
                              "type": "string",
                              "const": "restricted"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "automation",
                        "command"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "standing-grant"
                        },
                        "automation": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "command": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256
                        },
                        "expiresInDays": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 3650
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                },
                "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"
                    }
                  ]
                },
                "scope": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "target",
                        "recipientCount"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "message-send"
                        },
                        "target": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "recipientCount": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 1000000
                        },
                        "recipients": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          },
                          "maxItems": 5
                        },
                        "audience": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "internal"
                            },
                            {
                              "type": "string",
                              "const": "external"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "amount",
                        "currency",
                        "target"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "payment"
                        },
                        "amount": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 40
                        },
                        "currency": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 12
                        },
                        "target": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "target",
                        "visibility"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "external-post"
                        },
                        "target": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "visibility": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "public"
                            },
                            {
                              "type": "string",
                              "const": "restricted"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "automation",
                        "command"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "standing-grant"
                        },
                        "automation": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "command": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256
                        },
                        "expiresInDays": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 3650
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                },
                "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"
                    }
                  ]
                },
                "scope": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "target",
                        "recipientCount"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "message-send"
                        },
                        "target": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "recipientCount": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 1000000
                        },
                        "recipients": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          },
                          "maxItems": 5
                        },
                        "audience": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "internal"
                            },
                            {
                              "type": "string",
                              "const": "external"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "amount",
                        "currency",
                        "target"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "payment"
                        },
                        "amount": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 40
                        },
                        "currency": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 12
                        },
                        "target": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "target",
                        "visibility"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "external-post"
                        },
                        "target": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "visibility": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "public"
                            },
                            {
                              "type": "string",
                              "const": "restricted"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "automation",
                        "command"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "standing-grant"
                        },
                        "automation": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "command": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256
                        },
                        "expiresInDays": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 3650
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                },
                "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"
                    }
                  ]
                },
                "scope": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "target",
                        "recipientCount"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "message-send"
                        },
                        "target": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "recipientCount": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 1000000
                        },
                        "recipients": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          },
                          "maxItems": 5
                        },
                        "audience": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "internal"
                            },
                            {
                              "type": "string",
                              "const": "external"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "amount",
                        "currency",
                        "target"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "payment"
                        },
                        "amount": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 40
                        },
                        "currency": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 12
                        },
                        "target": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "target",
                        "visibility"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "external-post"
                        },
                        "target": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "visibility": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "public"
                            },
                            {
                              "type": "string",
                              "const": "restricted"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "automation",
                        "command"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "standing-grant"
                        },
                        "automation": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "command": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256
                        },
                        "expiresInDays": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 3650
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                },
                "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"
                    }
                  ]
                },
                "scope": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "target",
                        "recipientCount"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "message-send"
                        },
                        "target": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "recipientCount": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 1000000
                        },
                        "recipients": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          },
                          "maxItems": 5
                        },
                        "audience": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "internal"
                            },
                            {
                              "type": "string",
                              "const": "external"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "amount",
                        "currency",
                        "target"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "payment"
                        },
                        "amount": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 40
                        },
                        "currency": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 12
                        },
                        "target": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "target",
                        "visibility"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "external-post"
                        },
                        "target": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "visibility": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "public"
                            },
                            {
                              "type": "string",
                              "const": "restricted"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "automation",
                        "command"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "standing-grant"
                        },
                        "automation": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "command": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256
                        },
                        "expiresInDays": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 3650
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                },
                "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"
                    }
                  ]
                },
                "scope": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "target",
                        "recipientCount"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "message-send"
                        },
                        "target": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "recipientCount": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 1000000
                        },
                        "recipients": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          },
                          "maxItems": 5
                        },
                        "audience": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "internal"
                            },
                            {
                              "type": "string",
                              "const": "external"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "amount",
                        "currency",
                        "target"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "payment"
                        },
                        "amount": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 40
                        },
                        "currency": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 12
                        },
                        "target": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "target",
                        "visibility"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "external-post"
                        },
                        "target": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "visibility": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "public"
                            },
                            {
                              "type": "string",
                              "const": "restricted"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "automation",
                        "command"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "standing-grant"
                        },
                        "automation": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "command": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256
                        },
                        "expiresInDays": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 3650
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                },
                "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"
                    }
                  ]
                },
                "scope": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "target",
                        "recipientCount"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "message-send"
                        },
                        "target": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "recipientCount": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 1000000
                        },
                        "recipients": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          },
                          "maxItems": 5
                        },
                        "audience": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "internal"
                            },
                            {
                              "type": "string",
                              "const": "external"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "amount",
                        "currency",
                        "target"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "payment"
                        },
                        "amount": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 40
                        },
                        "currency": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 12
                        },
                        "target": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "target",
                        "visibility"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "external-post"
                        },
                        "target": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "visibility": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "public"
                            },
                            {
                              "type": "string",
                              "const": "restricted"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "kind",
                        "automation",
                        "command"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "const": "standing-grant"
                        },
                        "automation": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "command": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 256
                        },
                        "expiresInDays": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 3650
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                },
                "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"
                        }
                      ]
                    },
                    "scope": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "target",
                            "recipientCount"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "message-send"
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "recipientCount": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 1000000
                            },
                            "recipients": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 128
                              },
                              "maxItems": 5
                            },
                            "audience": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "internal"
                                },
                                {
                                  "type": "string",
                                  "const": "external"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "amount",
                            "currency",
                            "target"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "payment"
                            },
                            "amount": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 40
                            },
                            "currency": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 12
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "target",
                            "visibility"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "external-post"
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "visibility": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "public"
                                },
                                {
                                  "type": "string",
                                  "const": "restricted"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "automation",
                            "command"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "standing-grant"
                            },
                            "automation": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "command": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 256
                            },
                            "expiresInDays": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 3650
                            }
                          },
                          "additionalProperties": false
                        }
                      ]
                    },
                    "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"
                        }
                      ]
                    },
                    "scope": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "target",
                            "recipientCount"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "message-send"
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "recipientCount": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 1000000
                            },
                            "recipients": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 128
                              },
                              "maxItems": 5
                            },
                            "audience": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "internal"
                                },
                                {
                                  "type": "string",
                                  "const": "external"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "amount",
                            "currency",
                            "target"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "payment"
                            },
                            "amount": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 40
                            },
                            "currency": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 12
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "target",
                            "visibility"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "external-post"
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "visibility": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "public"
                                },
                                {
                                  "type": "string",
                                  "const": "restricted"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "automation",
                            "command"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "standing-grant"
                            },
                            "automation": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "command": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 256
                            },
                            "expiresInDays": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 3650
                            }
                          },
                          "additionalProperties": false
                        }
                      ]
                    },
                    "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"
            },
            "sourceSessionKey": {
              "type": "string",
              "minLength": 1
            }
          },
          "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"
                        }
                      ]
                    },
                    "scope": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "target",
                            "recipientCount"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "message-send"
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "recipientCount": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 1000000
                            },
                            "recipients": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 128
                              },
                              "maxItems": 5
                            },
                            "audience": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "internal"
                                },
                                {
                                  "type": "string",
                                  "const": "external"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "amount",
                            "currency",
                            "target"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "payment"
                            },
                            "amount": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 40
                            },
                            "currency": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 12
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "target",
                            "visibility"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "external-post"
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "visibility": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "public"
                                },
                                {
                                  "type": "string",
                                  "const": "restricted"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "automation",
                            "command"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "standing-grant"
                            },
                            "automation": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "command": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 256
                            },
                            "expiresInDays": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 3650
                            }
                          },
                          "additionalProperties": false
                        }
                      ]
                    },
                    "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"
                        }
                      ]
                    },
                    "scope": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "target",
                            "recipientCount"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "message-send"
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "recipientCount": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 1000000
                            },
                            "recipients": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 128
                              },
                              "maxItems": 5
                            },
                            "audience": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "internal"
                                },
                                {
                                  "type": "string",
                                  "const": "external"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "amount",
                            "currency",
                            "target"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "payment"
                            },
                            "amount": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 40
                            },
                            "currency": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 12
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "target",
                            "visibility"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "external-post"
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "visibility": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "public"
                                },
                                {
                                  "type": "string",
                                  "const": "restricted"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "automation",
                            "command"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "standing-grant"
                            },
                            "automation": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "command": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 256
                            },
                            "expiresInDays": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 3650
                            }
                          },
                          "additionalProperties": false
                        }
                      ]
                    },
                    "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"
                        }
                      ]
                    },
                    "scope": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "target",
                            "recipientCount"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "message-send"
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "recipientCount": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 1000000
                            },
                            "recipients": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 128
                              },
                              "maxItems": 5
                            },
                            "audience": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "internal"
                                },
                                {
                                  "type": "string",
                                  "const": "external"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "amount",
                            "currency",
                            "target"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "payment"
                            },
                            "amount": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 40
                            },
                            "currency": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 12
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "target",
                            "visibility"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "external-post"
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "visibility": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "public"
                                },
                                {
                                  "type": "string",
                                  "const": "restricted"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "automation",
                            "command"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "standing-grant"
                            },
                            "automation": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "command": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 256
                            },
                            "expiresInDays": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 3650
                            }
                          },
                          "additionalProperties": false
                        }
                      ]
                    },
                    "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"
                        }
                      ]
                    },
                    "scope": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "target",
                            "recipientCount"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "message-send"
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "recipientCount": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 1000000
                            },
                            "recipients": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 128
                              },
                              "maxItems": 5
                            },
                            "audience": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "internal"
                                },
                                {
                                  "type": "string",
                                  "const": "external"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "amount",
                            "currency",
                            "target"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "payment"
                            },
                            "amount": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 40
                            },
                            "currency": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 12
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "target",
                            "visibility"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "external-post"
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "visibility": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "public"
                                },
                                {
                                  "type": "string",
                                  "const": "restricted"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "automation",
                            "command"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "standing-grant"
                            },
                            "automation": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "command": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 256
                            },
                            "expiresInDays": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 3650
                            }
                          },
                          "additionalProperties": false
                        }
                      ]
                    },
                    "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"
                        }
                      ]
                    },
                    "scope": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "target",
                            "recipientCount"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "message-send"
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "recipientCount": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 1000000
                            },
                            "recipients": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 128
                              },
                              "maxItems": 5
                            },
                            "audience": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "internal"
                                },
                                {
                                  "type": "string",
                                  "const": "external"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "amount",
                            "currency",
                            "target"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "payment"
                            },
                            "amount": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 40
                            },
                            "currency": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 12
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "target",
                            "visibility"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "external-post"
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "visibility": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "public"
                                },
                                {
                                  "type": "string",
                                  "const": "restricted"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "automation",
                            "command"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "standing-grant"
                            },
                            "automation": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "command": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 256
                            },
                            "expiresInDays": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 3650
                            }
                          },
                          "additionalProperties": false
                        }
                      ]
                    },
                    "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"
                        }
                      ]
                    },
                    "scope": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "target",
                            "recipientCount"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "message-send"
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "recipientCount": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 1000000
                            },
                            "recipients": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 128
                              },
                              "maxItems": 5
                            },
                            "audience": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "internal"
                                },
                                {
                                  "type": "string",
                                  "const": "external"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "amount",
                            "currency",
                            "target"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "payment"
                            },
                            "amount": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 40
                            },
                            "currency": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 12
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "target",
                            "visibility"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "external-post"
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "visibility": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "public"
                                },
                                {
                                  "type": "string",
                                  "const": "restricted"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "automation",
                            "command"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "standing-grant"
                            },
                            "automation": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "command": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 256
                            },
                            "expiresInDays": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 3650
                            }
                          },
                          "additionalProperties": false
                        }
                      ]
                    },
                    "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"
                        }
                      ]
                    },
                    "scope": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "target",
                            "recipientCount"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "message-send"
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "recipientCount": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 1000000
                            },
                            "recipients": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 128
                              },
                              "maxItems": 5
                            },
                            "audience": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "internal"
                                },
                                {
                                  "type": "string",
                                  "const": "external"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "amount",
                            "currency",
                            "target"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "payment"
                            },
                            "amount": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 40
                            },
                            "currency": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 12
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "target",
                            "visibility"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "external-post"
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "visibility": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "public"
                                },
                                {
                                  "type": "string",
                                  "const": "restricted"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "automation",
                            "command"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "standing-grant"
                            },
                            "automation": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "command": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 256
                            },
                            "expiresInDays": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 3650
                            }
                          },
                          "additionalProperties": false
                        }
                      ]
                    },
                    "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"
                        }
                      ]
                    },
                    "scope": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "target",
                            "recipientCount"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "message-send"
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "recipientCount": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 1000000
                            },
                            "recipients": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 128
                              },
                              "maxItems": 5
                            },
                            "audience": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "internal"
                                },
                                {
                                  "type": "string",
                                  "const": "external"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "amount",
                            "currency",
                            "target"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "payment"
                            },
                            "amount": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 40
                            },
                            "currency": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 12
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "target",
                            "visibility"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "external-post"
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "visibility": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "public"
                                },
                                {
                                  "type": "string",
                                  "const": "restricted"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "automation",
                            "command"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "standing-grant"
                            },
                            "automation": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "command": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 256
                            },
                            "expiresInDays": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 3650
                            }
                          },
                          "additionalProperties": false
                        }
                      ]
                    },
                    "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"
                        }
                      ]
                    },
                    "scope": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "target",
                            "recipientCount"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "message-send"
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "recipientCount": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 1000000
                            },
                            "recipients": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 128
                              },
                              "maxItems": 5
                            },
                            "audience": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "internal"
                                },
                                {
                                  "type": "string",
                                  "const": "external"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "amount",
                            "currency",
                            "target"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "payment"
                            },
                            "amount": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 40
                            },
                            "currency": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 12
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "target",
                            "visibility"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "external-post"
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "visibility": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "public"
                                },
                                {
                                  "type": "string",
                                  "const": "restricted"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "automation",
                            "command"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "standing-grant"
                            },
                            "automation": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "command": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 256
                            },
                            "expiresInDays": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 3650
                            }
                          },
                          "additionalProperties": false
                        }
                      ]
                    },
                    "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"
                        }
                      ]
                    },
                    "scope": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "target",
                            "recipientCount"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "message-send"
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "recipientCount": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 1000000
                            },
                            "recipients": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 128
                              },
                              "maxItems": 5
                            },
                            "audience": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "internal"
                                },
                                {
                                  "type": "string",
                                  "const": "external"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "amount",
                            "currency",
                            "target"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "payment"
                            },
                            "amount": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 40
                            },
                            "currency": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 12
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "target",
                            "visibility"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "external-post"
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "visibility": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "public"
                                },
                                {
                                  "type": "string",
                                  "const": "restricted"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "automation",
                            "command"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "standing-grant"
                            },
                            "automation": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "command": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 256
                            },
                            "expiresInDays": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 3650
                            }
                          },
                          "additionalProperties": false
                        }
                      ]
                    },
                    "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"
                        }
                      ]
                    },
                    "scope": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "target",
                            "recipientCount"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "message-send"
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "recipientCount": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 1000000
                            },
                            "recipients": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 128
                              },
                              "maxItems": 5
                            },
                            "audience": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "internal"
                                },
                                {
                                  "type": "string",
                                  "const": "external"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "amount",
                            "currency",
                            "target"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "payment"
                            },
                            "amount": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 40
                            },
                            "currency": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 12
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "target",
                            "visibility"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "external-post"
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "visibility": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "public"
                                },
                                {
                                  "type": "string",
                                  "const": "restricted"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "automation",
                            "command"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "standing-grant"
                            },
                            "automation": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "command": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 256
                            },
                            "expiresInDays": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 3650
                            }
                          },
                          "additionalProperties": false
                        }
                      ]
                    },
                    "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"
                        }
                      ]
                    },
                    "scope": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "target",
                            "recipientCount"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "message-send"
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "recipientCount": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 1000000
                            },
                            "recipients": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 128
                              },
                              "maxItems": 5
                            },
                            "audience": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "internal"
                                },
                                {
                                  "type": "string",
                                  "const": "external"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "amount",
                            "currency",
                            "target"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "payment"
                            },
                            "amount": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 40
                            },
                            "currency": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 12
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "target",
                            "visibility"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "external-post"
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "visibility": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "public"
                                },
                                {
                                  "type": "string",
                                  "const": "restricted"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "automation",
                            "command"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "standing-grant"
                            },
                            "automation": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "command": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 256
                            },
                            "expiresInDays": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 3650
                            }
                          },
                          "additionalProperties": false
                        }
                      ]
                    },
                    "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"
                        }
                      ]
                    },
                    "scope": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "target",
                            "recipientCount"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "message-send"
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "recipientCount": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 1000000
                            },
                            "recipients": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 128
                              },
                              "maxItems": 5
                            },
                            "audience": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "internal"
                                },
                                {
                                  "type": "string",
                                  "const": "external"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "amount",
                            "currency",
                            "target"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "payment"
                            },
                            "amount": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 40
                            },
                            "currency": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 12
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "target",
                            "visibility"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "external-post"
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "visibility": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "public"
                                },
                                {
                                  "type": "string",
                                  "const": "restricted"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "automation",
                            "command"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "standing-grant"
                            },
                            "automation": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "command": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 256
                            },
                            "expiresInDays": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 3650
                            }
                          },
                          "additionalProperties": false
                        }
                      ]
                    },
                    "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"
                        }
                      ]
                    },
                    "scope": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "target",
                            "recipientCount"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "message-send"
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "recipientCount": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 1000000
                            },
                            "recipients": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 128
                              },
                              "maxItems": 5
                            },
                            "audience": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "internal"
                                },
                                {
                                  "type": "string",
                                  "const": "external"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "amount",
                            "currency",
                            "target"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "payment"
                            },
                            "amount": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 40
                            },
                            "currency": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 12
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "target",
                            "visibility"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "external-post"
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "visibility": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "public"
                                },
                                {
                                  "type": "string",
                                  "const": "restricted"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "automation",
                            "command"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "standing-grant"
                            },
                            "automation": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "command": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 256
                            },
                            "expiresInDays": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 3650
                            }
                          },
                          "additionalProperties": false
                        }
                      ]
                    },
                    "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"
                        }
                      ]
                    },
                    "scope": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "target",
                            "recipientCount"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "message-send"
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "recipientCount": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 1000000
                            },
                            "recipients": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 128
                              },
                              "maxItems": 5
                            },
                            "audience": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "internal"
                                },
                                {
                                  "type": "string",
                                  "const": "external"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "amount",
                            "currency",
                            "target"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "payment"
                            },
                            "amount": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 40
                            },
                            "currency": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 12
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "target",
                            "visibility"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "external-post"
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "visibility": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "public"
                                },
                                {
                                  "type": "string",
                                  "const": "restricted"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "automation",
                            "command"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "standing-grant"
                            },
                            "automation": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "command": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 256
                            },
                            "expiresInDays": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 3650
                            }
                          },
                          "additionalProperties": false
                        }
                      ]
                    },
                    "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"
                        }
                      ]
                    },
                    "scope": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "target",
                            "recipientCount"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "message-send"
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "recipientCount": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 1000000
                            },
                            "recipients": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 128
                              },
                              "maxItems": 5
                            },
                            "audience": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "internal"
                                },
                                {
                                  "type": "string",
                                  "const": "external"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "amount",
                            "currency",
                            "target"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "payment"
                            },
                            "amount": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 40
                            },
                            "currency": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 12
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "target",
                            "visibility"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "external-post"
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "visibility": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "public"
                                },
                                {
                                  "type": "string",
                                  "const": "restricted"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "automation",
                            "command"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "standing-grant"
                            },
                            "automation": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "command": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 256
                            },
                            "expiresInDays": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 3650
                            }
                          },
                          "additionalProperties": false
                        }
                      ]
                    },
                    "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"
                            }
                          ]
                        },
                        "scope": {
                          "anyOf": [
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "recipientCount"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "message-send"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "recipientCount": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 1000000
                                },
                                "recipients": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "maxItems": 5
                                },
                                "audience": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "internal"
                                    },
                                    {
                                      "type": "string",
                                      "const": "external"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "amount",
                                "currency",
                                "target"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "payment"
                                },
                                "amount": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 40
                                },
                                "currency": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 12
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "visibility"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "external-post"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "visibility": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "public"
                                    },
                                    {
                                      "type": "string",
                                      "const": "restricted"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "automation",
                                "command"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "standing-grant"
                                },
                                "automation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "command": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 256
                                },
                                "expiresInDays": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 3650
                                }
                              },
                              "additionalProperties": false
                            }
                          ]
                        },
                        "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"
                            }
                          ]
                        },
                        "scope": {
                          "anyOf": [
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "recipientCount"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "message-send"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "recipientCount": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 1000000
                                },
                                "recipients": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "maxItems": 5
                                },
                                "audience": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "internal"
                                    },
                                    {
                                      "type": "string",
                                      "const": "external"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "amount",
                                "currency",
                                "target"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "payment"
                                },
                                "amount": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 40
                                },
                                "currency": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 12
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "visibility"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "external-post"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "visibility": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "public"
                                    },
                                    {
                                      "type": "string",
                                      "const": "restricted"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "automation",
                                "command"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "standing-grant"
                                },
                                "automation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "command": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 256
                                },
                                "expiresInDays": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 3650
                                }
                              },
                              "additionalProperties": false
                            }
                          ]
                        },
                        "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"
                },
                "sourceSessionKey": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "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"
                            }
                          ]
                        },
                        "scope": {
                          "anyOf": [
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "recipientCount"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "message-send"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "recipientCount": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 1000000
                                },
                                "recipients": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "maxItems": 5
                                },
                                "audience": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "internal"
                                    },
                                    {
                                      "type": "string",
                                      "const": "external"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "amount",
                                "currency",
                                "target"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "payment"
                                },
                                "amount": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 40
                                },
                                "currency": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 12
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "visibility"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "external-post"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "visibility": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "public"
                                    },
                                    {
                                      "type": "string",
                                      "const": "restricted"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "automation",
                                "command"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "standing-grant"
                                },
                                "automation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "command": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 256
                                },
                                "expiresInDays": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 3650
                                }
                              },
                              "additionalProperties": false
                            }
                          ]
                        },
                        "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"
                            }
                          ]
                        },
                        "scope": {
                          "anyOf": [
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "recipientCount"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "message-send"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "recipientCount": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 1000000
                                },
                                "recipients": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "maxItems": 5
                                },
                                "audience": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "internal"
                                    },
                                    {
                                      "type": "string",
                                      "const": "external"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "amount",
                                "currency",
                                "target"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "payment"
                                },
                                "amount": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 40
                                },
                                "currency": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 12
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "visibility"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "external-post"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "visibility": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "public"
                                    },
                                    {
                                      "type": "string",
                                      "const": "restricted"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "automation",
                                "command"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "standing-grant"
                                },
                                "automation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "command": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 256
                                },
                                "expiresInDays": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 3650
                                }
                              },
                              "additionalProperties": false
                            }
                          ]
                        },
                        "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"
                            }
                          ]
                        },
                        "scope": {
                          "anyOf": [
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "recipientCount"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "message-send"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "recipientCount": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 1000000
                                },
                                "recipients": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "maxItems": 5
                                },
                                "audience": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "internal"
                                    },
                                    {
                                      "type": "string",
                                      "const": "external"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "amount",
                                "currency",
                                "target"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "payment"
                                },
                                "amount": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 40
                                },
                                "currency": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 12
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "visibility"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "external-post"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "visibility": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "public"
                                    },
                                    {
                                      "type": "string",
                                      "const": "restricted"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "automation",
                                "command"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "standing-grant"
                                },
                                "automation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "command": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 256
                                },
                                "expiresInDays": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 3650
                                }
                              },
                              "additionalProperties": false
                            }
                          ]
                        },
                        "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"
                            }
                          ]
                        },
                        "scope": {
                          "anyOf": [
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "recipientCount"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "message-send"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "recipientCount": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 1000000
                                },
                                "recipients": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "maxItems": 5
                                },
                                "audience": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "internal"
                                    },
                                    {
                                      "type": "string",
                                      "const": "external"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "amount",
                                "currency",
                                "target"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "payment"
                                },
                                "amount": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 40
                                },
                                "currency": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 12
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "visibility"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "external-post"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "visibility": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "public"
                                    },
                                    {
                                      "type": "string",
                                      "const": "restricted"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "automation",
                                "command"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "standing-grant"
                                },
                                "automation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "command": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 256
                                },
                                "expiresInDays": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 3650
                                }
                              },
                              "additionalProperties": false
                            }
                          ]
                        },
                        "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"
                            }
                          ]
                        },
                        "scope": {
                          "anyOf": [
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "recipientCount"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "message-send"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "recipientCount": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 1000000
                                },
                                "recipients": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "maxItems": 5
                                },
                                "audience": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "internal"
                                    },
                                    {
                                      "type": "string",
                                      "const": "external"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "amount",
                                "currency",
                                "target"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "payment"
                                },
                                "amount": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 40
                                },
                                "currency": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 12
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "visibility"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "external-post"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "visibility": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "public"
                                    },
                                    {
                                      "type": "string",
                                      "const": "restricted"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "automation",
                                "command"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "standing-grant"
                                },
                                "automation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "command": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 256
                                },
                                "expiresInDays": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 3650
                                }
                              },
                              "additionalProperties": false
                            }
                          ]
                        },
                        "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"
                            }
                          ]
                        },
                        "scope": {
                          "anyOf": [
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "recipientCount"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "message-send"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "recipientCount": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 1000000
                                },
                                "recipients": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "maxItems": 5
                                },
                                "audience": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "internal"
                                    },
                                    {
                                      "type": "string",
                                      "const": "external"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "amount",
                                "currency",
                                "target"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "payment"
                                },
                                "amount": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 40
                                },
                                "currency": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 12
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "visibility"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "external-post"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "visibility": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "public"
                                    },
                                    {
                                      "type": "string",
                                      "const": "restricted"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "automation",
                                "command"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "standing-grant"
                                },
                                "automation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "command": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 256
                                },
                                "expiresInDays": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 3650
                                }
                              },
                              "additionalProperties": false
                            }
                          ]
                        },
                        "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"
                            }
                          ]
                        },
                        "scope": {
                          "anyOf": [
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "recipientCount"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "message-send"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "recipientCount": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 1000000
                                },
                                "recipients": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "maxItems": 5
                                },
                                "audience": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "internal"
                                    },
                                    {
                                      "type": "string",
                                      "const": "external"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "amount",
                                "currency",
                                "target"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "payment"
                                },
                                "amount": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 40
                                },
                                "currency": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 12
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "visibility"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "external-post"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "visibility": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "public"
                                    },
                                    {
                                      "type": "string",
                                      "const": "restricted"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "automation",
                                "command"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "standing-grant"
                                },
                                "automation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "command": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 256
                                },
                                "expiresInDays": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 3650
                                }
                              },
                              "additionalProperties": false
                            }
                          ]
                        },
                        "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"
                            }
                          ]
                        },
                        "scope": {
                          "anyOf": [
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "recipientCount"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "message-send"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "recipientCount": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 1000000
                                },
                                "recipients": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "maxItems": 5
                                },
                                "audience": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "internal"
                                    },
                                    {
                                      "type": "string",
                                      "const": "external"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "amount",
                                "currency",
                                "target"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "payment"
                                },
                                "amount": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 40
                                },
                                "currency": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 12
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "visibility"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "external-post"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "visibility": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "public"
                                    },
                                    {
                                      "type": "string",
                                      "const": "restricted"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "automation",
                                "command"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "standing-grant"
                                },
                                "automation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "command": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 256
                                },
                                "expiresInDays": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 3650
                                }
                              },
                              "additionalProperties": false
                            }
                          ]
                        },
                        "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"
                              }
                            ]
                          },
                          "scope": {
                            "anyOf": [
                              {
                                "type": "object",
                                "required": [
                                  "kind",
                                  "target",
                                  "recipientCount"
                                ],
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "message-send"
                                  },
                                  "target": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "recipientCount": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 1000000
                                  },
                                  "recipients": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 128
                                    },
                                    "maxItems": 5
                                  },
                                  "audience": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "const": "internal"
                                      },
                                      {
                                        "type": "string",
                                        "const": "external"
                                      }
                                    ]
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "required": [
                                  "kind",
                                  "amount",
                                  "currency",
                                  "target"
                                ],
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "payment"
                                  },
                                  "amount": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 40
                                  },
                                  "currency": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 12
                                  },
                                  "target": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "required": [
                                  "kind",
                                  "target",
                                  "visibility"
                                ],
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "external-post"
                                  },
                                  "target": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "visibility": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "const": "public"
                                      },
                                      {
                                        "type": "string",
                                        "const": "restricted"
                                      }
                                    ]
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "required": [
                                  "kind",
                                  "automation",
                                  "command"
                                ],
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "standing-grant"
                                  },
                                  "automation": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "command": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 256
                                  },
                                  "expiresInDays": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 3650
                                  }
                                },
                                "additionalProperties": false
                              }
                            ]
                          },
                          "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"
                              }
                            ]
                          },
                          "scope": {
                            "anyOf": [
                              {
                                "type": "object",
                                "required": [
                                  "kind",
                                  "target",
                                  "recipientCount"
                                ],
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "message-send"
                                  },
                                  "target": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "recipientCount": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 1000000
                                  },
                                  "recipients": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 128
                                    },
                                    "maxItems": 5
                                  },
                                  "audience": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "const": "internal"
                                      },
                                      {
                                        "type": "string",
                                        "const": "external"
                                      }
                                    ]
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "required": [
                                  "kind",
                                  "amount",
                                  "currency",
                                  "target"
                                ],
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "payment"
                                  },
                                  "amount": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 40
                                  },
                                  "currency": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 12
                                  },
                                  "target": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "required": [
                                  "kind",
                                  "target",
                                  "visibility"
                                ],
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "external-post"
                                  },
                                  "target": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "visibility": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "const": "public"
                                      },
                                      {
                                        "type": "string",
                                        "const": "restricted"
                                      }
                                    ]
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "required": [
                                  "kind",
                                  "automation",
                                  "command"
                                ],
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "standing-grant"
                                  },
                                  "automation": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "command": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 256
                                  },
                                  "expiresInDays": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 3650
                                  }
                                },
                                "additionalProperties": false
                              }
                            ]
                          },
                          "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"
                              }
                            ]
                          },
                          "scope": {
                            "anyOf": [
                              {
                                "type": "object",
                                "required": [
                                  "kind",
                                  "target",
                                  "recipientCount"
                                ],
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "message-send"
                                  },
                                  "target": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "recipientCount": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 1000000
                                  },
                                  "recipients": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 128
                                    },
                                    "maxItems": 5
                                  },
                                  "audience": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "const": "internal"
                                      },
                                      {
                                        "type": "string",
                                        "const": "external"
                                      }
                                    ]
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "required": [
                                  "kind",
                                  "amount",
                                  "currency",
                                  "target"
                                ],
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "payment"
                                  },
                                  "amount": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 40
                                  },
                                  "currency": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 12
                                  },
                                  "target": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "required": [
                                  "kind",
                                  "target",
                                  "visibility"
                                ],
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "external-post"
                                  },
                                  "target": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "visibility": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "const": "public"
                                      },
                                      {
                                        "type": "string",
                                        "const": "restricted"
                                      }
                                    ]
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "required": [
                                  "kind",
                                  "automation",
                                  "command"
                                ],
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "standing-grant"
                                  },
                                  "automation": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "command": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 256
                                  },
                                  "expiresInDays": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 3650
                                  }
                                },
                                "additionalProperties": false
                              }
                            ]
                          },
                          "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"
                              }
                            ]
                          },
                          "scope": {
                            "anyOf": [
                              {
                                "type": "object",
                                "required": [
                                  "kind",
                                  "target",
                                  "recipientCount"
                                ],
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "message-send"
                                  },
                                  "target": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "recipientCount": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 1000000
                                  },
                                  "recipients": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 128
                                    },
                                    "maxItems": 5
                                  },
                                  "audience": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "const": "internal"
                                      },
                                      {
                                        "type": "string",
                                        "const": "external"
                                      }
                                    ]
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "required": [
                                  "kind",
                                  "amount",
                                  "currency",
                                  "target"
                                ],
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "payment"
                                  },
                                  "amount": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 40
                                  },
                                  "currency": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 12
                                  },
                                  "target": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "required": [
                                  "kind",
                                  "target",
                                  "visibility"
                                ],
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "external-post"
                                  },
                                  "target": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "visibility": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "const": "public"
                                      },
                                      {
                                        "type": "string",
                                        "const": "restricted"
                                      }
                                    ]
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "required": [
                                  "kind",
                                  "automation",
                                  "command"
                                ],
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "standing-grant"
                                  },
                                  "automation": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "command": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 256
                                  },
                                  "expiresInDays": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 3650
                                  }
                                },
                                "additionalProperties": false
                              }
                            ]
                          },
                          "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"
                              }
                            ]
                          },
                          "scope": {
                            "anyOf": [
                              {
                                "type": "object",
                                "required": [
                                  "kind",
                                  "target",
                                  "recipientCount"
                                ],
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "message-send"
                                  },
                                  "target": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "recipientCount": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 1000000
                                  },
                                  "recipients": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 128
                                    },
                                    "maxItems": 5
                                  },
                                  "audience": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "const": "internal"
                                      },
                                      {
                                        "type": "string",
                                        "const": "external"
                                      }
                                    ]
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "required": [
                                  "kind",
                                  "amount",
                                  "currency",
                                  "target"
                                ],
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "payment"
                                  },
                                  "amount": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 40
                                  },
                                  "currency": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 12
                                  },
                                  "target": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "required": [
                                  "kind",
                                  "target",
                                  "visibility"
                                ],
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "external-post"
                                  },
                                  "target": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "visibility": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "const": "public"
                                      },
                                      {
                                        "type": "string",
                                        "const": "restricted"
                                      }
                                    ]
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "required": [
                                  "kind",
                                  "automation",
                                  "command"
                                ],
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "standing-grant"
                                  },
                                  "automation": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "command": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 256
                                  },
                                  "expiresInDays": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 3650
                                  }
                                },
                                "additionalProperties": false
                              }
                            ]
                          },
                          "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"
                              }
                            ]
                          },
                          "scope": {
                            "anyOf": [
                              {
                                "type": "object",
                                "required": [
                                  "kind",
                                  "target",
                                  "recipientCount"
                                ],
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "message-send"
                                  },
                                  "target": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "recipientCount": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 1000000
                                  },
                                  "recipients": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 128
                                    },
                                    "maxItems": 5
                                  },
                                  "audience": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "const": "internal"
                                      },
                                      {
                                        "type": "string",
                                        "const": "external"
                                      }
                                    ]
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "required": [
                                  "kind",
                                  "amount",
                                  "currency",
                                  "target"
                                ],
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "payment"
                                  },
                                  "amount": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 40
                                  },
                                  "currency": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 12
                                  },
                                  "target": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "required": [
                                  "kind",
                                  "target",
                                  "visibility"
                                ],
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "external-post"
                                  },
                                  "target": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "visibility": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "const": "public"
                                      },
                                      {
                                        "type": "string",
                                        "const": "restricted"
                                      }
                                    ]
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "required": [
                                  "kind",
                                  "automation",
                                  "command"
                                ],
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "standing-grant"
                                  },
                                  "automation": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "command": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 256
                                  },
                                  "expiresInDays": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 3650
                                  }
                                },
                                "additionalProperties": false
                              }
                            ]
                          },
                          "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"
                              }
                            ]
                          },
                          "scope": {
                            "anyOf": [
                              {
                                "type": "object",
                                "required": [
                                  "kind",
                                  "target",
                                  "recipientCount"
                                ],
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "message-send"
                                  },
                                  "target": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "recipientCount": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 1000000
                                  },
                                  "recipients": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 128
                                    },
                                    "maxItems": 5
                                  },
                                  "audience": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "const": "internal"
                                      },
                                      {
                                        "type": "string",
                                        "const": "external"
                                      }
                                    ]
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "required": [
                                  "kind",
                                  "amount",
                                  "currency",
                                  "target"
                                ],
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "payment"
                                  },
                                  "amount": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 40
                                  },
                                  "currency": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 12
                                  },
                                  "target": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "required": [
                                  "kind",
                                  "target",
                                  "visibility"
                                ],
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "external-post"
                                  },
                                  "target": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "visibility": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "const": "public"
                                      },
                                      {
                                        "type": "string",
                                        "const": "restricted"
                                      }
                                    ]
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "required": [
                                  "kind",
                                  "automation",
                                  "command"
                                ],
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "standing-grant"
                                  },
                                  "automation": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "command": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 256
                                  },
                                  "expiresInDays": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 3650
                                  }
                                },
                                "additionalProperties": false
                              }
                            ]
                          },
                          "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"
                              }
                            ]
                          },
                          "scope": {
                            "anyOf": [
                              {
                                "type": "object",
                                "required": [
                                  "kind",
                                  "target",
                                  "recipientCount"
                                ],
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "message-send"
                                  },
                                  "target": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "recipientCount": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 1000000
                                  },
                                  "recipients": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 128
                                    },
                                    "maxItems": 5
                                  },
                                  "audience": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "const": "internal"
                                      },
                                      {
                                        "type": "string",
                                        "const": "external"
                                      }
                                    ]
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "required": [
                                  "kind",
                                  "amount",
                                  "currency",
                                  "target"
                                ],
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "payment"
                                  },
                                  "amount": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 40
                                  },
                                  "currency": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 12
                                  },
                                  "target": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "required": [
                                  "kind",
                                  "target",
                                  "visibility"
                                ],
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "external-post"
                                  },
                                  "target": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "visibility": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "const": "public"
                                      },
                                      {
                                        "type": "string",
                                        "const": "restricted"
                                      }
                                    ]
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "required": [
                                  "kind",
                                  "automation",
                                  "command"
                                ],
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "standing-grant"
                                  },
                                  "automation": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "command": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 256
                                  },
                                  "expiresInDays": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 3650
                                  }
                                },
                                "additionalProperties": false
                              }
                            ]
                          },
                          "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"
            }
          ]
        },
        "reviewer": {
          "type": "object",
          "required": [
            "channel",
            "accountId",
            "senderId"
          ],
          "properties": {
            "channel": {
              "type": "string",
              "minLength": 1
            },
            "accountId": {
              "type": "string",
              "minLength": 1
            },
            "senderId": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        "grantExpiresInDays": {
          "type": "integer",
          "minimum": 1,
          "maximum": 3650
        }
      },
      "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"
                            }
                          ]
                        },
                        "scope": {
                          "anyOf": [
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "recipientCount"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "message-send"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "recipientCount": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 1000000
                                },
                                "recipients": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "maxItems": 5
                                },
                                "audience": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "internal"
                                    },
                                    {
                                      "type": "string",
                                      "const": "external"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "amount",
                                "currency",
                                "target"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "payment"
                                },
                                "amount": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 40
                                },
                                "currency": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 12
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "visibility"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "external-post"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "visibility": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "public"
                                    },
                                    {
                                      "type": "string",
                                      "const": "restricted"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "automation",
                                "command"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "standing-grant"
                                },
                                "automation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "command": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 256
                                },
                                "expiresInDays": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 3650
                                }
                              },
                              "additionalProperties": false
                            }
                          ]
                        },
                        "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"
                            }
                          ]
                        },
                        "scope": {
                          "anyOf": [
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "recipientCount"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "message-send"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "recipientCount": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 1000000
                                },
                                "recipients": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "maxItems": 5
                                },
                                "audience": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "internal"
                                    },
                                    {
                                      "type": "string",
                                      "const": "external"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "amount",
                                "currency",
                                "target"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "payment"
                                },
                                "amount": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 40
                                },
                                "currency": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 12
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "visibility"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "external-post"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "visibility": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "public"
                                    },
                                    {
                                      "type": "string",
                                      "const": "restricted"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "automation",
                                "command"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "standing-grant"
                                },
                                "automation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "command": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 256
                                },
                                "expiresInDays": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 3650
                                }
                              },
                              "additionalProperties": false
                            }
                          ]
                        },
                        "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"
                            }
                          ]
                        },
                        "scope": {
                          "anyOf": [
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "recipientCount"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "message-send"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "recipientCount": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 1000000
                                },
                                "recipients": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "maxItems": 5
                                },
                                "audience": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "internal"
                                    },
                                    {
                                      "type": "string",
                                      "const": "external"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "amount",
                                "currency",
                                "target"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "payment"
                                },
                                "amount": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 40
                                },
                                "currency": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 12
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "visibility"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "external-post"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "visibility": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "public"
                                    },
                                    {
                                      "type": "string",
                                      "const": "restricted"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "automation",
                                "command"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "standing-grant"
                                },
                                "automation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "command": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 256
                                },
                                "expiresInDays": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 3650
                                }
                              },
                              "additionalProperties": false
                            }
                          ]
                        },
                        "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"
                            }
                          ]
                        },
                        "scope": {
                          "anyOf": [
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "recipientCount"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "message-send"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "recipientCount": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 1000000
                                },
                                "recipients": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "maxItems": 5
                                },
                                "audience": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "internal"
                                    },
                                    {
                                      "type": "string",
                                      "const": "external"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "amount",
                                "currency",
                                "target"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "payment"
                                },
                                "amount": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 40
                                },
                                "currency": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 12
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "visibility"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "external-post"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "visibility": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "public"
                                    },
                                    {
                                      "type": "string",
                                      "const": "restricted"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "automation",
                                "command"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "standing-grant"
                                },
                                "automation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "command": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 256
                                },
                                "expiresInDays": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 3650
                                }
                              },
                              "additionalProperties": false
                            }
                          ]
                        },
                        "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"
                            }
                          ]
                        },
                        "scope": {
                          "anyOf": [
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "recipientCount"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "message-send"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "recipientCount": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 1000000
                                },
                                "recipients": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "maxItems": 5
                                },
                                "audience": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "internal"
                                    },
                                    {
                                      "type": "string",
                                      "const": "external"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "amount",
                                "currency",
                                "target"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "payment"
                                },
                                "amount": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 40
                                },
                                "currency": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 12
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "visibility"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "external-post"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "visibility": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "public"
                                    },
                                    {
                                      "type": "string",
                                      "const": "restricted"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "automation",
                                "command"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "standing-grant"
                                },
                                "automation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "command": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 256
                                },
                                "expiresInDays": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 3650
                                }
                              },
                              "additionalProperties": false
                            }
                          ]
                        },
                        "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"
                            }
                          ]
                        },
                        "scope": {
                          "anyOf": [
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "recipientCount"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "message-send"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "recipientCount": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 1000000
                                },
                                "recipients": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "maxItems": 5
                                },
                                "audience": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "internal"
                                    },
                                    {
                                      "type": "string",
                                      "const": "external"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "amount",
                                "currency",
                                "target"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "payment"
                                },
                                "amount": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 40
                                },
                                "currency": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 12
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "visibility"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "external-post"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "visibility": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "public"
                                    },
                                    {
                                      "type": "string",
                                      "const": "restricted"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "automation",
                                "command"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "standing-grant"
                                },
                                "automation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "command": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 256
                                },
                                "expiresInDays": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 3650
                                }
                              },
                              "additionalProperties": false
                            }
                          ]
                        },
                        "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"
                            }
                          ]
                        },
                        "scope": {
                          "anyOf": [
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "recipientCount"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "message-send"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "recipientCount": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 1000000
                                },
                                "recipients": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "maxItems": 5
                                },
                                "audience": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "internal"
                                    },
                                    {
                                      "type": "string",
                                      "const": "external"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "amount",
                                "currency",
                                "target"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "payment"
                                },
                                "amount": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 40
                                },
                                "currency": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 12
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "visibility"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "external-post"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "visibility": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "public"
                                    },
                                    {
                                      "type": "string",
                                      "const": "restricted"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "automation",
                                "command"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "standing-grant"
                                },
                                "automation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "command": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 256
                                },
                                "expiresInDays": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 3650
                                }
                              },
                              "additionalProperties": false
                            }
                          ]
                        },
                        "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"
                            }
                          ]
                        },
                        "scope": {
                          "anyOf": [
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "recipientCount"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "message-send"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "recipientCount": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 1000000
                                },
                                "recipients": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "maxItems": 5
                                },
                                "audience": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "internal"
                                    },
                                    {
                                      "type": "string",
                                      "const": "external"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "amount",
                                "currency",
                                "target"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "payment"
                                },
                                "amount": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 40
                                },
                                "currency": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 12
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "visibility"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "external-post"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "visibility": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "public"
                                    },
                                    {
                                      "type": "string",
                                      "const": "restricted"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "automation",
                                "command"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "standing-grant"
                                },
                                "automation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "command": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 256
                                },
                                "expiresInDays": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 3650
                                }
                              },
                              "additionalProperties": false
                            }
                          ]
                        },
                        "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"
                        }
                      ]
                    },
                    "scope": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "target",
                            "recipientCount"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "message-send"
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "recipientCount": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 1000000
                            },
                            "recipients": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 128
                              },
                              "maxItems": 5
                            },
                            "audience": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "internal"
                                },
                                {
                                  "type": "string",
                                  "const": "external"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "amount",
                            "currency",
                            "target"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "payment"
                            },
                            "amount": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 40
                            },
                            "currency": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 12
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "target",
                            "visibility"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "external-post"
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "visibility": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "public"
                                },
                                {
                                  "type": "string",
                                  "const": "restricted"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "automation",
                            "command"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "standing-grant"
                            },
                            "automation": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "command": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 256
                            },
                            "expiresInDays": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 3650
                            }
                          },
                          "additionalProperties": false
                        }
                      ]
                    },
                    "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"
                        }
                      ]
                    },
                    "scope": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "target",
                            "recipientCount"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "message-send"
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "recipientCount": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 1000000
                            },
                            "recipients": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 128
                              },
                              "maxItems": 5
                            },
                            "audience": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "internal"
                                },
                                {
                                  "type": "string",
                                  "const": "external"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "amount",
                            "currency",
                            "target"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "payment"
                            },
                            "amount": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 40
                            },
                            "currency": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 12
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "target",
                            "visibility"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "external-post"
                            },
                            "target": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "visibility": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "const": "public"
                                },
                                {
                                  "type": "string",
                                  "const": "restricted"
                                }
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "automation",
                            "command"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "standing-grant"
                            },
                            "automation": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 128
                            },
                            "command": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 256
                            },
                            "expiresInDays": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 3650
                            }
                          },
                          "additionalProperties": false
                        }
                      ]
                    },
                    "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"
            },
            "sourceSessionKey": {
              "type": "string",
              "minLength": 1
            }
          },
          "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"
                            }
                          ]
                        },
                        "scope": {
                          "anyOf": [
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "recipientCount"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "message-send"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "recipientCount": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 1000000
                                },
                                "recipients": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "maxItems": 5
                                },
                                "audience": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "internal"
                                    },
                                    {
                                      "type": "string",
                                      "const": "external"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "amount",
                                "currency",
                                "target"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "payment"
                                },
                                "amount": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 40
                                },
                                "currency": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 12
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "visibility"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "external-post"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "visibility": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "public"
                                    },
                                    {
                                      "type": "string",
                                      "const": "restricted"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "automation",
                                "command"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "standing-grant"
                                },
                                "automation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "command": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 256
                                },
                                "expiresInDays": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 3650
                                }
                              },
                              "additionalProperties": false
                            }
                          ]
                        },
                        "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"
                            }
                          ]
                        },
                        "scope": {
                          "anyOf": [
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "recipientCount"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "message-send"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "recipientCount": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 1000000
                                },
                                "recipients": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "maxItems": 5
                                },
                                "audience": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "internal"
                                    },
                                    {
                                      "type": "string",
                                      "const": "external"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "amount",
                                "currency",
                                "target"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "payment"
                                },
                                "amount": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 40
                                },
                                "currency": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 12
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "visibility"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "external-post"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "visibility": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "public"
                                    },
                                    {
                                      "type": "string",
                                      "const": "restricted"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "automation",
                                "command"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "standing-grant"
                                },
                                "automation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "command": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 256
                                },
                                "expiresInDays": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 3650
                                }
                              },
                              "additionalProperties": false
                            }
                          ]
                        },
                        "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"
                            }
                          ]
                        },
                        "scope": {
                          "anyOf": [
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "recipientCount"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "message-send"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "recipientCount": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 1000000
                                },
                                "recipients": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "maxItems": 5
                                },
                                "audience": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "internal"
                                    },
                                    {
                                      "type": "string",
                                      "const": "external"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "amount",
                                "currency",
                                "target"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "payment"
                                },
                                "amount": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 40
                                },
                                "currency": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 12
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "visibility"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "external-post"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "visibility": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "public"
                                    },
                                    {
                                      "type": "string",
                                      "const": "restricted"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "automation",
                                "command"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "standing-grant"
                                },
                                "automation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "command": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 256
                                },
                                "expiresInDays": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 3650
                                }
                              },
                              "additionalProperties": false
                            }
                          ]
                        },
                        "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"
                            }
                          ]
                        },
                        "scope": {
                          "anyOf": [
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "recipientCount"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "message-send"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "recipientCount": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 1000000
                                },
                                "recipients": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "maxItems": 5
                                },
                                "audience": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "internal"
                                    },
                                    {
                                      "type": "string",
                                      "const": "external"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "amount",
                                "currency",
                                "target"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "payment"
                                },
                                "amount": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 40
                                },
                                "currency": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 12
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "visibility"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "external-post"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "visibility": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "public"
                                    },
                                    {
                                      "type": "string",
                                      "const": "restricted"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "automation",
                                "command"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "standing-grant"
                                },
                                "automation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "command": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 256
                                },
                                "expiresInDays": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 3650
                                }
                              },
                              "additionalProperties": false
                            }
                          ]
                        },
                        "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"
                            }
                          ]
                        },
                        "scope": {
                          "anyOf": [
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "recipientCount"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "message-send"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "recipientCount": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 1000000
                                },
                                "recipients": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "maxItems": 5
                                },
                                "audience": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "internal"
                                    },
                                    {
                                      "type": "string",
                                      "const": "external"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "amount",
                                "currency",
                                "target"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "payment"
                                },
                                "amount": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 40
                                },
                                "currency": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 12
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "visibility"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "external-post"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "visibility": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "public"
                                    },
                                    {
                                      "type": "string",
                                      "const": "restricted"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "automation",
                                "command"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "standing-grant"
                                },
                                "automation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "command": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 256
                                },
                                "expiresInDays": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 3650
                                }
                              },
                              "additionalProperties": false
                            }
                          ]
                        },
                        "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"
                            }
                          ]
                        },
                        "scope": {
                          "anyOf": [
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "recipientCount"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "message-send"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "recipientCount": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 1000000
                                },
                                "recipients": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "maxItems": 5
                                },
                                "audience": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "internal"
                                    },
                                    {
                                      "type": "string",
                                      "const": "external"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "amount",
                                "currency",
                                "target"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "payment"
                                },
                                "amount": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 40
                                },
                                "currency": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 12
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "visibility"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "external-post"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "visibility": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "public"
                                    },
                                    {
                                      "type": "string",
                                      "const": "restricted"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "automation",
                                "command"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "standing-grant"
                                },
                                "automation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "command": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 256
                                },
                                "expiresInDays": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 3650
                                }
                              },
                              "additionalProperties": false
                            }
                          ]
                        },
                        "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"
                            }
                          ]
                        },
                        "scope": {
                          "anyOf": [
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "recipientCount"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "message-send"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "recipientCount": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 1000000
                                },
                                "recipients": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "maxItems": 5
                                },
                                "audience": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "internal"
                                    },
                                    {
                                      "type": "string",
                                      "const": "external"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "amount",
                                "currency",
                                "target"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "payment"
                                },
                                "amount": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 40
                                },
                                "currency": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 12
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "visibility"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "external-post"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "visibility": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "public"
                                    },
                                    {
                                      "type": "string",
                                      "const": "restricted"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "automation",
                                "command"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "standing-grant"
                                },
                                "automation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "command": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 256
                                },
                                "expiresInDays": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 3650
                                }
                              },
                              "additionalProperties": false
                            }
                          ]
                        },
                        "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"
                            }
                          ]
                        },
                        "scope": {
                          "anyOf": [
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "recipientCount"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "message-send"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "recipientCount": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 1000000
                                },
                                "recipients": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "maxItems": 5
                                },
                                "audience": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "internal"
                                    },
                                    {
                                      "type": "string",
                                      "const": "external"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "amount",
                                "currency",
                                "target"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "payment"
                                },
                                "amount": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 40
                                },
                                "currency": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 12
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "visibility"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "external-post"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "visibility": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "public"
                                    },
                                    {
                                      "type": "string",
                                      "const": "restricted"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "automation",
                                "command"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "standing-grant"
                                },
                                "automation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "command": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 256
                                },
                                "expiresInDays": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 3650
                                }
                              },
                              "additionalProperties": false
                            }
                          ]
                        },
                        "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"
                            }
                          ]
                        },
                        "scope": {
                          "anyOf": [
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "recipientCount"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "message-send"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "recipientCount": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 1000000
                                },
                                "recipients": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "maxItems": 5
                                },
                                "audience": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "internal"
                                    },
                                    {
                                      "type": "string",
                                      "const": "external"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "amount",
                                "currency",
                                "target"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "payment"
                                },
                                "amount": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 40
                                },
                                "currency": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 12
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "visibility"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "external-post"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "visibility": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "public"
                                    },
                                    {
                                      "type": "string",
                                      "const": "restricted"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "automation",
                                "command"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "standing-grant"
                                },
                                "automation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "command": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 256
                                },
                                "expiresInDays": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 3650
                                }
                              },
                              "additionalProperties": false
                            }
                          ]
                        },
                        "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"
                            }
                          ]
                        },
                        "scope": {
                          "anyOf": [
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "recipientCount"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "message-send"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "recipientCount": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 1000000
                                },
                                "recipients": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 128
                                  },
                                  "maxItems": 5
                                },
                                "audience": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "internal"
                                    },
                                    {
                                      "type": "string",
                                      "const": "external"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "amount",
                                "currency",
                                "target"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "payment"
                                },
                                "amount": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 40
                                },
                                "currency": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 12
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "target",
                                "visibility"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "external-post"
                                },
                                "target": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "visibility": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "const": "public"
                                    },
                                    {
                                      "type": "string",
                                      "const": "restricted"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "kind",
                                "automation",
                                "command"
                              ],
                              "properties": {
                                "kind": {
                                  "type": "string",
                                  "const": "standing-grant"
                                },
                                "automation": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "command": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 256
                                },
                                "expiresInDays": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 3650
                                }
                              },
                              "additionalProperties": false
                            }
                          ]
                        },
                        "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"
                },
                "sourceSessionKey": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "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"
                                }
                              ]
                            },
                            "scope": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "required": [
                                    "kind",
                                    "target",
                                    "recipientCount"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "message-send"
                                    },
                                    "target": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 128
                                    },
                                    "recipientCount": {
                                      "type": "integer",
                                      "minimum": 1,
                                      "maximum": 1000000
                                    },
                                    "recipients": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 128
                                      },
                                      "maxItems": 5
                                    },
                                    "audience": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "const": "internal"
                                        },
                                        {
                                          "type": "string",
                                          "const": "external"
                                        }
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "required": [
                                    "kind",
                                    "amount",
                                    "currency",
                                    "target"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "payment"
                                    },
                                    "amount": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 40
                                    },
                                    "currency": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 12
                                    },
                                    "target": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 128
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "required": [
                                    "kind",
                                    "target",
                                    "visibility"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "external-post"
                                    },
                                    "target": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 128
                                    },
                                    "visibility": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "const": "public"
                                        },
                                        {
                                          "type": "string",
                                          "const": "restricted"
                                        }
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "required": [
                                    "kind",
                                    "automation",
                                    "command"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "standing-grant"
                                    },
                                    "automation": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 128
                                    },
                                    "command": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 256
                                    },
                                    "expiresInDays": {
                                      "type": "integer",
                                      "minimum": 1,
                                      "maximum": 3650
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              ]
                            },
                            "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"
                                }
                              ]
                            },
                            "scope": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "required": [
                                    "kind",
                                    "target",
                                    "recipientCount"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "message-send"
                                    },
                                    "target": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 128
                                    },
                                    "recipientCount": {
                                      "type": "integer",
                                      "minimum": 1,
                                      "maximum": 1000000
                                    },
                                    "recipients": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 128
                                      },
                                      "maxItems": 5
                                    },
                                    "audience": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "const": "internal"
                                        },
                                        {
                                          "type": "string",
                                          "const": "external"
                                        }
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "required": [
                                    "kind",
                                    "amount",
                                    "currency",
                                    "target"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "payment"
                                    },
                                    "amount": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 40
                                    },
                                    "currency": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 12
                                    },
                                    "target": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 128
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "required": [
                                    "kind",
                                    "target",
                                    "visibility"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "external-post"
                                    },
                                    "target": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 128
                                    },
                                    "visibility": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "const": "public"
                                        },
                                        {
                                          "type": "string",
                                          "const": "restricted"
                                        }
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "required": [
                                    "kind",
                                    "automation",
                                    "command"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "standing-grant"
                                    },
                                    "automation": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 128
                                    },
                                    "command": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 256
                                    },
                                    "expiresInDays": {
                                      "type": "integer",
                                      "minimum": 1,
                                      "maximum": 3650
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              ]
                            },
                            "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"
                                }
                              ]
                            },
                            "scope": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "required": [
                                    "kind",
                                    "target",
                                    "recipientCount"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "message-send"
                                    },
                                    "target": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 128
                                    },
                                    "recipientCount": {
                                      "type": "integer",
                                      "minimum": 1,
                                      "maximum": 1000000
                                    },
                                    "recipients": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 128
                                      },
                                      "maxItems": 5
                                    },
                                    "audience": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "const": "internal"
                                        },
                                        {
                                          "type": "string",
                                          "const": "external"
                                        }
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "required": [
                                    "kind",
                                    "amount",
                                    "currency",
                                    "target"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "payment"
                                    },
                                    "amount": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 40
                                    },
                                    "currency": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 12
                                    },
                                    "target": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 128
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "required": [
                                    "kind",
                                    "target",
                                    "visibility"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "external-post"
                                    },
                                    "target": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 128
                                    },
                                    "visibility": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "const": "public"
                                        },
                                        {
                                          "type": "string",
                                          "const": "restricted"
                                        }
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "required": [
                                    "kind",
                                    "automation",
                                    "command"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "standing-grant"
                                    },
                                    "automation": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 128
                                    },
                                    "command": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 256
                                    },
                                    "expiresInDays": {
                                      "type": "integer",
                                      "minimum": 1,
                                      "maximum": 3650
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              ]
                            },
                            "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"
                                }
                              ]
                            },
                            "scope": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "required": [
                                    "kind",
                                    "target",
                                    "recipientCount"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "message-send"
                                    },
                                    "target": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 128
                                    },
                                    "recipientCount": {
                                      "type": "integer",
                                      "minimum": 1,
                                      "maximum": 1000000
                                    },
                                    "recipients": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 128
                                      },
                                      "maxItems": 5
                                    },
                                    "audience": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "const": "internal"
                                        },
                                        {
                                          "type": "string",
                                          "const": "external"
                                        }
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "required": [
                                    "kind",
                                    "amount",
                                    "currency",
                                    "target"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "payment"
                                    },
                                    "amount": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 40
                                    },
                                    "currency": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 12
                                    },
                                    "target": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 128
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "required": [
                                    "kind",
                                    "target",
                                    "visibility"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "external-post"
                                    },
                                    "target": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 128
                                    },
                                    "visibility": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "const": "public"
                                        },
                                        {
                                          "type": "string",
                                          "const": "restricted"
                                        }
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "required": [
                                    "kind",
                                    "automation",
                                    "command"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "standing-grant"
                                    },
                                    "automation": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 128
                                    },
                                    "command": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 256
                                    },
                                    "expiresInDays": {
                                      "type": "integer",
                                      "minimum": 1,
                                      "maximum": 3650
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              ]
                            },
                            "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"
                                }
                              ]
                            },
                            "scope": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "required": [
                                    "kind",
                                    "target",
                                    "recipientCount"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "message-send"
                                    },
                                    "target": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 128
                                    },
                                    "recipientCount": {
                                      "type": "integer",
                                      "minimum": 1,
                                      "maximum": 1000000
                                    },
                                    "recipients": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 128
                                      },
                                      "maxItems": 5
                                    },
                                    "audience": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "const": "internal"
                                        },
                                        {
                                          "type": "string",
                                          "const": "external"
                                        }
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "required": [
                                    "kind",
                                    "amount",
                                    "currency",
                                    "target"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "payment"
                                    },
                                    "amount": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 40
                                    },
                                    "currency": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 12
                                    },
                                    "target": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 128
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "required": [
                                    "kind",
                                    "target",
                                    "visibility"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "external-post"
                                    },
                                    "target": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 128
                                    },
                                    "visibility": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "const": "public"
                                        },
                                        {
                                          "type": "string",
                                          "const": "restricted"
                                        }
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "required": [
                                    "kind",
                                    "automation",
                                    "command"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "standing-grant"
                                    },
                                    "automation": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 128
                                    },
                                    "command": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 256
                                    },
                                    "expiresInDays": {
                                      "type": "integer",
                                      "minimum": 1,
                                      "maximum": 3650
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              ]
                            },
                            "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"
                                }
                              ]
                            },
                            "scope": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "required": [
                                    "kind",
                                    "target",
                                    "recipientCount"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "message-send"
                                    },
                                    "target": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 128
                                    },
                                    "recipientCount": {
                                      "type": "integer",
                                      "minimum": 1,
                                      "maximum": 1000000
                                    },
                                    "recipients": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 128
                                      },
                                      "maxItems": 5
                                    },
                                    "audience": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "const": "internal"
                                        },
                                        {
                                          "type": "string",
                                          "const": "external"
                                        }
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "required": [
                                    "kind",
                                    "amount",
                                    "currency",
                                    "target"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "payment"
                                    },
                                    "amount": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 40
                                    },
                                    "currency": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 12
                                    },
                                    "target": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 128
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "required": [
                                    "kind",
                                    "target",
                                    "visibility"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "external-post"
                                    },
                                    "target": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 128
                                    },
                                    "visibility": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "const": "public"
                                        },
                                        {
                                          "type": "string",
                                          "const": "restricted"
                                        }
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "required": [
                                    "kind",
                                    "automation",
                                    "command"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "standing-grant"
                                    },
                                    "automation": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 128
                                    },
                                    "command": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 256
                                    },
                                    "expiresInDays": {
                                      "type": "integer",
                                      "minimum": 1,
                                      "maximum": 3650
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              ]
                            },
                            "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"
                                }
                              ]
                            },
                            "scope": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "required": [
                                    "kind",
                                    "target",
                                    "recipientCount"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "message-send"
                                    },
                                    "target": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 128
                                    },
                                    "recipientCount": {
                                      "type": "integer",
                                      "minimum": 1,
                                      "maximum": 1000000
                                    },
                                    "recipients": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 128
                                      },
                                      "maxItems": 5
                                    },
                                    "audience": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "const": "internal"
                                        },
                                        {
                                          "type": "string",
                                          "const": "external"
                                        }
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "required": [
                                    "kind",
                                    "amount",
                                    "currency",
                                    "target"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "payment"
                                    },
                                    "amount": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 40
                                    },
                                    "currency": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 12
                                    },
                                    "target": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 128
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "required": [
                                    "kind",
                                    "target",
                                    "visibility"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "external-post"
                                    },
                                    "target": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 128
                                    },
                                    "visibility": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "const": "public"
                                        },
                                        {
                                          "type": "string",
                                          "const": "restricted"
                                        }
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "required": [
                                    "kind",
                                    "automation",
                                    "command"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "standing-grant"
                                    },
                                    "automation": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 128
                                    },
                                    "command": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 256
                                    },
                                    "expiresInDays": {
                                      "type": "integer",
                                      "minimum": 1,
                                      "maximum": 3650
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              ]
                            },
                            "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"
                                }
                              ]
                            },
                            "scope": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "required": [
                                    "kind",
                                    "target",
                                    "recipientCount"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "message-send"
                                    },
                                    "target": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 128
                                    },
                                    "recipientCount": {
                                      "type": "integer",
                                      "minimum": 1,
                                      "maximum": 1000000
                                    },
                                    "recipients": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 128
                                      },
                                      "maxItems": 5
                                    },
                                    "audience": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "const": "internal"
                                        },
                                        {
                                          "type": "string",
                                          "const": "external"
                                        }
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "required": [
                                    "kind",
                                    "amount",
                                    "currency",
                                    "target"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "payment"
                                    },
                                    "amount": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 40
                                    },
                                    "currency": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 12
                                    },
                                    "target": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 128
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "required": [
                                    "kind",
                                    "target",
                                    "visibility"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "external-post"
                                    },
                                    "target": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 128
                                    },
                                    "visibility": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "const": "public"
                                        },
                                        {
                                          "type": "string",
                                          "const": "restricted"
                                        }
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "required": [
                                    "kind",
                                    "automation",
                                    "command"
                                  ],
                                  "properties": {
                                    "kind": {
                                      "type": "string",
                                      "const": "standing-grant"
                                    },
                                    "automation": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 128
                                    },
                                    "command": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 256
                                    },
                                    "expiresInDays": {
                                      "type": "integer",
                                      "minimum": 1,
                                      "maximum": 3650
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              ]
                            },
                            "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"
                          }
                        ]
                      },
                      "scope": {
                        "anyOf": [
                          {
                            "type": "object",
                            "required": [
                              "kind",
                              "target",
                              "recipientCount"
                            ],
                            "properties": {
                              "kind": {
                                "type": "string",
                                "const": "message-send"
                              },
                              "target": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 128
                              },
                              "recipientCount": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 1000000
                              },
                              "recipients": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "maxItems": 5
                              },
                              "audience": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "const": "internal"
                                  },
                                  {
                                    "type": "string",
                                    "const": "external"
                                  }
                                ]
                              }
                            },
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "required": [
                              "kind",
                              "amount",
                              "currency",
                              "target"
                            ],
                            "properties": {
                              "kind": {
                                "type": "string",
                                "const": "payment"
                              },
                              "amount": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 40
                              },
                              "currency": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 12
                              },
                              "target": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 128
                              }
                            },
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "required": [
                              "kind",
                              "target",
                              "visibility"
                            ],
                            "properties": {
                              "kind": {
                                "type": "string",
                                "const": "external-post"
                              },
                              "target": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 128
                              },
                              "visibility": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "const": "public"
                                  },
                                  {
                                    "type": "string",
                                    "const": "restricted"
                                  }
                                ]
                              }
                            },
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "required": [
                              "kind",
                              "automation",
                              "command"
                            ],
                            "properties": {
                              "kind": {
                                "type": "string",
                                "const": "standing-grant"
                              },
                              "automation": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 128
                              },
                              "command": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 256
                              },
                              "expiresInDays": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 3650
                              }
                            },
                            "additionalProperties": false
                          }
                        ]
                      },
                      "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"
                          }
                        ]
                      },
                      "scope": {
                        "anyOf": [
                          {
                            "type": "object",
                            "required": [
                              "kind",
                              "target",
                              "recipientCount"
                            ],
                            "properties": {
                              "kind": {
                                "type": "string",
                                "const": "message-send"
                              },
                              "target": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 128
                              },
                              "recipientCount": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 1000000
                              },
                              "recipients": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "maxItems": 5
                              },
                              "audience": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "const": "internal"
                                  },
                                  {
                                    "type": "string",
                                    "const": "external"
                                  }
                                ]
                              }
                            },
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "required": [
                              "kind",
                              "amount",
                              "currency",
                              "target"
                            ],
                            "properties": {
                              "kind": {
                                "type": "string",
                                "const": "payment"
                              },
                              "amount": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 40
                              },
                              "currency": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 12
                              },
                              "target": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 128
                              }
                            },
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "required": [
                              "kind",
                              "target",
                              "visibility"
                            ],
                            "properties": {
                              "kind": {
                                "type": "string",
                                "const": "external-post"
                              },
                              "target": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 128
                              },
                              "visibility": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "const": "public"
                                  },
                                  {
                                    "type": "string",
                                    "const": "restricted"
                                  }
                                ]
                              }
                            },
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "required": [
                              "kind",
                              "automation",
                              "command"
                            ],
                            "properties": {
                              "kind": {
                                "type": "string",
                                "const": "standing-grant"
                              },
                              "automation": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 128
                              },
                              "command": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 256
                              },
                              "expiresInDays": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 3650
                              }
                            },
                            "additionalProperties": false
                          }
                        ]
                      },
                      "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"
              },
              "sourceSessionKey": {
                "type": "string",
                "minLength": 1
              }
            },
            "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
        },
        "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
        }
      },
      "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"
            }
          ]
        },
        "scope": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "kind",
                "target",
                "recipientCount"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "message-send"
                },
                "target": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                },
                "recipientCount": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 1000000
                },
                "recipients": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "maxItems": 5
                },
                "audience": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "internal"
                    },
                    {
                      "type": "string",
                      "const": "external"
                    }
                  ]
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "kind",
                "amount",
                "currency",
                "target"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "payment"
                },
                "amount": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 40
                },
                "currency": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 12
                },
                "target": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "kind",
                "target",
                "visibility"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "external-post"
                },
                "target": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                },
                "visibility": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "public"
                    },
                    {
                      "type": "string",
                      "const": "restricted"
                    }
                  ]
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "kind",
                "automation",
                "command"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "standing-grant"
                },
                "automation": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                },
                "command": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "expiresInDays": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 3650
                }
              },
              "additionalProperties": false
            }
          ]
        },
        "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"
        },
        "deliverToApprovalClientsOnly": {
          "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
        },
        "reviewer": {
          "type": "object",
          "required": [
            "channel",
            "accountId",
            "senderId"
          ],
          "properties": {
            "channel": {
              "type": "string",
              "minLength": 1
            },
            "accountId": {
              "type": "string",
              "minLength": 1
            },
            "senderId": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        "grantExpiresInDays": {
          "type": "integer",
          "minimum": 1,
          "maximum": 3650
        }
      },
      "additionalProperties": false
    },
    "ExecApprovalGrantsListParams": {
      "type": "object",
      "properties": {
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 500
        }
      },
      "additionalProperties": false
    },
    "ExecApprovalStandingGrant": {
      "type": "object",
      "required": [
        "grantId",
        "mintedByApprovalId",
        "agentId",
        "cronJobId",
        "cronJobName",
        "command",
        "cwd",
        "createdAtMs",
        "expiresAtMs",
        "revokedAtMs",
        "revokedBy",
        "lastUsedAtMs",
        "useCount"
      ],
      "properties": {
        "grantId": {
          "type": "string",
          "minLength": 1
        },
        "mintedByApprovalId": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "cronJobId": {
          "type": "string",
          "minLength": 1
        },
        "cronJobName": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            {
              "type": "null"
            }
          ]
        },
        "command": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "cwd": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            },
            {
              "type": "null"
            }
          ]
        },
        "createdAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "expiresAtMs": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0
            },
            {
              "type": "null"
            }
          ]
        },
        "revokedAtMs": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0
            },
            {
              "type": "null"
            }
          ]
        },
        "revokedBy": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            {
              "type": "null"
            }
          ]
        },
        "lastUsedAtMs": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0
            },
            {
              "type": "null"
            }
          ]
        },
        "useCount": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "ExecApprovalGrantsListResult": {
      "type": "object",
      "required": [
        "grants"
      ],
      "properties": {
        "grants": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "grantId",
              "mintedByApprovalId",
              "agentId",
              "cronJobId",
              "cronJobName",
              "command",
              "cwd",
              "createdAtMs",
              "expiresAtMs",
              "revokedAtMs",
              "revokedBy",
              "lastUsedAtMs",
              "useCount"
            ],
            "properties": {
              "grantId": {
                "type": "string",
                "minLength": 1
              },
              "mintedByApprovalId": {
                "type": "string",
                "minLength": 1
              },
              "agentId": {
                "type": "string",
                "minLength": 1
              },
              "cronJobId": {
                "type": "string",
                "minLength": 1
              },
              "cronJobName": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "command": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512
              },
              "cwd": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "createdAtMs": {
                "type": "integer",
                "minimum": 0
              },
              "expiresAtMs": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "revokedAtMs": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "revokedBy": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "lastUsedAtMs": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "useCount": {
                "type": "integer",
                "minimum": 0
              }
            },
            "additionalProperties": false
          },
          "maxItems": 500
        }
      },
      "additionalProperties": false
    },
    "ExecApprovalGrantsRevokeParams": {
      "type": "object",
      "required": [
        "grantId"
      ],
      "properties": {
        "grantId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "ExecApprovalGrantsRevokeResult": {
      "type": "object",
      "required": [
        "outcome"
      ],
      "properties": {
        "outcome": {
          "anyOf": [
            {
              "type": "string",
              "const": "revoked"
            },
            {
              "type": "string",
              "const": "already-revoked"
            },
            {
              "type": "string",
              "const": "not-found"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "QuestionOption": {
      "type": "object",
      "required": [
        "label"
      ],
      "properties": {
        "label": {
          "type": "string",
          "minLength": 1
        },
        "description": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "QuestionSecretStoreBinding": {
      "type": "object",
      "required": [
        "name",
        "kind"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Z][A-Z0-9_]{0,127}$"
        },
        "kind": {
          "anyOf": [
            {
              "type": "string",
              "const": "secret"
            },
            {
              "type": "string",
              "const": "env"
            }
          ]
        },
        "allowedHosts": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 253
          },
          "maxItems": 128,
          "uniqueItems": true
        },
        "reason": {
          "type": "string",
          "maxLength": 200
        }
      },
      "additionalProperties": false,
      "x-openclaw-since": "2026.8"
    },
    "QuestionSecretStoreExisting": {
      "type": "object",
      "required": [
        "updatedAtMs"
      ],
      "properties": {
        "updatedAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "updatedBy": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false,
      "x-openclaw-since": "2026.8"
    },
    "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"
        },
        "secretStore": {
          "type": "object",
          "required": [
            "name",
            "kind"
          ],
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Z][A-Z0-9_]{0,127}$"
            },
            "kind": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "secret"
                },
                {
                  "type": "string",
                  "const": "env"
                }
              ]
            },
            "allowedHosts": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 253
              },
              "maxItems": 128,
              "uniqueItems": true
            },
            "reason": {
              "type": "string",
              "maxLength": 200
            }
          },
          "additionalProperties": false,
          "x-openclaw-since": "2026.8"
        },
        "secretStoreExisting": {
          "type": "object",
          "required": [
            "updatedAtMs"
          ],
          "properties": {
            "updatedAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "updatedBy": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false,
          "x-openclaw-since": "2026.8"
        }
      },
      "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"
        },
        "secretStore": {
          "type": "object",
          "required": [
            "name",
            "kind"
          ],
          "properties": {
            "name": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Z][A-Z0-9_]{0,127}$"
            },
            "kind": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "secret"
                },
                {
                  "type": "string",
                  "const": "env"
                }
              ]
            },
            "allowedHosts": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 253
              },
              "maxItems": 128,
              "uniqueItems": true
            },
            "reason": {
              "type": "string",
              "maxLength": 200
            }
          },
          "additionalProperties": false,
          "x-openclaw-since": "2026.8"
        }
      },
      "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"
              },
              "secretStore": {
                "type": "object",
                "required": [
                  "name",
                  "kind"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128,
                    "pattern": "^[A-Z][A-Z0-9_]{0,127}$"
                  },
                  "kind": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "secret"
                      },
                      {
                        "type": "string",
                        "const": "env"
                      }
                    ]
                  },
                  "allowedHosts": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 253
                    },
                    "maxItems": 128,
                    "uniqueItems": true
                  },
                  "reason": {
                    "type": "string",
                    "maxLength": 200
                  }
                },
                "additionalProperties": false,
                "x-openclaw-since": "2026.8"
              },
              "secretStoreExisting": {
                "type": "object",
                "required": [
                  "updatedAtMs"
                ],
                "properties": {
                  "updatedAtMs": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "updatedBy": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "additionalProperties": false,
                "x-openclaw-since": "2026.8"
              }
            },
            "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"
              },
              "secretStore": {
                "type": "object",
                "required": [
                  "name",
                  "kind"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128,
                    "pattern": "^[A-Z][A-Z0-9_]{0,127}$"
                  },
                  "kind": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "secret"
                      },
                      {
                        "type": "string",
                        "const": "env"
                      }
                    ]
                  },
                  "allowedHosts": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 253
                    },
                    "maxItems": 128,
                    "uniqueItems": true
                  },
                  "reason": {
                    "type": "string",
                    "maxLength": 200
                  }
                },
                "additionalProperties": false,
                "x-openclaw-since": "2026.8"
              }
            },
            "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
            },
            "secretStoreAllowedHosts": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 253
              },
              "maxItems": 128,
              "uniqueItems": true,
              "x-openclaw-since": "2026.8"
            },
            "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"
                  },
                  "secretStore": {
                    "type": "object",
                    "required": [
                      "name",
                      "kind"
                    ],
                    "properties": {
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128,
                        "pattern": "^[A-Z][A-Z0-9_]{0,127}$"
                      },
                      "kind": {
                        "anyOf": [
                          {
                            "type": "string",
                            "const": "secret"
                          },
                          {
                            "type": "string",
                            "const": "env"
                          }
                        ]
                      },
                      "allowedHosts": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 253
                        },
                        "maxItems": 128,
                        "uniqueItems": true
                      },
                      "reason": {
                        "type": "string",
                        "maxLength": 200
                      }
                    },
                    "additionalProperties": false,
                    "x-openclaw-since": "2026.8"
                  },
                  "secretStoreExisting": {
                    "type": "object",
                    "required": [
                      "updatedAtMs"
                    ],
                    "properties": {
                      "updatedAtMs": {
                        "type": "integer",
                        "minimum": 0
                      },
                      "updatedBy": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "additionalProperties": false,
                    "x-openclaw-since": "2026.8"
                  }
                },
                "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"
                    },
                    "secretStore": {
                      "type": "object",
                      "required": [
                        "name",
                        "kind"
                      ],
                      "properties": {
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128,
                          "pattern": "^[A-Z][A-Z0-9_]{0,127}$"
                        },
                        "kind": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "secret"
                            },
                            {
                              "type": "string",
                              "const": "env"
                            }
                          ]
                        },
                        "allowedHosts": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 253
                          },
                          "maxItems": 128,
                          "uniqueItems": true
                        },
                        "reason": {
                          "type": "string",
                          "maxLength": 200
                        }
                      },
                      "additionalProperties": false,
                      "x-openclaw-since": "2026.8"
                    },
                    "secretStoreExisting": {
                      "type": "object",
                      "required": [
                        "updatedAtMs"
                      ],
                      "properties": {
                        "updatedAtMs": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "updatedBy": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false,
                      "x-openclaw-since": "2026.8"
                    }
                  },
                  "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"
    },
    "CapabilityConsentErrorDetails": {
      "type": "object",
      "required": [
        "capabilityConsentCode",
        "pluginId",
        "reviewToken"
      ],
      "properties": {
        "capabilityConsentCode": {
          "type": "string",
          "const": "PLUGIN_CAPABILITY_CONSENT_REQUIRED"
        },
        "pluginId": {
          "type": "string",
          "minLength": 1
        },
        "reviewToken": {
          "type": "string",
          "minLength": 1
        },
        "widened": {
          "type": "object",
          "properties": {
            "channels": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "providers": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "tools": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "contracts": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "hooks": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "mcpServers": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "cliCommands": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "cliBackends": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "skills": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "dangerousConfigFlags": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              }
            }
          },
          "additionalProperties": false
        },
        "acceptedAt": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "HooksStatusParams": {
      "type": "object",
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "PluginApprovalRequestParams": {
      "type": "object",
      "required": [
        "title",
        "description"
      ],
      "properties": {
        "pluginId": {
          "type": [
            "string",
            "null"
          ],
          "minLength": 1
        },
        "title": {
          "type": "string",
          "minLength": 1,
          "maxLength": 80
        },
        "description": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        "detail": {
          "type": [
            "string",
            "null"
          ],
          "minLength": 1,
          "maxLength": 16384,
          "description": "Reviewer-surface-only detail; not delivered to channels or push notifications."
        },
        "severity": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "info",
            "warning",
            "critical",
            null
          ]
        },
        "scope": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "kind",
                "target",
                "recipientCount"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "message-send"
                },
                "target": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                },
                "recipientCount": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 1000000
                },
                "recipients": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "maxItems": 5
                },
                "audience": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "internal"
                    },
                    {
                      "type": "string",
                      "const": "external"
                    }
                  ]
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "kind",
                "amount",
                "currency",
                "target"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "payment"
                },
                "amount": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 40
                },
                "currency": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 12
                },
                "target": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "kind",
                "target",
                "visibility"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "external-post"
                },
                "target": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                },
                "visibility": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "public"
                    },
                    {
                      "type": "string",
                      "const": "restricted"
                    }
                  ]
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "kind",
                "automation",
                "command"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "standing-grant"
                },
                "automation": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                },
                "command": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "expiresInDays": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 3650
                }
              },
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ],
          "type": [
            "object",
            "null"
          ]
        },
        "toolName": {
          "type": [
            "string",
            "null"
          ]
        },
        "toolCallId": {
          "type": [
            "string",
            "null"
          ]
        },
        "allowedDecisions": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string",
            "enum": [
              "allow-once",
              "allow-always",
              "deny"
            ]
          },
          "minItems": 1,
          "maxItems": 3
        },
        "agentId": {
          "type": [
            "string",
            "null"
          ]
        },
        "sessionKey": {
          "type": [
            "string",
            "null"
          ]
        },
        "approvalReviewerDeviceIds": {
          "type": [
            "array",
            "null"
          ],
          "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",
            "null"
          ]
        },
        "turnSourceTo": {
          "type": [
            "string",
            "null"
          ]
        },
        "turnSourceAccountId": {
          "type": [
            "string",
            "null"
          ]
        },
        "turnSourceThreadId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "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
        },
        "reviewer": {
          "type": "object",
          "required": [
            "channel",
            "accountId",
            "senderId"
          ],
          "properties": {
            "channel": {
              "type": "string",
              "minLength": 1
            },
            "accountId": {
              "type": "string",
              "minLength": 1
            },
            "senderId": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        }
      },
      "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
    },
    "PluginDeclaredSurface": {
      "type": "object",
      "required": [
        "channels",
        "providers",
        "tools",
        "contracts",
        "hooks",
        "mcpServers",
        "cliCommands",
        "cliBackends",
        "skills",
        "dangerousConfigFlags"
      ],
      "properties": {
        "channels": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "providers": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "tools": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "contracts": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "hooks": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "mcpServers": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "cliCommands": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "cliBackends": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "skills": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "dangerousConfigFlags": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "additionalProperties": false
    },
    "PluginDeclaredSurfaceWidening": {
      "type": "object",
      "properties": {
        "channels": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "providers": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "tools": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "contracts": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "hooks": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "mcpServers": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "cliCommands": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "cliBackends": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "skills": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "dangerousConfigFlags": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "additionalProperties": false
    },
    "PluginHookGrant": {
      "type": "object",
      "required": [
        "effective"
      ],
      "properties": {
        "effective": {
          "type": "boolean"
        },
        "configured": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "PluginInspectSource": {
      "type": "object",
      "required": [
        "kind"
      ],
      "properties": {
        "kind": {
          "anyOf": [
            {
              "type": "string",
              "const": "bundled"
            },
            {
              "type": "string",
              "const": "clawhub"
            },
            {
              "type": "string",
              "const": "npm"
            },
            {
              "type": "string",
              "const": "git"
            },
            {
              "type": "string",
              "const": "path"
            },
            {
              "type": "string",
              "const": "archive"
            },
            {
              "type": "string",
              "const": "marketplace"
            },
            {
              "type": "string",
              "const": "official-catalog"
            }
          ]
        },
        "spec": {
          "type": "string",
          "minLength": 1
        },
        "packageName": {
          "type": "string",
          "minLength": 1
        },
        "integrity": {
          "type": "string",
          "minLength": 1
        },
        "integrityKind": {
          "anyOf": [
            {
              "type": "string",
              "const": "ssri"
            },
            {
              "type": "string",
              "const": "sha256"
            },
            {
              "type": "string",
              "const": "git-commit"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "PluginInstallTrust": {
      "type": "object",
      "required": [
        "disposition"
      ],
      "properties": {
        "disposition": {
          "anyOf": [
            {
              "type": "string",
              "const": "clean"
            },
            {
              "type": "string",
              "const": "review-recommended"
            },
            {
              "type": "string",
              "const": "review-required"
            },
            {
              "type": "string",
              "const": "blocked"
            }
          ]
        },
        "reasons": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "checkedAt": {
          "type": "string",
          "minLength": 1
        },
        "acknowledgedAt": {
          "type": "string",
          "minLength": 1
        },
        "pending": {
          "type": "boolean"
        },
        "stale": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "PluginOperatorGrants": {
      "type": "object",
      "required": [
        "hooks"
      ],
      "properties": {
        "hooks": {
          "type": "object",
          "required": [
            "allowPromptInjection",
            "allowConversationAccess"
          ],
          "properties": {
            "allowPromptInjection": {
              "type": "object",
              "required": [
                "effective"
              ],
              "properties": {
                "effective": {
                  "type": "boolean"
                },
                "configured": {
                  "type": "boolean"
                }
              },
              "additionalProperties": false
            },
            "allowConversationAccess": {
              "type": "object",
              "required": [
                "effective"
              ],
              "properties": {
                "effective": {
                  "type": "boolean"
                },
                "configured": {
                  "type": "boolean"
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        "llm": {
          "type": "object",
          "properties": {
            "allowModelOverride": {
              "type": "boolean"
            },
            "allowedModels": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "allowedCompletionModels": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "allowAuthProfileOverride": {
              "type": "boolean"
            },
            "allowAgentIdOverride": {
              "type": "boolean"
            }
          },
          "additionalProperties": false
        },
        "subagent": {
          "type": "object",
          "properties": {
            "allowModelOverride": {
              "type": "boolean"
            },
            "allowedModels": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              }
            }
          },
          "additionalProperties": false
        }
      },
      "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
    },
    "PluginsInspectParams": {
      "type": "object",
      "required": [
        "pluginId"
      ],
      "properties": {
        "pluginId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "PluginsInspectResult": {
      "type": "object",
      "required": [
        "ok",
        "plugin",
        "declared",
        "reviewToken",
        "grants"
      ],
      "properties": {
        "ok": {
          "type": "boolean",
          "const": true
        },
        "plugin": {
          "type": "object",
          "required": [
            "id",
            "name",
            "installed",
            "enabled"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            },
            "name": {
              "type": "string",
              "minLength": 1
            },
            "version": {
              "type": "string",
              "minLength": 1
            },
            "description": {
              "type": "string"
            },
            "origin": {
              "type": "string",
              "minLength": 1
            },
            "installed": {
              "type": "boolean"
            },
            "enabled": {
              "type": "boolean"
            }
          },
          "additionalProperties": false
        },
        "source": {
          "type": "object",
          "required": [
            "kind"
          ],
          "properties": {
            "kind": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "bundled"
                },
                {
                  "type": "string",
                  "const": "clawhub"
                },
                {
                  "type": "string",
                  "const": "npm"
                },
                {
                  "type": "string",
                  "const": "git"
                },
                {
                  "type": "string",
                  "const": "path"
                },
                {
                  "type": "string",
                  "const": "archive"
                },
                {
                  "type": "string",
                  "const": "marketplace"
                },
                {
                  "type": "string",
                  "const": "official-catalog"
                }
              ]
            },
            "spec": {
              "type": "string",
              "minLength": 1
            },
            "packageName": {
              "type": "string",
              "minLength": 1
            },
            "integrity": {
              "type": "string",
              "minLength": 1
            },
            "integrityKind": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "ssri"
                },
                {
                  "type": "string",
                  "const": "sha256"
                },
                {
                  "type": "string",
                  "const": "git-commit"
                }
              ]
            }
          },
          "additionalProperties": false
        },
        "declared": {
          "type": "object",
          "required": [
            "channels",
            "providers",
            "tools",
            "contracts",
            "hooks",
            "mcpServers",
            "cliCommands",
            "cliBackends",
            "skills",
            "dangerousConfigFlags"
          ],
          "properties": {
            "channels": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "providers": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "tools": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "contracts": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "hooks": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "mcpServers": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "cliCommands": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "cliBackends": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "skills": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "dangerousConfigFlags": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              }
            }
          },
          "additionalProperties": false
        },
        "reviewToken": {
          "type": "string",
          "minLength": 1
        },
        "grants": {
          "type": "object",
          "required": [
            "hooks"
          ],
          "properties": {
            "hooks": {
              "type": "object",
              "required": [
                "allowPromptInjection",
                "allowConversationAccess"
              ],
              "properties": {
                "allowPromptInjection": {
                  "type": "object",
                  "required": [
                    "effective"
                  ],
                  "properties": {
                    "effective": {
                      "type": "boolean"
                    },
                    "configured": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                },
                "allowConversationAccess": {
                  "type": "object",
                  "required": [
                    "effective"
                  ],
                  "properties": {
                    "effective": {
                      "type": "boolean"
                    },
                    "configured": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                }
              },
              "additionalProperties": false
            },
            "llm": {
              "type": "object",
              "properties": {
                "allowModelOverride": {
                  "type": "boolean"
                },
                "allowedModels": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "allowedCompletionModels": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "allowAuthProfileOverride": {
                  "type": "boolean"
                },
                "allowAgentIdOverride": {
                  "type": "boolean"
                }
              },
              "additionalProperties": false
            },
            "subagent": {
              "type": "object",
              "properties": {
                "allowModelOverride": {
                  "type": "boolean"
                },
                "allowedModels": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  }
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        "trust": {
          "type": "object",
          "required": [
            "disposition"
          ],
          "properties": {
            "disposition": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "clean"
                },
                {
                  "type": "string",
                  "const": "review-recommended"
                },
                {
                  "type": "string",
                  "const": "review-required"
                },
                {
                  "type": "string",
                  "const": "blocked"
                }
              ]
            },
            "reasons": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "checkedAt": {
              "type": "string",
              "minLength": 1
            },
            "acknowledgedAt": {
              "type": "string",
              "minLength": 1
            },
            "pending": {
              "type": "boolean"
            },
            "stale": {
              "type": "boolean"
            }
          },
          "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
            },
            "acknowledgeInstallPolicyWarning": {
              "type": "boolean",
              "const": true
            },
            "acknowledgeCapabilities": {
              "type": "object",
              "required": [
                "reviewToken"
              ],
              "properties": {
                "reviewToken": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "source",
            "pluginId"
          ],
          "properties": {
            "source": {
              "type": "string",
              "const": "official"
            },
            "pluginId": {
              "type": "string",
              "minLength": 1
            },
            "acknowledgeInstallPolicyWarning": {
              "type": "boolean",
              "const": true
            },
            "acknowledgeCapabilities": {
              "type": "object",
              "required": [
                "reviewToken"
              ],
              "properties": {
                "reviewToken": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            }
          },
          "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
        },
        "agentId": {
          "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"
        },
        "acknowledgeCapabilities": {
          "type": "object",
          "required": [
            "reviewToken"
          ],
          "properties": {
            "reviewToken": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        }
      },
      "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"
          ]
        },
        "joinUrl": {
          "type": "boolean",
          "const": true
        }
      },
      "additionalProperties": false
    },
    "DevicePairSetupCodeResult": {
      "type": "object",
      "required": [
        "setupCode",
        "gatewayUrl",
        "auth",
        "urlSource"
      ],
      "properties": {
        "setupId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "setupCode": {
          "type": "string",
          "minLength": 1
        },
        "joinUrl": {
          "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"
        },
        "expiresAtMs": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "DevicePairSetupStatusParams": {
      "type": "object",
      "required": [
        "setupId"
      ],
      "properties": {
        "setupId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        }
      },
      "additionalProperties": false
    },
    "DevicePairSetupStatusResult": {
      "type": "object",
      "properties": {
        "completion": {
          "type": "object",
          "required": [
            "setupId",
            "deviceId",
            "access",
            "ts"
          ],
          "properties": {
            "setupId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "deviceId": {
              "type": "string",
              "minLength": 1
            },
            "deviceName": {
              "type": "string",
              "minLength": 1
            },
            "access": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "full"
                },
                {
                  "type": "string",
                  "const": "limited"
                },
                {
                  "type": "string",
                  "const": "node"
                }
              ]
            },
            "ts": {
              "type": "integer",
              "minimum": 0
            }
          },
          "additionalProperties": false
        },
        "deliveryUncertain": {
          "type": "object",
          "required": [
            "setupId",
            "deviceId",
            "access",
            "ts"
          ],
          "properties": {
            "setupId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "deviceId": {
              "type": "string",
              "minLength": 1
            },
            "deviceName": {
              "type": "string",
              "minLength": 1
            },
            "access": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "full"
                },
                {
                  "type": "string",
                  "const": "limited"
                },
                {
                  "type": "string",
                  "const": "node"
                }
              ]
            },
            "ts": {
              "type": "integer",
              "minimum": 0
            }
          },
          "additionalProperties": false
        }
      },
      "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
    },
    "DeviceTokenRotateResult": {
      "type": "object",
      "required": [
        "deviceId",
        "role",
        "scopes",
        "rotatedAtMs"
      ],
      "properties": {
        "deviceId": {
          "type": "string",
          "minLength": 1
        },
        "role": {
          "type": "string",
          "minLength": 1
        },
        "token": {
          "type": "string",
          "minLength": 1
        },
        "scopes": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "rotatedAtMs": {
          "type": "integer",
          "minimum": 0
        },
        "tokenDelivery": {
          "type": "string",
          "enum": [
            "in-band",
            "withheld-cross-device"
          ]
        }
      },
      "additionalProperties": false,
      "allOf": [
        {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "token",
                "tokenDelivery"
              ],
              "properties": {
                "token": {
                  "type": "string",
                  "minLength": 1
                },
                "tokenDelivery": {
                  "type": "string",
                  "const": "in-band"
                }
              }
            },
            {
              "allOf": [
                {
                  "type": "object",
                  "required": [
                    "tokenDelivery"
                  ],
                  "properties": {
                    "tokenDelivery": {
                      "type": "string",
                      "const": "withheld-cross-device"
                    }
                  }
                },
                {
                  "not": {
                    "required": [
                      "token"
                    ]
                  }
                }
              ]
            },
            {
              "not": {
                "required": [
                  "tokenDelivery"
                ]
              }
            }
          ]
        }
      ]
    },
    "DeviceTokenRevokeParams": {
      "type": "object",
      "required": [
        "deviceId",
        "role"
      ],
      "properties": {
        "deviceId": {
          "type": "string",
          "minLength": 1
        },
        "role": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "ScopeUpgradeRequest": {
      "type": "object",
      "required": [
        "scopes"
      ],
      "properties": {
        "scopes": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "minItems": 1,
          "maxItems": 8,
          "uniqueItems": true
        }
      },
      "additionalProperties": false
    },
    "ScopeUpgradeWait": {
      "type": "object",
      "required": [
        "requestId"
      ],
      "properties": {
        "requestId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "ScopeUpgradeRegistration": {
      "type": "object",
      "required": [
        "requestId"
      ],
      "properties": {
        "requestId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "ScopeUpgradeApproved": {
      "type": "object",
      "required": [
        "status",
        "requestId",
        "deviceToken",
        "scopes"
      ],
      "properties": {
        "status": {
          "type": "string",
          "const": "approved"
        },
        "requestId": {
          "type": "string",
          "minLength": 1
        },
        "deviceToken": {
          "type": "string",
          "minLength": 1
        },
        "scopes": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          },
          "minItems": 1,
          "maxItems": 8,
          "uniqueItems": true
        }
      },
      "additionalProperties": false
    },
    "ScopeUpgradeRejected": {
      "type": "object",
      "required": [
        "status",
        "requestId"
      ],
      "properties": {
        "status": {
          "type": "string",
          "const": "rejected"
        },
        "requestId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "ScopeUpgradeExpired": {
      "type": "object",
      "required": [
        "status",
        "requestId"
      ],
      "properties": {
        "status": {
          "type": "string",
          "const": "expired"
        },
        "requestId": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "ScopeUpgradeResult": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "status",
            "requestId",
            "deviceToken",
            "scopes"
          ],
          "properties": {
            "status": {
              "type": "string",
              "const": "approved"
            },
            "requestId": {
              "type": "string",
              "minLength": 1
            },
            "deviceToken": {
              "type": "string",
              "minLength": 1
            },
            "scopes": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1
              },
              "minItems": 1,
              "maxItems": 8,
              "uniqueItems": true
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "status",
            "requestId"
          ],
          "properties": {
            "status": {
              "type": "string",
              "const": "rejected"
            },
            "requestId": {
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "status",
            "requestId"
          ],
          "properties": {
            "status": {
              "type": "string",
              "const": "expired"
            },
            "requestId": {
              "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
    },
    "DevicePairSetupCompletedEvent": {
      "type": "object",
      "required": [
        "setupId",
        "deviceId",
        "access",
        "ts"
      ],
      "properties": {
        "setupId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "deviceId": {
          "type": "string",
          "minLength": 1
        },
        "deviceName": {
          "type": "string",
          "minLength": 1
        },
        "access": {
          "anyOf": [
            {
              "type": "string",
              "const": "full"
            },
            {
              "type": "string",
              "const": "limited"
            },
            {
              "type": "string",
              "const": "node"
            }
          ]
        },
        "ts": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "DevicePairSetupDeliveryUncertainEvent": {
      "type": "object",
      "required": [
        "setupId",
        "deviceId",
        "access",
        "ts"
      ],
      "properties": {
        "setupId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "deviceId": {
          "type": "string",
          "minLength": 1
        },
        "deviceName": {
          "type": "string",
          "minLength": 1
        },
        "access": {
          "anyOf": [
            {
              "type": "string",
              "const": "full"
            },
            {
              "type": "string",
              "const": "limited"
            },
            {
              "type": "string",
              "const": "node"
            }
          ]
        },
        "ts": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "ChatHistoryParams": {
      "type": "object",
      "required": [
        "sessionKey"
      ],
      "properties": {
        "sessionKey": {
          "type": "string",
          "minLength": 1
        },
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "cursor": {
          "type": "string"
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1000
        },
        "offset": {
          "type": "integer",
          "minimum": 0
        },
        "pendingBefore": {
          "type": "integer",
          "minimum": 1
        },
        "messageId": {
          "type": "string",
          "minLength": 1
        },
        "sessionId": {
          "type": "string",
          "minLength": 1
        },
        "maxChars": {
          "type": "integer",
          "minimum": 1,
          "maximum": 500000
        }
      },
      "additionalProperties": false
    },
    "ChatHistoryDeltaResult": {
      "type": "object",
      "required": [
        "kind",
        "messages",
        "deltaCursor",
        "sessionInfo"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "const": "delta"
        },
        "messages": {
          "type": "array",
          "items": {}
        },
        "deltaCursor": {
          "type": "string"
        },
        "sessionInfo": {},
        "agentsList": {},
        "inFlightRun": {},
        "metadata": {},
        "pendingInputs": {
          "type": "object",
          "required": [
            "items",
            "total"
          ],
          "properties": {
            "items": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "id",
                  "message",
                  "acceptedAt",
                  "state"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "minLength": 1
                  },
                  "runId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256
                  },
                  "message": {},
                  "acceptedAt": {
                    "type": "number"
                  },
                  "state": {
                    "type": "string",
                    "enum": [
                      "queued",
                      "cancelled",
                      "interrupted"
                    ]
                  }
                },
                "additionalProperties": false
              },
              "maxItems": 20
            },
            "total": {
              "type": "integer",
              "minimum": 0
            },
            "nextBefore": {
              "type": "integer",
              "minimum": 1
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "ChatHistoryResetResult": {
      "type": "object",
      "required": [
        "kind"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "const": "reset"
        }
      },
      "additionalProperties": false
    },
    "ChatHistoryCursorResult": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "kind",
            "messages",
            "deltaCursor",
            "sessionInfo"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "delta"
            },
            "messages": {
              "type": "array",
              "items": {}
            },
            "deltaCursor": {
              "type": "string"
            },
            "sessionInfo": {},
            "agentsList": {},
            "inFlightRun": {},
            "metadata": {},
            "pendingInputs": {
              "type": "object",
              "required": [
                "items",
                "total"
              ],
              "properties": {
                "items": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "message",
                      "acceptedAt",
                      "state"
                    ],
                    "properties": {
                      "id": {
                        "type": "string",
                        "minLength": 1
                      },
                      "runId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 256
                      },
                      "message": {},
                      "acceptedAt": {
                        "type": "number"
                      },
                      "state": {
                        "type": "string",
                        "enum": [
                          "queued",
                          "cancelled",
                          "interrupted"
                        ]
                      }
                    },
                    "additionalProperties": false
                  },
                  "maxItems": 20
                },
                "total": {
                  "type": "integer",
                  "minimum": 0
                },
                "nextBefore": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "kind"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "reset"
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "ChatMetadataParams": {
      "type": "object",
      "properties": {
        "agentId": {
          "type": "string",
          "minLength": 1
        },
        "sessionKey": {
          "type": "string",
          "minLength": 1,
          "description": "Read the authorized session's persisted auth-profile selection instead of neutral agent metadata."
        }
      },
      "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"
        },
        "intent": {
          "type": "object",
          "required": [
            "kind",
            "version",
            "issuedAtMs"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "session-goal-start"
            },
            "version": {
              "type": "number",
              "const": 1
            },
            "issuedAtMs": {
              "type": "integer",
              "minimum": 0
            }
          },
          "additionalProperties": false
        },
        "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": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string"
              },
              "mimeType": {
                "type": "string"
              },
              "fileName": {
                "type": "string"
              },
              "content": {},
              "sizeBytes": {
                "type": "number"
              },
              "durationMs": {
                "type": "number"
              },
              "width": {
                "type": "number"
              },
              "height": {
                "type": "number"
              }
            },
            "additionalProperties": true
          }
        },
        "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": "naming_worktree"
        },
        {
          "type": "string",
          "const": "creating_worktree"
        },
        {
          "type": "string",
          "const": "running_setup"
        },
        {
          "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": "naming_worktree"
            },
            {
              "type": "string",
              "const": "creating_worktree"
            },
            {
              "type": "string",
              "const": "running_setup"
            },
            {
              "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": "naming_worktree"
                },
                {
                  "type": "string",
                  "const": "creating_worktree"
                },
                {
                  "type": "string",
                  "const": "running_setup"
                },
                {
                  "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": {
        "refreshCheckout": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "UpdateStatusResult": {
      "type": "object",
      "required": [
        "sentinel",
        "updateAvailable"
      ],
      "properties": {
        "sentinel": {},
        "updateAvailable": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "currentVersion",
                "latestVersion",
                "channel"
              ],
              "properties": {
                "currentVersion": {
                  "type": "string",
                  "minLength": 1
                },
                "latestVersion": {
                  "type": "string",
                  "minLength": 1
                },
                "channel": {
                  "type": "string",
                  "minLength": 1
                },
                "currentSha": {
                  "type": "string",
                  "minLength": 1
                },
                "upstreamRef": {
                  "type": "string",
                  "minLength": 1
                },
                "upstreamSha": {
                  "type": "string",
                  "minLength": 1
                },
                "commitsBehind": {
                  "type": "integer",
                  "minimum": 0
                },
                "commits": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "sha",
                      "subject"
                    ],
                    "properties": {
                      "sha": {
                        "type": "string",
                        "minLength": 1
                      },
                      "subject": {
                        "type": "string",
                        "maxLength": 120
                      }
                    },
                    "additionalProperties": false
                  },
                  "maxItems": 5
                }
              },
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        },
        "effectiveChannel": {
          "anyOf": [
            {
              "type": "string",
              "const": "stable"
            },
            {
              "type": "string",
              "const": "extended-stable"
            },
            {
              "type": "string",
              "const": "beta"
            },
            {
              "type": "string",
              "const": "dev"
            }
          ]
        },
        "schedule": {
          "type": "object",
          "required": [
            "channel",
            "autoEnabled"
          ],
          "properties": {
            "channel": {
              "type": "string",
              "minLength": 1
            },
            "autoEnabled": {
              "type": "boolean"
            },
            "install": {
              "type": "object",
              "required": [
                "kind"
              ],
              "properties": {
                "kind": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "package"
                    },
                    {
                      "type": "string",
                      "const": "git"
                    },
                    {
                      "type": "string",
                      "const": "unknown"
                    }
                  ]
                },
                "git": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "status"
                      ],
                      "properties": {
                        "currentSha": {
                          "type": "string",
                          "minLength": 1
                        },
                        "commitAtMs": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "installedAtMs": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "status": {
                          "type": "string",
                          "const": "current"
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "commitsBehind"
                      ],
                      "properties": {
                        "currentSha": {
                          "type": "string",
                          "minLength": 1
                        },
                        "commitAtMs": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "installedAtMs": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "status": {
                          "type": "string",
                          "const": "behind"
                        },
                        "commitsBehind": {
                          "type": "integer",
                          "minimum": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "commitsAhead"
                      ],
                      "properties": {
                        "currentSha": {
                          "type": "string",
                          "minLength": 1
                        },
                        "commitAtMs": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "installedAtMs": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "status": {
                          "type": "string",
                          "const": "ahead"
                        },
                        "commitsAhead": {
                          "type": "integer",
                          "minimum": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "commitsAhead",
                        "commitsBehind"
                      ],
                      "properties": {
                        "currentSha": {
                          "type": "string",
                          "minLength": 1
                        },
                        "commitAtMs": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "installedAtMs": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "status": {
                          "type": "string",
                          "const": "diverged"
                        },
                        "commitsAhead": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "commitsBehind": {
                          "type": "integer",
                          "minimum": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "reason"
                      ],
                      "properties": {
                        "currentSha": {
                          "type": "string",
                          "minLength": 1
                        },
                        "commitAtMs": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "installedAtMs": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "status": {
                          "type": "string",
                          "const": "unavailable"
                        },
                        "reason": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "fetch-failed"
                            },
                            {
                              "type": "string",
                              "const": "no-upstream"
                            },
                            {
                              "type": "string",
                              "const": "no-upstream-sha"
                            },
                            {
                              "type": "string",
                              "const": "comparison-failed"
                            },
                            {
                              "type": "string",
                              "const": "git-unavailable"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                }
              },
              "additionalProperties": false
            },
            "target": {
              "anyOf": [
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "version"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "package"
                    },
                    "version": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "upstreamRef",
                    "upstreamSha",
                    "commitsBehind"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "git"
                    },
                    "upstreamRef": {
                      "type": "string",
                      "minLength": 1
                    },
                    "upstreamSha": {
                      "type": "string",
                      "minLength": 1
                    },
                    "commitsBehind": {
                      "type": "integer",
                      "minimum": 0
                    }
                  },
                  "additionalProperties": false
                }
              ]
            },
            "campaign": {
              "type": "object",
              "required": [
                "id",
                "state",
                "announcedAtMs",
                "forceAtMs",
                "updatedAtMs"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1
                },
                "state": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "waiting-for-idle"
                    },
                    {
                      "type": "string",
                      "const": "countdown"
                    },
                    {
                      "type": "string",
                      "const": "applying"
                    }
                  ]
                },
                "announcedAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "applyAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "holdUntilMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "forceAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "updatedAtMs": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "UpdateAvailable": {
      "type": "object",
      "required": [
        "currentVersion",
        "latestVersion",
        "channel"
      ],
      "properties": {
        "currentVersion": {
          "type": "string",
          "minLength": 1
        },
        "latestVersion": {
          "type": "string",
          "minLength": 1
        },
        "channel": {
          "type": "string",
          "minLength": 1
        },
        "currentSha": {
          "type": "string",
          "minLength": 1
        },
        "upstreamRef": {
          "type": "string",
          "minLength": 1
        },
        "upstreamSha": {
          "type": "string",
          "minLength": 1
        },
        "commitsBehind": {
          "type": "integer",
          "minimum": 0
        },
        "commits": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "sha",
              "subject"
            ],
            "properties": {
              "sha": {
                "type": "string",
                "minLength": 1
              },
              "subject": {
                "type": "string",
                "maxLength": 120
              }
            },
            "additionalProperties": false
          },
          "maxItems": 5
        }
      },
      "additionalProperties": false
    },
    "UpdateScheduleState": {
      "type": "object",
      "required": [
        "channel",
        "autoEnabled"
      ],
      "properties": {
        "channel": {
          "type": "string",
          "minLength": 1
        },
        "autoEnabled": {
          "type": "boolean"
        },
        "install": {
          "type": "object",
          "required": [
            "kind"
          ],
          "properties": {
            "kind": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "package"
                },
                {
                  "type": "string",
                  "const": "git"
                },
                {
                  "type": "string",
                  "const": "unknown"
                }
              ]
            },
            "git": {
              "anyOf": [
                {
                  "type": "object",
                  "required": [
                    "status"
                  ],
                  "properties": {
                    "currentSha": {
                      "type": "string",
                      "minLength": 1
                    },
                    "commitAtMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "installedAtMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "status": {
                      "type": "string",
                      "const": "current"
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "status",
                    "commitsBehind"
                  ],
                  "properties": {
                    "currentSha": {
                      "type": "string",
                      "minLength": 1
                    },
                    "commitAtMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "installedAtMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "status": {
                      "type": "string",
                      "const": "behind"
                    },
                    "commitsBehind": {
                      "type": "integer",
                      "minimum": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "status",
                    "commitsAhead"
                  ],
                  "properties": {
                    "currentSha": {
                      "type": "string",
                      "minLength": 1
                    },
                    "commitAtMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "installedAtMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "status": {
                      "type": "string",
                      "const": "ahead"
                    },
                    "commitsAhead": {
                      "type": "integer",
                      "minimum": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "status",
                    "commitsAhead",
                    "commitsBehind"
                  ],
                  "properties": {
                    "currentSha": {
                      "type": "string",
                      "minLength": 1
                    },
                    "commitAtMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "installedAtMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "status": {
                      "type": "string",
                      "const": "diverged"
                    },
                    "commitsAhead": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "commitsBehind": {
                      "type": "integer",
                      "minimum": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "status",
                    "reason"
                  ],
                  "properties": {
                    "currentSha": {
                      "type": "string",
                      "minLength": 1
                    },
                    "commitAtMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "installedAtMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "status": {
                      "type": "string",
                      "const": "unavailable"
                    },
                    "reason": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "fetch-failed"
                        },
                        {
                          "type": "string",
                          "const": "no-upstream"
                        },
                        {
                          "type": "string",
                          "const": "no-upstream-sha"
                        },
                        {
                          "type": "string",
                          "const": "comparison-failed"
                        },
                        {
                          "type": "string",
                          "const": "git-unavailable"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              ]
            }
          },
          "additionalProperties": false
        },
        "target": {
          "anyOf": [
            {
              "type": "object",
              "required": [
                "kind",
                "version"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "package"
                },
                "version": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "additionalProperties": false
            },
            {
              "type": "object",
              "required": [
                "kind",
                "upstreamRef",
                "upstreamSha",
                "commitsBehind"
              ],
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "git"
                },
                "upstreamRef": {
                  "type": "string",
                  "minLength": 1
                },
                "upstreamSha": {
                  "type": "string",
                  "minLength": 1
                },
                "commitsBehind": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "additionalProperties": false
            }
          ]
        },
        "campaign": {
          "type": "object",
          "required": [
            "id",
            "state",
            "announcedAtMs",
            "forceAtMs",
            "updatedAtMs"
          ],
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            },
            "state": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "waiting-for-idle"
                },
                {
                  "type": "string",
                  "const": "countdown"
                },
                {
                  "type": "string",
                  "const": "applying"
                }
              ]
            },
            "announcedAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "applyAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "holdUntilMs": {
              "type": "integer",
              "minimum": 0
            },
            "forceAtMs": {
              "type": "integer",
              "minimum": 0
            },
            "updatedAtMs": {
              "type": "integer",
              "minimum": 0
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "UpdateHoldParams": {
      "type": "object",
      "properties": {},
      "additionalProperties": false
    },
    "UpdateHoldResult": {
      "type": "object",
      "required": [
        "ok"
      ],
      "properties": {
        "ok": {
          "type": "boolean"
        },
        "schedule": {
          "type": "object",
          "required": [
            "channel",
            "autoEnabled"
          ],
          "properties": {
            "channel": {
              "type": "string",
              "minLength": 1
            },
            "autoEnabled": {
              "type": "boolean"
            },
            "install": {
              "type": "object",
              "required": [
                "kind"
              ],
              "properties": {
                "kind": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "package"
                    },
                    {
                      "type": "string",
                      "const": "git"
                    },
                    {
                      "type": "string",
                      "const": "unknown"
                    }
                  ]
                },
                "git": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "status"
                      ],
                      "properties": {
                        "currentSha": {
                          "type": "string",
                          "minLength": 1
                        },
                        "commitAtMs": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "installedAtMs": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "status": {
                          "type": "string",
                          "const": "current"
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "commitsBehind"
                      ],
                      "properties": {
                        "currentSha": {
                          "type": "string",
                          "minLength": 1
                        },
                        "commitAtMs": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "installedAtMs": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "status": {
                          "type": "string",
                          "const": "behind"
                        },
                        "commitsBehind": {
                          "type": "integer",
                          "minimum": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "commitsAhead"
                      ],
                      "properties": {
                        "currentSha": {
                          "type": "string",
                          "minLength": 1
                        },
                        "commitAtMs": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "installedAtMs": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "status": {
                          "type": "string",
                          "const": "ahead"
                        },
                        "commitsAhead": {
                          "type": "integer",
                          "minimum": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "commitsAhead",
                        "commitsBehind"
                      ],
                      "properties": {
                        "currentSha": {
                          "type": "string",
                          "minLength": 1
                        },
                        "commitAtMs": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "installedAtMs": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "status": {
                          "type": "string",
                          "const": "diverged"
                        },
                        "commitsAhead": {
                          "type": "integer",
                          "minimum": 1
                        },
                        "commitsBehind": {
                          "type": "integer",
                          "minimum": 1
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "reason"
                      ],
                      "properties": {
                        "currentSha": {
                          "type": "string",
                          "minLength": 1
                        },
                        "commitAtMs": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "installedAtMs": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "status": {
                          "type": "string",
                          "const": "unavailable"
                        },
                        "reason": {
                          "anyOf": [
                            {
                              "type": "string",
                              "const": "fetch-failed"
                            },
                            {
                              "type": "string",
                              "const": "no-upstream"
                            },
                            {
                              "type": "string",
                              "const": "no-upstream-sha"
                            },
                            {
                              "type": "string",
                              "const": "comparison-failed"
                            },
                            {
                              "type": "string",
                              "const": "git-unavailable"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                }
              },
              "additionalProperties": false
            },
            "target": {
              "anyOf": [
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "version"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "package"
                    },
                    "version": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "required": [
                    "kind",
                    "upstreamRef",
                    "upstreamSha",
                    "commitsBehind"
                  ],
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "git"
                    },
                    "upstreamRef": {
                      "type": "string",
                      "minLength": 1
                    },
                    "upstreamSha": {
                      "type": "string",
                      "minLength": 1
                    },
                    "commitsBehind": {
                      "type": "integer",
                      "minimum": 0
                    }
                  },
                  "additionalProperties": false
                }
              ]
            },
            "campaign": {
              "type": "object",
              "required": [
                "id",
                "state",
                "announcedAtMs",
                "forceAtMs",
                "updatedAtMs"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1
                },
                "state": {
                  "anyOf": [
                    {
                      "type": "string",
                      "const": "waiting-for-idle"
                    },
                    {
                      "type": "string",
                      "const": "countdown"
                    },
                    {
                      "type": "string",
                      "const": "applying"
                    }
                  ]
                },
                "announcedAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "applyAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "holdUntilMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "forceAtMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "updatedAtMs": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        }
      },
      "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
        },
        "target": {
          "type": "object",
          "required": [
            "kind",
            "upstreamRef",
            "upstreamSha"
          ],
          "properties": {
            "kind": {
              "type": "string",
              "const": "git"
            },
            "upstreamRef": {
              "type": "string",
              "minLength": 1,
              "pattern": "^[^\\s\\u0000-\\u001f\\u007f-\\u009f]+$"
            },
            "upstreamSha": {
              "type": "string",
              "pattern": "^[a-fA-F0-9]{40}$"
            }
          },
          "additionalProperties": false
        }
      },
      "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
    },
    "PortalSummary": {
      "type": "object",
      "required": [
        "id",
        "title",
        "port",
        "listenPort",
        "publicUrl",
        "createdAtMs"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "title": {
          "type": "string",
          "minLength": 1
        },
        "port": {
          "type": "integer",
          "minimum": 1,
          "maximum": 65535
        },
        "listenPort": {
          "type": "integer",
          "minimum": 1,
          "maximum": 65535
        },
        "tokenQuery": {
          "type": "string",
          "minLength": 1
        },
        "url": {
          "type": "string",
          "minLength": 1
        },
        "publicUrl": {
          "type": "string",
          "minLength": 1
        },
        "path": {
          "type": "string",
          "pattern": "^/"
        },
        "description": {
          "type": "string"
        },
        "origin": {
          "type": "string"
        },
        "createdAtMs": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "PortalListParams": {
      "type": "object",
      "properties": {},
      "additionalProperties": false
    },
    "PortalListResult": {
      "type": "object",
      "required": [
        "portals"
      ],
      "properties": {
        "portals": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "title",
              "port",
              "listenPort",
              "publicUrl",
              "createdAtMs"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "title": {
                "type": "string",
                "minLength": 1
              },
              "port": {
                "type": "integer",
                "minimum": 1,
                "maximum": 65535
              },
              "listenPort": {
                "type": "integer",
                "minimum": 1,
                "maximum": 65535
              },
              "tokenQuery": {
                "type": "string",
                "minLength": 1
              },
              "url": {
                "type": "string",
                "minLength": 1
              },
              "publicUrl": {
                "type": "string",
                "minLength": 1
              },
              "path": {
                "type": "string",
                "pattern": "^/"
              },
              "description": {
                "type": "string"
              },
              "origin": {
                "type": "string"
              },
              "createdAtMs": {
                "type": "integer",
                "minimum": 0
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "PortalOpenParams": {
      "type": "object",
      "required": [
        "port"
      ],
      "properties": {
        "port": {
          "type": "integer",
          "minimum": 1,
          "maximum": 65535
        },
        "title": {
          "type": "string",
          "minLength": 1
        },
        "description": {
          "type": "string"
        },
        "path": {
          "type": "string",
          "pattern": "^/"
        }
      },
      "additionalProperties": false
    },
    "PortalOpenResult": {
      "type": "object",
      "required": [
        "id",
        "title",
        "port",
        "listenPort",
        "tokenQuery",
        "url",
        "publicUrl",
        "createdAtMs"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "title": {
          "type": "string",
          "minLength": 1
        },
        "port": {
          "type": "integer",
          "minimum": 1,
          "maximum": 65535
        },
        "listenPort": {
          "type": "integer",
          "minimum": 1,
          "maximum": 65535
        },
        "tokenQuery": {
          "type": "string",
          "minLength": 1
        },
        "url": {
          "type": "string",
          "minLength": 1
        },
        "publicUrl": {
          "type": "string",
          "minLength": 1
        },
        "path": {
          "type": "string",
          "pattern": "^/"
        },
        "description": {
          "type": "string"
        },
        "origin": {
          "type": "string"
        },
        "createdAtMs": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "PortalCloseParams": {
      "type": "object",
      "required": [
        "id"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    },
    "PortalCloseResult": {
      "type": "object",
      "required": [
        "closed"
      ],
      "properties": {
        "closed": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "PortalChangedEvent": {
      "type": "object",
      "required": [
        "portals"
      ],
      "properties": {
        "portals": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "title",
              "port",
              "listenPort",
              "publicUrl",
              "createdAtMs"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "title": {
                "type": "string",
                "minLength": 1
              },
              "port": {
                "type": "integer",
                "minimum": 1,
                "maximum": 65535
              },
              "listenPort": {
                "type": "integer",
                "minimum": 1,
                "maximum": 65535
              },
              "tokenQuery": {
                "type": "string",
                "minLength": 1
              },
              "url": {
                "type": "string",
                "minLength": 1
              },
              "publicUrl": {
                "type": "string",
                "minLength": 1
              },
              "path": {
                "type": "string",
                "pattern": "^/"
              },
              "description": {
                "type": "string"
              },
              "origin": {
                "type": "string"
              },
              "createdAtMs": {
                "type": "integer",
                "minimum": 0
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    }
  }
}