Forge
csharpdeeb25a2
1#nullable enable
2
3using CascadeIDE.Services;
4
5namespace CascadeIDE.Features.Chat;
6
7/// <summary>
8/// Справка Intercom для <c>/help</c>. Текст — <see cref="BundledRelativePath"/> (диск под exe, затем EmbeddedResource).
9/// </summary>
10public static class IntercomHelpGuide
11{
12 /// <summary>Относительно <see cref="AppContext.BaseDirectory"/>; override без пересборки.</summary>
13 public const string BundledRelativePath = "Intercom/intercom-help.ru.md";
14
15 private static readonly Lazy<string> Cached = new(Load, LazyThreadSafetyMode.ExecutionAndPublication);
16
17 public static string FormatFull() => Cached.Value;
18
19 private static string Load()
20 {
21 if (BundledAppContent.TryReadDiskThenEmbedded(BundledRelativePath, out var raw)
22 && !string.IsNullOrWhiteSpace(raw))
23 {
24 return raw.TrimEnd();
25 }
26
27 throw new InvalidOperationException(
28 $"Отсутствует или пустой {BundledRelativePath} (рядом с exe или EmbeddedResource сборки CascadeIDE).");
29 }
30}
31
View only · write via MCP/CIDE