package com.correx.core.artifacts.kind

object FileWrittenKind : ArtifactKind {
    override val id: String = "file_written"
    override val llmEmitted: Boolean = false

    override fun deriveJsonSchema(): JsonSchema = JsonSchema(
        type = "object",
        properties = mapOf(
            "path" to JsonSchemaProperty(type = "string", description = "Relative file path, no .. components"),
            "content" to JsonSchemaProperty(type = "string", description = "File content"),
            "mode" to JsonSchemaProperty(type = "string", description = "Unix file mode", default = "0644"),
            "diff" to JsonSchemaProperty(type = "string", description = "Unified diff of the change"),
        ),
        required = listOf("path", "content"),
        additionalProperties = false,
    )
}
