Skip to content

sync_push

🚧 설계 단계 — 아직 구현 안 됨

이 페이지는 ainote 의 향후 기능을 미리 문서화한 것입니다. 현재 @ainote/mcp v1.1.x 에는 vault / sync 도구가 포함돼 있지 않습니다. 도구 호출 시 Tool not found 에러를 받게 됩니다.

로컬 파일 → ainote hub. sync 시스템 의 일부.

시그니처

json
{
  "name": "sync_push",
  "arguments": {
    "path": "global/CLAUDE.md",
    "content": "<file content>",
    "sha256": "abc123...",
    "hlc": "2026-05-07T14:01:00.000Z.0.macmini",
    "device_id": "macmini-2026-04-A1B2"
  }
}
파라미터타입필수설명
pathstringainote vault 내 경로
contenttext파일 본문
sha256stringcontent 의 SHA-256 (서버 검증)
hlcstringHybrid Logical Clock
device_idstring송신 디바이스 식별
mtimeISO 8601로컬 mtime (충돌 임계 비교용)

응답

json
{
  "path": "global/CLAUDE.md",
  "git_sha": "def456...",
  "hlc": "2026-05-07T14:01:00.000Z.0.macmini",
  "previous_hlc": "2026-05-06T...",
  "size_bytes": 12345,
  "stored_at": "2026-05-07T14:01:01Z"
}

충돌

서버가 더 새로운 HLC 가지고 있으면:

json
{
  "error": {
    "code": -32006,
    "message": "Conflict: server has newer HLC",
    "data": {
      "your_hlc": "2026-05-07T14:01:00.0.macmini",
      "server_hlc": "2026-05-07T14:02:30.0.macbook",
      "time_diff_seconds": 90
    }
  }
}

→ 클라이언트가 sync-now.sh 알고리즘에 따라 처리 (conflicts).

sha256 검증

서버가 받은 content 의 sha256 을 계산해서 클라이언트가 보낸 것과 비교. 다르면:

json
{ "error": { "code": -32602, "message": "sha256 mismatch" } }

→ 전송 중 손상 가능성 → 재시도.

에러

코드메시지
-32602invalid path
-32602sha256 mismatch
-32006conflict
-32004quota exceeded (5 GB)

다음

MIT License · ainote.dev