mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-05 23:09:40 +00:00
Build and Release / Determine run mode (push) Waiting to run
Build and Release / Read metadata (push) Blocked by required conditions
Build and Release / Sync Flatpak repo (push) Blocked by required conditions
Build and Release / Collect Flatpak artifacts (push) Blocked by required conditions
Build and Release / Verify (push) Waiting to run
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-pc-windows-msvc.exe, win-arm64, windows-latest, aarch64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-unknown-linux-gnu, linux-arm64, ubuntu-22.04-arm, aarch64-unknown-linux-gnu, appimage,updater, appimage) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-apple-darwin, osx-x64, macos-latest, x86_64-apple-darwin, dmg,app,updater, dmg) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-pc-windows-msvc.exe, win-x64, windows-latest, x86_64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Prepare & create release (push) Blocked by required conditions
Build and Release / Publish release (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-apple-darwin, osx-arm64, macos-latest, aarch64-apple-darwin, dmg,app,updater, dmg) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-unknown-linux-gnu, linux-x64, ubuntu-22.04, x86_64-unknown-linux-gnu, appimage,updater, appimage) (push) Blocked by required conditions
30 lines
1.6 KiB
C#
30 lines
1.6 KiB
C#
using AIStudio.Tools.Databases.IndexStore;
|
|
|
|
namespace AIStudio.Tools.ToolCallingSystem.ToolCallingImplementations.Mailboxes;
|
|
|
|
/// <summary>
|
|
/// The conditions a model set for the mails a tool searches or counts.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// The folder stays a name until a mailbox is searched: every mailbox has folders of its own, and
|
|
/// only its own list can tell which of them the name means.
|
|
/// </remarks>
|
|
/// <param name="Filter">The conditions apart from the folder.</param>
|
|
/// <param name="Folder">The full path of the folder the mails have to lie in, as the model wrote it, or null for any folder.</param>
|
|
internal sealed record MailConditions(MailFilter Filter, string? Folder)
|
|
{
|
|
/// <summary>
|
|
/// The conditions for one mailbox, with the folder turned into the paths it stands for there.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// A folder is found by its full path, regardless of case, since a model writes "Inbox" as
|
|
/// readily as "INBOX". Its subfolders are not included: they are folders of their own, and the
|
|
/// model can name them. In a mailbox without such a folder, the condition matches no mail at
|
|
/// all, never every mail.
|
|
/// </remarks>
|
|
/// <param name="folders">The folders of the mailbox.</param>
|
|
/// <returns>The conditions for that mailbox.</returns>
|
|
public MailFilter ForMailbox(IReadOnlyList<MailFolderRecord> folders) => this.Folder is null
|
|
? this.Filter
|
|
: this.Filter with { FolderPaths = folders.Where(folder => string.Equals(folder.Path, this.Folder, StringComparison.OrdinalIgnoreCase)).Select(folder => folder.Path).ToList() };
|
|
} |