Description

Self improve set tool spec

Saves the tool-under-test spec to workspace config (step 1 of smoke test). Example: tool_name ping_self, description Returns pong, category self, invoke_body return \

Included in Version 8

Dynamically extracted tool implementation.
How to register SelfImprovementToolscsharp
registry.Register(new AgentTool(            "self_improve_set_tool_spec",            "Saves the tool-under-test spec to workspace config (step 1 of smoke test). Example: tool_name ping_self, description Returns pong, category self, invoke_body return \"pong\";",            InvokeSetToolSpec,            new            {                type = "object",                properties = new                {                    tool_name = new { type = "string", description = "Snake_case name, e.g. ping_self." },                    description = new { type = "string", description = "What the tool does." },                    category = new { type = "string", description = "core, addon, or self (default self)." },                    invoke_body = new { type = "string", description = "C# body, e.g. return \"pong\";" },                },                required = new[] { "tool_name", "description" },            },            ToolCategory.Self));
Helper classes for SelfImprovementToolscsharp
    private string InvokeSetToolSpec(string argumentsJson)    {        var workspace = RequireWorkspace();        var spec = ToolSpecStore.ParseFromJson(argumentsJson);        if (!spec.IsComplete)        {            return "Error: self_improve_set_tool_spec requires tool_name and description (category defaults to self).";        }        spec.Save(workspace);        return $"Tool spec saved: {spec.ToolName} ({spec.Category}). Path: {ToolSpecStore.GetSpecPath(workspace)}";    }