V17 / PROJECTS

project_store_operation

Application-bound scenario operation. Named XML inputs control execution; this is not a main-agent tool.

See source registrationIntroduced in V11V17

What it does

Read the exact source snapshot below for its parameters, behavior, and registration.

Read the implementation

This page describes the selected release. The source link points to the same exact commit; it cannot silently open a newer implementation.

Lilith/Core/Projects/ProjectOperations.cs ↗

Implementation code

Read the implementation from this version's exact source snapshot. Helper links below stay on the same release.

Lilith/Core/Projects/ProjectOperations.cs

C#
namespace Lilith.Core.Projects;

internal static class ProjectOperations
{
    internal static readonly string[] Names = ["project_check_architecture_operation", "project_prepare_operation", "project_store_operation", "project_assemble_operation", "project_inspect_operation", "project_validate_operation", "project_review_operation", "project_stage_operation"];
    internal static async Task<string> ExecuteAsync(ProjectGeneration projects, string name, IReadOnlyDictionary<string, string> inputs, CancellationToken ct)
    {
        string Get(string key) => inputs.GetValueOrDefault(key, "");
        ct.ThrowIfCancellationRequested();
        if (name == "project_check_architecture_operation")
        {
            try { return projects.Prepare(Get("name"), Get("kind"), Get("prd"), Get("architecture"), validateOnly: true); }
            catch (Exception ex) when (ex is ArgumentException or InvalidDataException or System.Text.Json.JsonException)
            { return ProjectJson.Serialize(new { valid = false, diagnostics = ex.Message }); }
        }
        if (name == "project_validate_operation")
        {
            try { return await projects.ValidateAsync(Get("generation_id"), Get("bundle"), ct); }
            catch (Exception ex) when (ex is InvalidDataException or System.Text.Json.JsonException or System.Xml.XmlException)
            {
                projects.RecordDiagnostic(ex.Message);
                return ProjectJson.Serialize(new { passed = false, report = new { errors = new[] { ex.Message }, checks = Array.Empty<string>(), buildOutput = "" } });
            }
        }
        return name switch
        {
            "project_prepare_operation" => projects.Prepare(Get("name"), Get("kind"), Get("prd"), Get("architecture")),
            "project_store_operation" => projects.Store(Get("generation_id"), Get("task_id"), Get("content")),
            "project_assemble_operation" => projects.Assemble(Get("generation_id")),
            "project_inspect_operation" => projects.Inspect(Get("generation_id")),
            "project_review_operation" => projects.Review(Get("generation_id"), Get("report")),
            "project_stage_operation" => projects.Stage(Get("generation_id")),
            _ => throw new ArgumentException("Unknown project operation.")
        };
    }
}

Scenarios using this tool