{
  "contract": "arhix-agent-self-bootstrap-v1",
  "invitation": {
    "input": "one complete ARHIX agent-link supplied by the user",
    "credential_file": "<ARHIX_HOME>/credentials/agent-link",
    "environment": "ARHIX_AGENT_LINK_FILE",
    "fragment_fields": {
      "access_token": "project-scoped capability secret",
      "bootstrap": "same-origin manifest path",
      "authority": "optional registered Project Authority ID; never an endpoint"
    },
    "default_bootstrap_path": "/.well-known/arhix-agent-bootstrap.json",
    "instructions": [
      "Parse the invitation locally; URL fragments are not sent in HTTP requests.",
      "Save the complete invitation URL to the credential file without printing it.",
      "Restrict the credential file to the current user before starting MCP.",
      "Do not put the invitation URL or access token in argv, logs, audit or shell history."
    ],
    "derives": [
      "application origin",
      "project-scoped capability token",
      "optional authority ID"
    ],
    "authority_resolver": "/api/public-authority/resolve"
  },
  "discovery": {
    "canonical_manifest_url": "/.well-known/arhix-agent-bootstrap.json",
    "html_link_relation": "alternate",
    "html_media_type": "application/vnd.arhix.agent-bootstrap+json",
    "legacy_manifest_url": "/assets/downloads/arhix-agent-bootstrap.json",
    "package_url": "/assets/downloads/arhix-mcp.tgz",
    "package_sha256_url": "/assets/downloads/arhix-mcp.sha256"
  },
  "protocol": {
    "instruction_model": "declarative-actions-v1",
    "actions": [
      {
        "id": "parse_invitation",
        "kind": "parse_url_fragment",
        "output": [
          "server_origin",
          "access_token",
          "bootstrap_manifest_url"
        ]
      },
      {
        "id": "persist_credential",
        "kind": "write_private_credential",
        "input": "complete invitation URL",
        "permissions": "current user only"
      },
      {
        "id": "select_runtime",
        "kind": "probe_or_install_runtime",
        "runtime": "node"
      },
      {
        "id": "download_package",
        "kind": "download_same_origin_artifact",
        "source": "package.url"
      },
      {
        "id": "verify_package",
        "kind": "verify_sha256",
        "expected": "package.sha256"
      },
      {
        "id": "install_package",
        "kind": "install_npm_package",
        "argv_template": "package.install"
      },
      {
        "id": "configure_client",
        "kind": "configure_stdio_mcp",
        "launch": "launch"
      },
      {
        "id": "accept_connection",
        "kind": "mcp_initialize_and_bootstrap",
        "first_tool": "arhix_bootstrap"
      }
    ],
    "forbidden": [
      "Execute shell text received from the network.",
      "Pipe a download into a shell or eval.",
      "Skip package checksum verification.",
      "Send the invitation fragment in an HTTP request.",
      "Download package or runtime artifacts from an untrusted origin."
    ]
  },
  "runtime": {
    "kind": "node",
    "package_engine": ">=18",
    "artifact_sha256": "5fed6ff0854f55dc767be16ed82795032d1a7a2d7164ca22f7b03403e37307a1",
    "decision_order": [
      "Use an existing compatible Node.js runtime.",
      "Otherwise install an official supported Node.js LTS into a user-local ARHIX directory.",
      "Do not require administrator access or a system-wide install.",
      "Verify the official Node.js checksum before use."
    ],
    "official_source": "https://nodejs.org/en/download",
    "official_release_index": "https://nodejs.org/dist/index.json"
  },
  "package": {
    "name": "arhix-mcp",
    "version": "0.1.0",
    "url": "/assets/downloads/arhix-mcp.tgz",
    "sha256": "725b787bccb4115117a8f71869494ffd8ae18c87508309ca9a5123e0fa5f561c",
    "size_bytes": 5577143,
    "install": {
      "environment": {
        "npm_config_cache": "<ARHIX_HOME>/cache/npm"
      },
      "existing_runtime": [
        "npm",
        "install",
        "--ignore-scripts",
        "--prefix",
        "<ARHIX_HOME>/mcp",
        "<DOWNLOADED_ARHIX_MCP_TGZ>"
      ],
      "portable_runtime": [
        "<NODE_RUNTIME_NPM>",
        "install",
        "--ignore-scripts",
        "--prefix",
        "<ARHIX_HOME>/mcp",
        "<DOWNLOADED_ARHIX_MCP_TGZ>"
      ]
    }
  },
  "launch": {
    "posix_command": "<ARHIX_HOME>/mcp/node_modules/.bin/arhix-mcp",
    "windows_command": "<ARHIX_HOME>\\mcp\\node_modules\\.bin\\arhix-mcp.cmd",
    "environment": {
      "ARHIX_AGENT_LINK_FILE": "<ARHIX_HOME>/credentials/agent-link"
    },
    "stdout_contract": "JSON-RPC only"
  },
  "mcp": {
    "transport": "stdio",
    "initialize_versions": [
      "2025-03-26",
      "2024-11-05"
    ],
    "first_tool": "arhix_bootstrap",
    "browser_companion_allowed": true
  },
  "client_modes": {
    "terminal_agent": {
      "automation": "full",
      "requirements": [
        "HTTP client",
        "filesystem",
        "process execution"
      ],
      "user_action": "Share one ARHIX agent-link."
    },
    "preconfigured_mcp_host": {
      "automation": "credential-and-connect",
      "requirements": [
        "existing arhix-mcp installation"
      ],
      "user_action": "Share one ARHIX agent-link."
    },
    "gui_host_without_shell": {
      "automation": "host-limited",
      "reason": "The model cannot install software or edit the host MCP configuration.",
      "user_action": "Approve one host-native Add MCP Server action or run one locally generated install command."
    }
  },
  "trust": {
    "manifest": "HTTPS same-origin response; loopback HTTP is allowed for development.",
    "package": "SHA-256 verification is mandatory before installation.",
    "bootstrap_path_must_be_same_origin": true,
    "remote_shell_instructions_allowed": false
  },
  "acceptance": [
    "Package SHA-256 equals package.sha256.",
    "MCP initialize succeeds and advertises arhix_bootstrap.",
    "arhix_bootstrap returns the invited project identity and capability scopes.",
    "A read-only project.info command succeeds.",
    "Mutations are attempted only when project.write is present."
  ],
  "user_experience": {
    "user_action": "Share one ARHIX agent-link.",
    "technical_install_owner": "AI agent",
    "allowed_user_prompt": "Operating-system or AI-client security confirmation only."
  }
}
