FieldCure.AssistStudio.Core
0.19.2
dotnet add package FieldCure.AssistStudio.Core --version 0.19.2
NuGet\Install-Package FieldCure.AssistStudio.Core -Version 0.19.2
<PackageReference Include="FieldCure.AssistStudio.Core" Version="0.19.2" />
<PackageVersion Include="FieldCure.AssistStudio.Core" Version="0.19.2" />
<PackageReference Include="FieldCure.AssistStudio.Core" />
paket add FieldCure.AssistStudio.Core --version 0.19.2
#r "nuget: FieldCure.AssistStudio.Core, 0.19.2"
#:package FieldCure.AssistStudio.Core@0.19.2
#addin nuget:?package=FieldCure.AssistStudio.Core&version=0.19.2
#tool nuget:?package=FieldCure.AssistStudio.Core&version=0.19.2
FieldCure.AssistStudio.Core
App-level helpers and models for AssistStudio — tool orchestration, specialist agents, workspace context, and MCP server management. AI providers live in FieldCure.Ai.Providers.
Features
- Tool Orchestration —
ToolCallExecutorwith confirmation handler and parallel execution,ToolResolverfor built-in/MCP tool merge - Specialist Agents —
ISpecialistinterface for domain-specific sub-agent routing (e.g., Web Search Specialist) - Knowledge Base —
KnowledgeBasemodel for multi-KB metadata persistence - Workspace Context —
IWorkspaceContextfor dynamic system prompt injection - MCP Server Management — Built-in server lifecycle (install, update, connect) via
BuiltInServerHelper - RAG Support —
IContextProviderretrievesContextChunks for queries - Structured Logging —
DiagnosticLoggerwith pluggable callbacks - Hardware Probing —
HardwareProbefor GPU/CPU detection (Ollama compatibility) - Platform-Agnostic — Targets
net8.0
Note: AI providers (Claude, OpenAI, Gemini, Ollama, Groq), streaming, and shared models (
ChatMessage,AiRequest,IAssistTool, etc.) are inFieldCure.Ai.Providers. See Supported Providers.
Install
dotnet add package FieldCure.AssistStudio.Core
Tool Execution
ToolCallExecutor runs tool calls with optional user confirmation and parallel execution:
using FieldCure.AssistStudio.Core.Helpers;
var executor = new ToolCallExecutor([weatherTool, fileTool, searchTool]);
// User confirmation — returns (Approved, UserNote)
executor.ConfirmationHandler = async (toolName, argsJson) =>
{
var approved = await ShowConfirmationDialog(toolName, argsJson);
return (approved, userNote: null);
};
// Execute a single tool call
var result = await executor.ExecuteAsync(toolCall);
Console.WriteLine(result.Text);
// Multimedia results (IMultiContentTool)
foreach (var media in result.MediaItems)
Console.WriteLine($" {media.MimeType}: {media.FileName}");
Tool Resolution
ToolResolver merges built-in tools with MCP tools, prefixing names on conflict:
using FieldCure.AssistStudio.Core.Helpers;
// Built-in "read_file" + MCP "read_file" → MCP tool becomes "filesystem_read_file"
var tools = ToolResolver.Resolve(builtInTools, mcpTools, conversationState);
Specialist Agents
Define domain-specific specialists for sub-agent routing via ISpecialist:
using FieldCure.AssistStudio.Core;
public class WebSearchSpecialist : ISpecialist
{
public string Name => "web_search_specialist";
public string DisplayName => "Web Search Specialist";
public string? Icon => null;
public IReadOnlyList<string> AllowedTools { get; } =
["web_search", "web_fetch", "run_javascript"];
public IReadOnlyList<string> FallbackServers { get; } = ["builtin_essentials"];
public int MaxRounds => 15;
public TimeSpan Timeout => TimeSpan.FromMinutes(2);
public string BuildSystemPrompt(
string userQuery, IReadOnlyDictionary<string, string>? contextHints = null)
{
return $"""
You are a web research specialist.
Search the web, read relevant pages, and produce a concise report.
## Task
{userQuery}
""";
}
}
Routing hints for the parent
ISpecialist itself only defines the sub-agent's own contract.
Implementations can additionally expose a plain const string (by
convention named RoutingGuideline) that the host appends to the
parent conversation's system prompt. This is how the host steers
the parent on when to delegate and how to handle the specialist's
result — e.g. forward the returned report verbatim, re-invoke on
status: "truncated", or preserve the specialist parameter on retry
instead of falling back to generic delegate_task arguments.
WebSearchSpecialist.RoutingGuideline and
JudgmentSpecialist.RoutingGuideline in AssistStudio are reference
patterns. The constant is not part of the ISpecialist interface —
the host that knows about a specialist appends its guideline
explicitly when building the parent system prompt.
Tip: model choice per specialist
Different LLM families handle long structured protocols differently.
Specialists that spell out an elaborate multi-phase dialectic (e.g. the
Judgment protocol's ASSERT → CHALLENGE → SYNTHESIZE loop) behave
noticeably differently depending on the underlying model:
- Compression-oriented models tend to execute the protocol with
purpose-first summarization — they produce the final report inside
a single
max_tokensbudget and returnstatus: "completed". - Verbatim-oriented models tend to follow the protocol section by
section and more easily hit
max_tokensmid-synthesis, returningstatus: "truncated". The routing guideline's re-invocation rule still recovers a usable report, but at higher token cost.
This is not a correctness issue — the pipeline handles both paths —
but it's worth considering when picking the provider preset a
specialist runs under. The host already exposes this knob via the
specialistPresetProvider delegate passed to SubAgentTool; a future
revision of ISpecialist may also carry a PreferredProvider hint.
Workspace Context
Inject dynamic context into the system prompt based on app state:
public class MyWorkspace : IWorkspaceContext
{
public string? ActiveLabel => "Project: MyApp";
public Task<string?> GetContextAsync(CancellationToken ct = default)
=> Task.FromResult<string?>($"Current file: {_currentFile}");
}
Diagnostic Logging
Wire up DiagnosticLogger to capture internal events from providers and helpers:
DiagnosticLogger.OnException = ex => logger.LogError(ex, "AssistStudio error");
DiagnosticLogger.OnWarning = msg => logger.LogWarning(msg);
DiagnosticLogger.OnInfo = msg => logger.LogInformation(msg);
Key Types
Core Types
| Type | Description |
|---|---|
ToolCallExecutor |
Executes tool calls with confirmation handler and parallel execution. Supports IMultiContentTool for multimedia results |
ToolResolver |
Merges built-in and MCP tools with conflict resolution |
ISpecialist |
Specialist agent interface — Name, DisplayName, AllowedTools, BuildSystemPrompt |
KnowledgeBase |
KB metadata — Id, Name, SourcePaths, Embedding/Contextualizer config |
IWorkspaceContext |
Dynamic system prompt injection interface |
IContextProvider |
RAG retrieval interface — returns ContextChunks for a query |
BuiltInServerConfig |
Configuration for built-in MCP servers (enabled, folders, search engine) |
Profile |
System prompt (SystemPrompt) + tool/server selection preset |
McpServerConfig |
MCP server connection configuration (command, args, transport) |
DiagnosticLogger |
Structured logging with OnException/OnWarning/OnInfo callbacks |
HardwareProbe |
GPU/CPU detection for Ollama model compatibility |
From FieldCure.Ai.Providers (transitive dependency)
| Type | Description |
|---|---|
IAiProvider |
Provider interface — completion, streaming, model listing, thinking support |
StreamEvent |
Discriminated union — TextDelta, ThinkingDelta, ToolCallStart, Usage, StreamCompleted |
IAssistTool |
Tool/function calling interface with optional confirmation |
AiRequest / AiResponse |
Request and response models |
ChatMessage |
Conversation message with role, content, attachments, and tree branching |
ProviderModel |
Saved provider configuration — model, temperature, thinking, PDF capability (renamed from ProviderPreset in Ai.Providers 0.7.0) |
McpToolAdapter |
Bridges MCP tools to IAssistTool (zero MCP SDK dependency) |
Related Packages
- FieldCure.Ai.Providers — AI provider clients (Claude, OpenAI, Gemini, Ollama, Groq) and shared models. Core depends on this.
- FieldCure.Ai.Execution — Agent loop and sub-agent execution engine built on Providers.
- FieldCure.AssistStudio.Controls.WinUI — WinUI 3 chat UI controls built on this library.
License
MIT — Copyright (c) 2026 FieldCure Co., Ltd.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- FieldCure.Ai.Providers (>= 0.7.2)
- Microsoft.Win32.Registry (>= 5.0.0)
- System.Management (>= 9.0.15)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on FieldCure.AssistStudio.Core:
| Package | Downloads |
|---|---|
|
FieldCure.AssistStudio.Controls.WinUI
AI Chat UI Controls for WinUI 3. Supports Claude, OpenAI, Gemini, Ollama and more. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.19.2 | 69 | 5/5/2026 |
| 0.19.1 | 80 | 5/4/2026 |
| 0.19.0 | 65 | 5/4/2026 |
| 0.18.0 | 99 | 4/27/2026 |
| 0.17.0 | 96 | 4/21/2026 |
| 0.16.0 | 92 | 4/14/2026 |
| 0.15.0 | 102 | 4/10/2026 |
| 0.14.0 | 94 | 4/7/2026 |
| 0.13.0 | 100 | 3/31/2026 |
| 0.12.0 | 106 | 3/30/2026 |
| 0.11.0 | 101 | 3/29/2026 |
| 0.10.0 | 98 | 3/24/2026 |
| 0.9.0 | 101 | 3/24/2026 |
| 0.8.0 | 88 | 3/22/2026 |
| 0.7.0 | 94 | 3/21/2026 |
| 0.6.0 | 102 | 3/17/2026 |
| 0.5.0 | 102 | 3/17/2026 |
| 0.4.0 | 100 | 3/17/2026 |
v0.19.2: Rebuilt against FieldCure.Ai.Providers 0.7.2 so the Claude Opus 4.7 adaptive thinking-shape fix flows transitively to consumers of FieldCure.AssistStudio.Controls.WinUI / .Core (NuGet's lowest-applicable resolver previously stayed pinned to 0.7.1 through Core 0.19.1). No code or public API changes.