{
  "schema": "hasna.service_contract.v1",
  "name": "machines",
  "class": "service",
  "contractVersion": "v1",
  "kitVersion": "0.13.4",
  "description": "Machine fleet control-plane: CLI + MCP + serve (HTTP /v1 registry API) + typed SDK. The data backend is the only runtime switch: SQLite at ~/.hasna/machines/machines.db by default, or PostgreSQL when a database URL is configured, in which case the serve process reads and writes PostgreSQL directly (PURE REMOTE — no sync engine). Every /v1 route requires an @hasna/contracts API key.",
  "bins": [
    "machines",
    "machines-mcp",
    "machines-serve",
    "machines-daemon"
  ],
  "serviceSurfaces": [
    {
      "name": "machines-api",
      "kind": "api",
      "status": "supported",
      "bin": "machines-serve",
      "authMode": "api-key",
      "health": {
        "method": "GET",
        "path": "/health",
        "public": true
      },
      "readiness": {
        "method": "GET",
        "path": "/ready",
        "public": true
      },
      "version": {
        "method": "GET",
        "path": "/version",
        "public": true
      },
      "apiBasePath": "/v1",
      "openApiPath": "/openapi.json"
    },
    {
      "name": "machines-sdk",
      "kind": "sdk",
      "status": "supported",
      "authMode": "api-key",
      "exportSubpath": "./sdk",
      "generatedFrom": "/openapi.json"
    },
    {
      "name": "machines-cli",
      "kind": "cli",
      "status": "supported",
      "bin": "machines",
      "authMode": "local-only"
    },
    {
      "name": "machines-mcp",
      "kind": "mcp",
      "status": "supported",
      "mcpBin": "machines-mcp",
      "authMode": "local-only"
    }
  ],
  "storage": {
    "backend": "sqlite",
    "engines": [
      "sqlite",
      "postgresql"
    ],
    "envPrefix": "HASNA_MACHINES_",
    "aliasEnvPrefix": "MACHINES_",
    "sqlitePath": "~/.hasna/machines/machines.db",
    "pgTestGate": {
      "envVar": "HASNA_MACHINES_TEST_DATABASE_URL",
      "command": "bun test"
    }
  },
  "metadata": {
    "serve": {
      "healthPath": "/health",
      "readyPath": "/ready",
      "versionPath": "/version",
      "openapiPath": "/openapi.json",
      "apiBase": "/v1",
      "authHeader": "x-api-key",
      "scopes": [
        "machines:read",
        "machines:write"
      ]
    },
    "client": {
      "apiUrlEnv": "MACHINES_API_URL",
      "apiKeyEnv": "MACHINES_API_KEY"
    },
    "release": {
      "artifactScan": {
        "script": "verify:pack"
      }
    }
  }
}
