![]() |
VOOZH | about |
dotnet add package FieldCure.AssistStudio.Core --version 0.20.0
NuGet\Install-Package FieldCure.AssistStudio.Core -Version 0.20.0
<PackageReference Include="FieldCure.AssistStudio.Core" Version="0.20.0" />
<PackageVersion Include="FieldCure.AssistStudio.Core" Version="0.20.0" />Directory.Packages.props
<PackageReference Include="FieldCure.AssistStudio.Core" />Project file
paket add FieldCure.AssistStudio.Core --version 0.20.0
#r "nuget: FieldCure.AssistStudio.Core, 0.20.0"
#:package FieldCure.AssistStudio.Core@0.20.0
#addin nuget:?package=FieldCure.AssistStudio.Core&version=0.20.0Install as a Cake Addin
#tool nuget:?package=FieldCure.AssistStudio.Core&version=0.20.0Install as a Cake Tool
App-level helpers and models for AssistStudio — tool orchestration, specialist agents, workspace context, and MCP server management. AI providers live in FieldCure.Ai.Providers.
ToolCallExecutor with confirmation handler and parallel execution, ToolResolver for built-in/MCP tool mergeISpecialist interface for domain-specific sub-agent routing (e.g., Web Search Specialist)KnowledgeBase model for multi-KB metadata persistenceIWorkspaceContext for dynamic system prompt injectionBuiltInServerHelperIContextProvider retrieves ContextChunks for queriesDiagnosticLogger with pluggable callbacksHardwareProbe for GPU/CPU detection (Ollama compatibility)net8.0Note: AI providers (Claude, OpenAI, Gemini, Ollama, Groq), streaming, and shared models (
ChatMessage,AiRequest,IAssistTool, etc.) are inFieldCure.Ai.Providers. See Supported Providers.
dotnet add package FieldCure.AssistStudio.Core
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}");
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);
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}
""";
}
}
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.
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:
max_tokens budget and return status: "completed".max_tokens mid-synthesis, returning
status: "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.
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}");
}
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);
| 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 |
| 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) |
MIT — Copyright (c) 2026 FieldCure Co., Ltd.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
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. |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.20.0 | 106 | 5/25/2026 |
| 0.19.2 | 112 | 5/5/2026 |
| 0.19.1 | 111 | 5/4/2026 |
| 0.19.0 | 92 | 5/4/2026 |
| 0.18.0 | 108 | 4/27/2026 |
| 0.17.0 | 105 | 4/21/2026 |
| 0.16.0 | 103 | 4/14/2026 |
| 0.15.0 | 113 | 4/10/2026 |
| 0.14.0 | 105 | 4/7/2026 |
| 0.13.0 | 111 | 3/31/2026 |
| 0.12.0 | 114 | 3/30/2026 |
| 0.11.0 | 110 | 3/29/2026 |
| 0.10.0 | 105 | 3/24/2026 |
| 0.9.0 | 110 | 3/24/2026 |
| 0.8.0 | 99 | 3/22/2026 |
| 0.7.0 | 103 | 3/21/2026 |
| 0.6.0 | 113 | 3/17/2026 |
| 0.5.0 | 111 | 3/17/2026 |
| 0.4.0 | 109 | 3/17/2026 |
v0.20.0: New ToolCallExecutor.ToolContext optional property — when set, the executor forwards an IToolContext (defined in Ai.Providers 0.8.0) to the new context-aware IAssistTool.ExecuteAsync overload, so future host-side tools can request approval / elicitation through the same surface that ChatPanel exposes. Existing tools that override only the context-less ExecuteAsync keep working via the default forwarder. New OrphanToolCancelInjector (AssistStudio.Core.Helpers): synthesizes a "[Stopped by user]" tool result for any orphan tool call before send, reorders ChatRole.Tool followers to match assistant ToolCalls ordering (mandatory for Ollama native /api/chat and Gemini's index-suffix-stripping matchers). StreamToolCallAccumulator.Drain now drops entries with unparseable argument JSON to prevent send-build crashes after a mid-input_json_delta STOP. Synthesis is send-time only — never enters the persisted _messages array or .astx archive. Diagnostic log line "[Cancel] Synthesized N orphan tool_result(s)" surfaces activations. Rebuilt against FieldCure.Ai.Providers 0.8.0.