{
  "components": {
    "headers": {
      "API-Version": {
        "description": "Version of the API that served the response.",
        "schema": {
          "example": "0.2.0",
          "type": "string"
        }
      },
      "Deprecation": {
        "description": "RFC 9745 deprecation timestamp when an endpoint is scheduled for replacement.",
        "schema": {
          "type": "string"
        }
      },
      "RateLimit-Limit": {
        "description": "Maximum number of requests permitted in the current rate-limit window.",
        "schema": {
          "minimum": 1,
          "type": "integer"
        }
      },
      "RateLimit-Policy": {
        "description": "IETF RateLimit policy declaration (for example `600;w=60`).",
        "schema": {
          "type": "string"
        }
      },
      "RateLimit-Remaining": {
        "description": "Number of requests remaining in the current rate-limit window.",
        "schema": {
          "minimum": 0,
          "type": "integer"
        }
      },
      "RateLimit-Reset": {
        "description": "Seconds until the rate-limit quota resets.",
        "schema": {
          "minimum": 0,
          "type": "integer"
        }
      },
      "Retry-After": {
        "description": "Seconds to wait before retrying after a 429 Too Many Requests response.",
        "schema": {
          "minimum": 1,
          "type": "integer"
        }
      },
      "Sunset": {
        "description": "RFC 8594 HTTP-date after which a deprecated endpoint will be removed (at least 90 days notice).",
        "schema": {
          "type": "string"
        }
      }
    },
    "parameters": {
      "ApiVersion": {
        "description": "Requested API version label (defaults to the current stable version).",
        "in": "header",
        "name": "API-Version",
        "required": false,
        "schema": {
          "default": "0.2.0",
          "type": "string"
        }
      }
    },
    "schemas": {
      "ProblemDetails": {
        "properties": {
          "code": {
            "description": "Machine-readable error code.",
            "type": "string"
          },
          "detail": {
            "description": "Explanation of this specific error.",
            "type": "string"
          },
          "hint": {
            "description": "Actionable recovery guidance for callers.",
            "type": "string"
          },
          "status": {
            "description": "HTTP status code.",
            "type": "integer"
          },
          "title": {
            "description": "Short summary of the error.",
            "type": "string"
          },
          "type": {
            "description": "Stable URI identifying the error class.",
            "type": "string"
          }
        },
        "required": [
          "type",
          "title",
          "status",
          "detail"
        ],
        "type": "object"
      }
    },
    "securitySchemes": {
      "oauth2": {
        "description": "Least-privilege OAuth 2.1 scopes for authenticated operations; public read operations also accept anonymous requests.",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://chronicle-sync.ferrite.run/oauth/authorize",
            "scopes": {
              "apps:discover": "Discover available operations, schemas, and public metadata.",
              "apps:read": "Read-only access to declared GET and read-only operations."
            },
            "tokenUrl": "https://chronicle-sync.ferrite.run/oauth/token"
          }
        },
        "type": "oauth2"
      }
    }
  },
  "info": {
    "description": "Ferrite Chronicle Sync keeps a directory inside a Linux sandbox equal to a workspace stored on Ferrite, in both directions, so files outlive the sandbox. Use it to give an agent a working directory that a later sandbox can restore in full. The public operations describe the protocol, its limits, its path rules and the workspace API; workspaces themselves need a signed-in session, and a sandbox connects with a one-use credential.\n\nVersioning and deprecation policy: endpoints are versioned via URL path and the optional `API-Version` header (current version: 0.2.0). Deprecated endpoints emit RFC 9745 `Deprecation` and RFC 8594 `Sunset` response headers at least 90 days before removal. Rate limits are communicated via IETF `RateLimit-Limit`, `RateLimit-Remaining`, `RateLimit-Reset`, `RateLimit-Policy`, and `Retry-After` headers.",
    "title": "ferrite-chronicle-sync",
    "version": "0.2.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/api/limits": {
      "get": {
        "operationId": "get_limits",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "credentials": {
                      "additionalProperties": false,
                      "properties": {
                        "attach_ms": {
                          "description": "default life of the credential a sandbox first connects with",
                          "type": "integer"
                        },
                        "lease_ms": {
                          "description": "longest a writer lease lasts without renewal",
                          "type": "integer"
                        },
                        "resume_ms": {
                          "description": "life of the credential it reconnects with",
                          "type": "integer"
                        }
                      },
                      "required": [
                        "attach_ms",
                        "lease_ms",
                        "resume_ms"
                      ],
                      "type": "object"
                    },
                    "protocol": {
                      "additionalProperties": false,
                      "properties": {
                        "changes_per_batch": {
                          "description": "path changes in one batch",
                          "type": "integer"
                        },
                        "chunk_bytes": {
                          "description": "size of one piece of file content",
                          "type": "integer"
                        },
                        "file_bytes": {
                          "description": "largest file, in pieces of that size",
                          "type": "integer"
                        },
                        "frame_payload_bytes": {
                          "description": "largest frame body",
                          "type": "integer"
                        },
                        "inflight_bytes": {
                          "description": "content a sender may have unacknowledged",
                          "type": "integer"
                        },
                        "keepalive_ms": {
                          "description": "silence after which a peer sends a ping",
                          "type": "integer"
                        }
                      },
                      "required": [
                        "changes_per_batch",
                        "chunk_bytes",
                        "file_bytes",
                        "frame_payload_bytes",
                        "inflight_bytes",
                        "keepalive_ms"
                      ],
                      "type": "object"
                    },
                    "workspace_api": {
                      "additionalProperties": false,
                      "properties": {
                        "list_entries": {
                          "description": "most entries one listing returns",
                          "type": "integer"
                        },
                        "read_bytes": {
                          "description": "largest range one read returns",
                          "type": "integer"
                        },
                        "requests_per_minute": {
                          "description": "requests accepted on each route from all callers together",
                          "type": "integer"
                        },
                        "wait_ms": {
                          "description": "longest a wait request stays open",
                          "type": "integer"
                        },
                        "write_bytes": {
                          "description": "largest file one PUT stores",
                          "type": "integer"
                        }
                      },
                      "required": [
                        "list_entries",
                        "read_bytes",
                        "requests_per_minute",
                        "wait_ms",
                        "write_bytes"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "credentials",
                    "protocol",
                    "workspace_api"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Success",
            "headers": {
              "API-Version": {
                "$ref": "#/components/headers/API-Version"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            }
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Invalid request parameters or body (RFC 9457 problem details)"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Resource not found (RFC 9457 problem details)"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Rate limit exceeded; wait Retry-After seconds before retrying",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Error (RFC 9457 problem details)"
          }
        },
        "summary": "Read the limits on files, requests, changes and connections. Use it before moving a large file or a large tree, to decide between one request and several. Returns sizes in bytes, times in milliseconds and counts, for the workspace API and for the protocol.",
        "x-idempotent": true,
        "x-read-only": true
      }
    },
    "/api/operations": {
      "get": {
        "operationId": "list_workspace_operations",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "authentication": {
                      "description": "what every one of these needs",
                      "type": "string"
                    },
                    "operations": {
                      "description": "every operation",
                      "items": {
                        "additionalProperties": false,
                        "properties": {
                          "method": {
                            "description": "the HTTP method",
                            "type": "string"
                          },
                          "path": {
                            "description": "the path on this origin",
                            "type": "string"
                          },
                          "purpose": {
                            "description": "what it does",
                            "type": "string"
                          }
                        },
                        "required": [
                          "method",
                          "path",
                          "purpose"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "authentication",
                    "operations"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Success",
            "headers": {
              "API-Version": {
                "$ref": "#/components/headers/API-Version"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            }
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Invalid request parameters or body (RFC 9457 problem details)"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Resource not found (RFC 9457 problem details)"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Rate limit exceeded; wait Retry-After seconds before retrying",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Error (RFC 9457 problem details)"
          }
        },
        "summary": "List the operations of the workspace API, which needs a signed-in session. Use it to plan work with a workspace before signing in: creating one, reading and writing files, or connecting a sandbox. Returns the method, path and purpose of each operation.",
        "x-idempotent": true,
        "x-read-only": true
      }
    },
    "/api/paths/check": {
      "get": {
        "operationId": "check_path",
        "parameters": [
          {
            "in": "query",
            "name": "path",
            "required": true,
            "schema": {
              "description": "the path, relative to the workspace root",
              "examples": [
                "src/main.rs"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "path": {
                      "description": "the path that was checked",
                      "type": "string"
                    },
                    "reason": {
                      "description": "why it is refused, or null",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "valid": {
                      "description": "true when the service would accept it",
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "path",
                    "reason",
                    "valid"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Success",
            "headers": {
              "API-Version": {
                "$ref": "#/components/headers/API-Version"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            }
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Invalid request parameters or body (RFC 9457 problem details)"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Resource not found (RFC 9457 problem details)"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Rate limit exceeded; wait Retry-After seconds before retrying",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Error (RFC 9457 problem details)"
          }
        },
        "summary": "Check whether a path may be stored in a workspace. Use it before writing a generated or imported file name; it applies the same rule as the service and the sandbox daemon, and reads no workspace. Returns valid, and the reason when the path is refused.",
        "x-idempotent": true,
        "x-read-only": true
      }
    },
    "/api/protocol": {
      "get": {
        "operationId": "get_protocol",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "frame_header_bytes": {
                      "description": "the fixed header before every message body",
                      "type": "integer"
                    },
                    "lanes": {
                      "description": "the two connections of one session",
                      "items": {
                        "additionalProperties": false,
                        "properties": {
                          "carries": {
                            "description": "what travels on it",
                            "type": "string"
                          },
                          "name": {
                            "description": "the connection",
                            "type": "string"
                          },
                          "path": {
                            "description": "its WebSocket path",
                            "type": "string"
                          }
                        },
                        "required": [
                          "carries",
                          "name",
                          "path"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "messages": {
                      "description": "every message kind",
                      "items": {
                        "additionalProperties": false,
                        "properties": {
                          "kind": {
                            "description": "its number in the frame header",
                            "type": "integer"
                          },
                          "lane": {
                            "description": "the connection it travels on",
                            "enum": [
                              "control",
                              "content",
                              "either"
                            ],
                            "type": "string"
                          },
                          "name": {
                            "description": "the message",
                            "type": "string"
                          },
                          "purpose": {
                            "description": "what it is for",
                            "type": "string"
                          },
                          "sent_by": {
                            "description": "which side sends it",
                            "enum": [
                              "sandbox",
                              "service",
                              "either"
                            ],
                            "type": "string"
                          }
                        },
                        "required": [
                          "kind",
                          "lane",
                          "name",
                          "purpose",
                          "sent_by"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "version": {
                      "description": "the protocol version",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "frame_header_bytes",
                    "lanes",
                    "messages",
                    "version"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Success",
            "headers": {
              "API-Version": {
                "$ref": "#/components/headers/API-Version"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            }
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Invalid request parameters or body (RFC 9457 problem details)"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Resource not found (RFC 9457 problem details)"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Rate limit exceeded; wait Retry-After seconds before retrying",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Error (RFC 9457 problem details)"
          }
        },
        "summary": "Read the synchronization protocol message by message. Use it when you are writing or debugging a client, or want to know what a frame's kind number means. Returns the frame header length, the two connections, and the number, sender and purpose of every message.",
        "x-idempotent": true,
        "x-read-only": true
      }
    },
    "/api/service": {
      "get": {
        "operationId": "get_service",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "name": {
                      "description": "the service",
                      "type": "string"
                    },
                    "protocol_version": {
                      "description": "the version every synchronization frame carries",
                      "type": "integer"
                    },
                    "storage_reachable": {
                      "description": "true when the workspace registry answered just now",
                      "type": "boolean"
                    },
                    "synchronization": {
                      "additionalProperties": false,
                      "properties": {
                        "authentication": {
                          "description": "what a sandbox presents",
                          "type": "string"
                        },
                        "content_path": {
                          "description": "the WebSocket path for file content",
                          "type": "string"
                        },
                        "control_path": {
                          "description": "the WebSocket path for changes and commits",
                          "type": "string"
                        }
                      },
                      "required": [
                        "authentication",
                        "content_path",
                        "control_path"
                      ],
                      "type": "object"
                    },
                    "version": {
                      "description": "the version of this API",
                      "type": "string"
                    },
                    "workspace_api": {
                      "additionalProperties": false,
                      "properties": {
                        "authentication": {
                          "description": "what it needs",
                          "type": "string"
                        },
                        "path": {
                          "description": "where it starts",
                          "type": "string"
                        }
                      },
                      "required": [
                        "authentication",
                        "path"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "name",
                    "protocol_version",
                    "storage_reachable",
                    "synchronization",
                    "version",
                    "workspace_api"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Success",
            "headers": {
              "API-Version": {
                "$ref": "#/components/headers/API-Version"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            }
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Invalid request parameters or body (RFC 9457 problem details)"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Resource not found (RFC 9457 problem details)"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Rate limit exceeded; wait Retry-After seconds before retrying",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Error (RFC 9457 problem details)"
          }
        },
        "summary": "Read what this service is and whether its storage answers now. Use it as a health check, or first to learn where the workspace API and the synchronization connections are. Returns the version, the protocol version, the storage state and the entry points.",
        "x-idempotent": true,
        "x-read-only": true
      }
    }
  },
  "security": [
    {},
    {
      "oauth2": [
        "apps:discover",
        "apps:read"
      ]
    }
  ],
  "servers": [
    {
      "url": "https://chronicle-sync.ferrite.run"
    }
  ],
  "x-agent-card": "https://chronicle-sync.ferrite.run/.well-known/agent-card.json",
  "x-ard-catalog": "https://chronicle-sync.ferrite.run/.well-known/ard.json",
  "x-llms-txt": "https://chronicle-sync.ferrite.run/llms.txt",
  "x-mcp-endpoint": "https://chronicle-sync.ferrite.run/mcp",
  "x-webmcp": "https://chronicle-sync.ferrite.run/.well-known/webmcp.js"
}