using ClawdDotNet.Core.Memory; using ClawdDotNet.Core.State; using ClawdDotNet.Core.Tasks; using Microsoft.Extensions.Logging; namespace ClawdDotNet.Core.Tools; public sealed record AgentToolContext( string AgentId, string InstanceId, IReadOnlyDictionary ToolConfig, IStateStore StateStore, ILogger Logger, CancellationToken CancellationToken, string? WorkspacePath = null, string? SharedWorkspacePath = null, IAgentMessageRouter? MessageRouter = null, IMemoryRepository? Memory = null, ITaskRepository? Tasks = null, /// /// Wer an diesem Aufruf schon beteiligt ist. Werkzeuge, die einen anderen Agenten /// beauftragen, reichen die Kette weiter — sonst kann die Engine einen Zyklus /// nicht von einer neuen Delegation unterscheiden. Siehe . /// DelegationChain? Delegation = null ) { /// /// Die Freigabestelle hat diesen Aufruf geprueft und zugelassen - als erlaubte Operation, /// per Dauerfreigabe oder als einzeln freigegebener Vorschlag (#641). Ein Werkzeug darf /// seine eigene Rechtepruefung dann auslassen; sonst wuerde ein freigegebenes ALTER eines /// Agenten, der nur schreiben darf, erst nach der Freigabe am Werkzeug scheitern. /// Ohne Freigabestelle bleibt es false, und das Werkzeug prueft selbst. /// public bool FreigabeGeprueft { get; init; } /// /// #683: The organisation at the time of the call. Tools that let an agent address /// another — a task assignment, for instance — check the address book here, so it cannot /// be walked around. null in tests and outside the engine: no structure, no limit. /// public Organisation.OrgChart? Organisation { get; init; } /// /// #715: The calling agent's trust tier, from its tools. Tools that let an agent write to /// someone above it check the way up here. Standard in tests and outside the engine. /// /// #689: The desk for escalations, conflicts and decisions. null outside the engine. public Cases.ICaseDesk? Cases { get; init; } /// #687: Approvals a lead decides for the agents below it. null outside the engine. public Staging.ILeadApprovals? Approvals { get; init; } /// #698: The units' doctrines. null outside the engine. public Organisation.IDoctrineStore? Doctrines { get; init; } /// #693: The spot checks of a lead. null outside the engine. public Inspection.ISpotChecks? SpotChecks { get; init; } /// #654: Where code runs — never in the main process. Unavailable under Windows. public Sandbox.ISandboxRunner? Sandbox { get; init; } /// #717: Special budgets — set up by an approved request_budget. public Budget.ISpecialBudgetRepository? SpecialBudgets { get; init; } /// /// #720: Which version of a shared file each agent read. Tools that replace files in a /// shared workspace check it first. null in tests and outside the engine: no check. /// public Files.FileLedger? Files { get; init; } /// /// #719: The history of the workspaces. Tools that change a file keep the version before /// and journal the change, with this call's agent and run. null: no history. /// public Files.FileHistory? History { get; init; } /// #697: The run this call belongs to — for stamping where something came from. public string? RunId { get; init; } /// #697: The task that run works on, if it was started for one. public string? RunTaskId { get; init; } public global::ClawdDotNet.Core.Organisation.AgentTrust Trust { get; init; } = global::ClawdDotNet.Core.Organisation.AgentTrust.Standard; }