{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/danilo-aguiar-br/ssh-cli/docs/schemas/scp-transfer.schema.json",
"title": "scp transfer JSON",
"description": "Structured success payload on stdout for `ssh-cli scp upload|download --json` (or global --output-format json). Regular files only. Failures use error-envelope.schema.json on stderr.",
"type": "object",
"additionalProperties": true,
"required": [
"ok",
"event",
"target_resolved",
"target_source",
"direction",
"vps",
"local",
"remote",
"bytes",
"duration_ms"
],
"properties": {
"target_resolved": {
"type": "string",
"description": "Canonical name of the host the transfer reached (Explicit Target Designation). Mirrors `vps`; bind new consumers here. `host_resolved` is the 0.5.5 read alias, written from the same value."
},
"target_source": {
"type": "string",
"enum": ["argv", "active_marker", "selector"],
"description": "How the target was designated: `argv` for a name typed in this invocation, `selector` for --all/--hosts. Transfers never read the active marker, so `active_marker` does not occur here. Without this field a fleet transfer and a single-host transfer to the same name were byte-identical on the wire."
},
"host_resolved": {
"type": "string",
"description": "Compatibility alias of target_resolved (0.5.5 spelling)."
},
"host_source": {
"type": "string",
"enum": ["argv", "active_marker", "selector"],
"description": "Compatibility alias of target_source (0.5.5 spelling)."
},
"ok": {
"type": "boolean",
"const": true
},
"event": {
"type": "string",
"const": "scp-transfer",
"description": "Event discriminator for agent multiplex (GAP-SSH-IO-009); parity with tunnel_listening"
},
"direction": {
"type": "string",
"enum": ["upload", "download"]
},
"vps": {
"type": "string",
"description": "Registered VPS name used for the transfer"
},
"local": {
"type": "string",
"description": "Local filesystem path"
},
"remote": {
"type": "string",
"description": "Remote filesystem path"
},
"bytes": {
"type": "integer",
"minimum": 0,
"description": "Bytes transferred"
},
"duration_ms": {
"type": "integer",
"minimum": 0,
"description": "Wall time of the transfer in milliseconds"
},
"mtime_preserved": {
"type": "boolean",
"default": true,
"description": "G-SCP-R01: whether the remote modification time was applied to the local file. Preservation is best-effort, not a guarantee: destination filesystems that cannot represent it (FAT32, exFAT, some bind mounts, WSL interop paths) yield false while the payload itself is byte-exact and fsynced. Additive since the 0.5.4 line; absent means true."
},
"durable": {
"type": "boolean",
"default": true,
"description": "G-SCP-R02: whether the parent directory was fsynced after the atomic rename. False means the file content reached stable storage but the directory entry may not survive a crash. Additive since the 0.5.4 line; absent means true."
}
}
}