// engine/agent-ready-exporter/formatters/swe-agent.ts — SWE-agent trajectory format — SPEC-318
/**
 * Build trajectory hints from spec context.
 * SWE-agent benefits from structured thought/action pairs as navigation hints.
 */
function buildTrajectoryHints(spec) {
    const steps = [
        {
            thought: `I need to implement: ${spec.agent_context.objective}`,
            action: `Read existing files: ${spec.agent_context.files_to_modify.join(', ') || 'none to modify'}`,
        },
    ];
    if (spec.agent_context.files_to_create.length > 0) {
        steps.push({
            thought: 'I need to create new files as specified',
            action: `Create files: ${spec.agent_context.files_to_create.join(', ')}`,
        });
    }
    steps.push({
        thought: 'Run tests to verify the implementation',
        action: spec.agent_context.test_command,
    }, {
        thought: 'Validate the full solution',
        action: spec.agent_context.validation_command,
    });
    return steps;
}
/**
 * Augment an AgentReadySpec with SWE-agent trajectory hints and instance metadata.
 */
export function formatSweAgent(spec) {
    const sweSpec = {
        ...spec,
        _format: 'swe-agent',
        instance_id: `${spec.spec_id.toLowerCase().replace(/[^a-z0-9]/g, '-')}-instance`,
        trajectory_hints: buildTrajectoryHints(spec),
    };
    return JSON.stringify(sweSpec, null, 2);
}
//# sourceMappingURL=swe-agent.js.map