Forge
csharpdeeb25a2
1using CascadeIDE.Features.UiChrome;
2using CascadeIDE.Models;
3
4namespace CascadeIDE.Features.Workspace;
5
6/// <summary>
7/// Repository workspace overlay loaded from <c>.cascade/workspace.toml</c>.
8/// This file intentionally holds non-UI-mode configuration (docs correspondence, feature registry, etc).
9/// </summary>
10public sealed class RepositoryWorkspaceToml
11{
12 /// <summary>Non-UI overlays under <c>[workspace.*]</c> (ADR 0061 / 0155).</summary>
13 public RepositoryWorkspaceSectionToml? Workspace { get; set; }
14
15 /// <summary>UI chrome metrics and markdown preview placement.</summary>
16 public UiWorkspaceChromeToml? Chrome { get; set; }
17
18 /// <summary>LOC thresholds for UI badges.</summary>
19 public UiWorkspaceLocLimitsToml? LocLimits { get; set; }
20
21 public UiWorkspaceRoutingToml? Routing { get; set; }
22
23 /// <summary>Code navigation presets (ADR 0039, CNC).</summary>
24 public CodeNavigationSettings? CodeNavigation { get; set; }
25
26 /// <summary>Code navigation map settings (ADR 0053).</summary>
27 public CodeNavigationMapSettings? CodeNavigationMap { get; set; }
28}
29
30public sealed class RepositoryWorkspaceSectionToml
31{
32 public RepositoryAdrToml? Adr { get; set; }
33 public RepositoryFeaturesToml? Features { get; set; }
34 public RepositoryDocsTemplatesToml? DocsTemplates { get; set; }
35 public RepositoryCorrespondenceToml? Correspondence { get; set; }
36
37 public RepositoryForgeToml? Forge { get; set; }
38
39 public RepositoryCasaFieldToml? CasaField { get; set; }
40}
41
42/// <summary>Forge Lens overlay (<c>[workspace.forge]</c>, ADR 0158 / FORGE-ADR-0003).</summary>
43public sealed class RepositoryForgeToml
44{
45 public string? BaseUrl { get; set; }
46 public string? Repo { get; set; }
47
48 /// <summary>DEV override: env name для Bearer (<c>api_token_env</c>, ADR 0149). Канон — device login / secrets (ADR 0158).</summary>
49 public string? ApiTokenEnv { get; set; }
50}
51
52/// <summary>Explicit doc↔code anchors (<c>[[workspace.correspondence.code_anchors]]</c>, ADR 0156 §2.5).</summary>
53public sealed class RepositoryCorrespondenceToml
54{
55 public List<RepositoryCorrespondenceCodeAnchorToml> CodeAnchors { get; set; } = [];
56}
57
58public sealed class RepositoryCorrespondenceCodeAnchorToml
59{
60 public string? Doc { get; set; }
61 public string? File { get; set; }
62 public string? Bracket { get; set; }
63 public int? LineStart { get; set; }
64 public int? LineEnd { get; set; }
65 public string? Kind { get; set; }
66 public string? MemberKey { get; set; }
67}
68
69public sealed class RepositoryAdrToml
70{
71 public string? AutoInclude { get; set; }
72 public int? MaxRelated { get; set; }
73 public Dictionary<string, object>? Map { get; set; }
74
75 /// <summary>
76 /// Repo-relative ADR root directory for correspondence and auto-include. Default: <c>docs/adr/</c>.
77 /// TOML: <c>root_dir</c>.
78 /// </summary>
79 public string? RootDir { get; set; }
80
81 /// <summary>
82 /// Regex with named group <c>id</c> used to extract ADR id from a doc path.
83 /// Default matches <c>docs/adr/####-*.md</c>.
84 /// TOML: <c>id_regex</c>.
85 /// </summary>
86 public string? IdRegex { get; set; }
87}
88
89public sealed class RepositoryFeaturesToml
90{
91 public List<RepositoryFeatureToml> Feature { get; set; } = [];
92}
93
94public sealed class RepositoryFeatureToml
95{
96 public string? Id { get; set; }
97 public string? Title { get; set; }
98 public List<string> Paths { get; set; } = [];
99 public List<string> Docs { get; set; } = [];
100 public List<string> Tags { get; set; } = [];
101}
102
103public sealed class RepositoryDocsTemplatesToml
104{
105 public string? CatalogPath { get; set; }
106 public List<DocsTemplateToml> Template { get; set; } = [];
107}
108
109public sealed class DocsTemplateToml
110{
111 public string? Id { get; set; }
112 public string? Title { get; set; }
113 public string? Kind { get; set; }
114 public string? Source { get; set; }
115 public string? Path { get; set; }
116 public string? KnowledgeRootId { get; set; }
117 public string? FilePath { get; set; }
118}
119
120
View only · write via MCP/CIDE