Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

3.9 KB
Raw Blame
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "model-hub/guard-refusal.schema.json",
  "title": "GuardRefusal",
  "$comment": "<!-- authority-consumer: guard.error_plan guard_error.backend_model_in_route guard_error.source_in_route_chain guard_error.source_model_in_route_chain guard_error.source_last_supplier -->",
  "description": "The shared HTTP 409 envelope for a guarded Model Hub mutation. Every refusal carries the current nonempty impact plan.",
  "type": "object",
  "required": [
    "ok",
    "contract_version",
    "error",
    "detail",
    "would_remove_hops",
    "would_interrupt"
  ],
  "additionalProperties": false,
  "anyOf": [
    {
      "properties": {
        "would_remove_hops": { "minItems": 1 }
      }
    },
    {
      "properties": {
        "would_interrupt": { "minItems": 1 }
      }
    }
  ],
  "allOf": [
    {
      "if": {
        "properties": {
          "error": {
            "enum": [
              "source_in_route_chain",
              "source_model_in_route_chain"
            ]
          }
        },
        "required": ["error"]
      },
      "then": {
        "properties": {
          "would_remove_hops": { "minItems": 1 }
        }
      }
    },
    {
      "if": {
        "properties": {
          "error": { "const": "source_last_supplier" }
        },
        "required": ["error"]
      },
      "then": {
        "properties": {
          "would_interrupt": { "minItems": 1 }
        }
      }
    }
  ],
  "properties": {
    "ok": { "const": false },
    "contract_version": { "const": 23 },
    "error": {
      "enum": [
        "source_last_supplier",
        "source_in_route_chain",
        "source_model_in_route_chain",
        "backend_model_in_route"
      ],
      "description": "A cascade mutation returns its recomputed impact plan."
    },
    "detail": { "type": "string", "minLength": 1 },
    "would_remove_hops": {
      "type": "array",
      "items": { "$ref": "#/definitions/RouteHopRef" },
      "uniqueItems": true
    },
    "would_interrupt": {
      "type": "array",
      "items": { "$ref": "#/definitions/SupplyGap" },
      "uniqueItems": true,
      "description": "Canonical order is ascending by (backend, model_id); each SupplyGap.agents array is ascending by stable Agent id."
    }
  },
  "definitions": {
    "RouteHopRef": {
      "type": "object",
      "required": ["backend", "menu_model", "source_id", "model_id", "position"],
      "additionalProperties": false,
      "properties": {
        "backend": { "enum": ["claude", "codex", "opencode", "vibey"] },
        "menu_model": { "type": "string", "minLength": 1 },
        "source_id": { "type": "string", "pattern": "^src_[a-z0-9]{8,}$" },
        "model_id": { "type": "string", "minLength": 1 },
        "position": { "type": "integer", "minimum": 1 }
      }
    },
    "SupplyGap": {
      "type": "object",
      "required": ["backend", "model_id", "agents"],
      "additionalProperties": false,
      "properties": {
        "backend": { "enum": ["claude", "codex", "opencode", "vibey"] },
        "model_id": { "type": "string", "minLength": 1 },
        "agents": {
          "type": "array",
          "items": { "type": "string", "minLength": 1 },
          "uniqueItems": true,
          "description": "Enabled named Agent ids in ascending lexicographic order."
        }
      }
    }
  },
  "examples": [
    {
      "ok": false,
      "contract_version": 23,
      "error": "source_model_in_route_chain",
      "detail": "modelHub.errors.source_model_in_route_chain",
      "would_remove_hops": [
        {
          "backend": "claude",
          "menu_model": "claude-opus-4-6",
          "source_id": "src_anthkey01",
          "model_id": "claude-opus-4-6",
          "position": 2
        }
      ],
      "would_interrupt": [
        {
          "backend": "claude",
          "model_id": "claude-opus-4-6",
          "agents": ["pm"]
        }
      ]
    }
  ]
}