mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-15 13:04:36 +00:00
Improved the Web Based Harness
This commit is contained in:
parent
c3c57c058a
commit
ee6eb84bd8
19 changed files with 2799 additions and 2202 deletions
|
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Cryptography;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
|
|
@ -25,6 +26,8 @@ public sealed class MccMcpGuidanceProvider
|
|||
|
||||
public string PromptName => "mcc_operator_prompt";
|
||||
|
||||
public string SkillName => "mcc-mcp-operator";
|
||||
|
||||
public string GetSystemPrompt()
|
||||
{
|
||||
GuidanceDocument document = guidanceDocument.Value;
|
||||
|
|
@ -51,6 +54,9 @@ public sealed class MccMcpGuidanceProvider
|
|||
{
|
||||
PromptName = PromptName,
|
||||
PromptMarkdown = document.PromptMarkdown,
|
||||
SkillName = SkillName,
|
||||
GuidanceVersion = document.GuidanceVersion,
|
||||
SkillMarkdown = document.SkillMarkdown,
|
||||
SystemPrompt = GetSystemPrompt(),
|
||||
BestPractices = document.BestPractices,
|
||||
ExampleScenarios = document.ExampleScenarios,
|
||||
|
|
@ -76,6 +82,7 @@ public sealed class MccMcpGuidanceProvider
|
|||
string exampleScenariosSection = ExtractSection(bodyMarkdown, ExampleScenariosHeading);
|
||||
|
||||
return new GuidanceDocument(
|
||||
ComputeGuidanceVersion(promptMarkdown),
|
||||
promptMarkdown.Replace("\r\n", "\n").Trim(),
|
||||
bodyMarkdown,
|
||||
ExtractBulletList(bestPracticesSection),
|
||||
|
|
@ -180,11 +187,22 @@ public sealed class MccMcpGuidanceProvider
|
|||
return enabled ? "enabled" : "disabled";
|
||||
}
|
||||
|
||||
private static string ComputeGuidanceVersion(string markdown)
|
||||
{
|
||||
byte[] bytes = Encoding.UTF8.GetBytes(markdown.Replace("\r\n", "\n").Trim());
|
||||
byte[] hash = SHA256.HashData(bytes);
|
||||
return Convert.ToHexString(hash[..8]).ToLowerInvariant();
|
||||
}
|
||||
|
||||
private sealed record GuidanceDocument(
|
||||
string PromptMarkdown,
|
||||
string GuidanceVersion,
|
||||
string SkillMarkdown,
|
||||
string BodyMarkdown,
|
||||
string[] BestPractices,
|
||||
MccMcpAgentScenario[] ExampleScenarios);
|
||||
MccMcpAgentScenario[] ExampleScenarios)
|
||||
{
|
||||
public string PromptMarkdown => SkillMarkdown;
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class MccMcpAgentGuidancePayload
|
||||
|
|
@ -195,6 +213,15 @@ public sealed class MccMcpAgentGuidancePayload
|
|||
[JsonPropertyName("promptMarkdown")]
|
||||
public string PromptMarkdown { get; init; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("skillName")]
|
||||
public string SkillName { get; init; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("guidanceVersion")]
|
||||
public string GuidanceVersion { get; init; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("skillMarkdown")]
|
||||
public string SkillMarkdown { get; init; } = string.Empty;
|
||||
|
||||
[JsonPropertyName("systemPrompt")]
|
||||
public string SystemPrompt { get; init; } = string.Empty;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue