/**
 * @typedef {"repo"|"deploy"|"ref"} DesiredItemSourceKind
 */

/**
 * @typedef {Object} DesiredItemSource
 * @property {DesiredItemSourceKind} kind
 * @property {string} path
 * @property {string|null} ref
 */

/**
 * @typedef {"user"|"root"} DesiredItemOwnership
 */

/**
 * @typedef {"symlink"|"copy"|"git-checkout"|"unit"} DesiredItemStrategy
 */

/**
 * @typedef {"audit"|"converge"|"harden"} DesiredItemMode
 */

/**
 * @typedef {"fleet"|"remote-seat-provision"} DesiredItemOwner
 */

/**
 * @typedef {Object} DesiredItem
 * @property {string} id
 * @property {DesiredItemSource} source
 * @property {string} destination
 * @property {DesiredItemOwnership} ownership
 * @property {DesiredItemStrategy} strategy
 * @property {DesiredItemMode} mode
 * @property {string} content_digest
 * @property {DesiredItemOwner} owner
 */

/**
 * @typedef {Object} TransportReadResult
 * @property {boolean} exists
 * @property {string|null} digest
 * @property {"user"|"root"} ownership
 * @property {string|null} mode
 * @property {string|null} linkTarget
 */

/**
 * @typedef {Object} TransportUnitState
 * @property {boolean} enabled
 * @property {boolean} active
 */

/**
 * @typedef {Object} Transport
 * @property {"local"|"ssh"} name
 * @property {(path: string) => Promise<TransportReadResult>} read
 * @property {(item: DesiredItem, stagedBytes: Buffer) => Promise<void>} write
 * @property {(unitName: string) => Promise<TransportUnitState>} unitState
 * @property {(path: string) => Promise<string|null>} gitRef
 */

export {};
