Write Terminal.Gui.Cli v2 library spec#179
Conversation
Agent-Logs-Url: https://github.com/gui-cs/clet/sessions/d7fbe680-6d0b-4042-9f9c-181916db6a3a Co-authored-by: tig <585482+tig@users.noreply.github.com>
Agent-Logs-Url: https://github.com/gui-cs/clet/sessions/d7fbe680-6d0b-4042-9f9c-181916db6a3a Co-authored-by: tig <585482+tig@users.noreply.github.com>
Agent-Logs-Url: https://github.com/gui-cs/clet/sessions/d7fbe680-6d0b-4042-9f9c-181916db6a3a Co-authored-by: tig <585482+tig@users.noreply.github.com>
Agent-Logs-Url: https://github.com/gui-cs/clet/sessions/d7fbe680-6d0b-4042-9f9c-181916db6a3a Co-authored-by: tig <585482+tig@users.noreply.github.com>
Agent-Logs-Url: https://github.com/gui-cs/clet/sessions/d7fbe680-6d0b-4042-9f9c-181916db6a3a Co-authored-by: tig <585482+tig@users.noreply.github.com>
tig
left a comment
There was a problem hiding this comment.
Review: Terminal.Gui.Cli v2 Spec (PR #179)
Overall: Strong spec. Ready to implement from with a few clarifications.
The spec accurately captures the Stage A learnings, maintains fidelity to the proven implementation, and adds the deferred pieces (HelpCommand, AgentGuideCommand, ReplaceBuiltInCommand, EmbeddedMarkdownHelpProvider, MarkdownRenderer) cleanly. Structure is good - an implementing agent can work section-by-section.
Issues to address:
1. MarkdownRenderer - TG API is already merged (not pending)
Stage A final commit (f783d61) bumped TG to 2.4.1-develop.11 and uses Markdown.RenderToAnsi() directly. The TG-PENDING markers in S4.9, S4.7, and S13 should be removed or softened to say pin TerminalGuiVersion >= 2.4.1-develop.11 - the API exists now.
2. InputCommandRunner - missing second overload context
S4.10 shows two overloads but does not explain when to use which. The 3-type-param version (TControl, TRawResult, TValue) is for when the raw result needs mapping. The 2-type-param version (TControl, TValue) is a convenience when TRawResult == TValue. A one-line note per overload would help implementers.
3. AgentGuideCommand constructor takes string markdown - who resolves the resource?
S4.7 shows AgentGuideCommand(string markdown) taking resolved content. But S4.5 says CliHost registers it when AgentGuide is non-null. The spec should clarify: CliHost resolves the embedded resource (if AgentGuideIsResource=true) during construction and passes the resolved string to AgentGuideCommand. This means the consumer assembly must be discoverable by the host - how? Via a new CliHostOptions.ResourceAssembly property? Or the calling assembly? Stage A punted this. Needs a decision.
4. HelpCommand TUI mode - what View does it use?
S4.7 says uses a Terminal.Gui markdown viewer for TUI mode but does not specify which TG View. Is it MarkdownView? A plain TextView with pre-rendered ANSI? The spec should name the concrete View type or say implementation chooses based on available TG APIs.
5. Missing: CliJsonContext source-generated context
S4.8 shows JsonEnvelope.ToJson() uses the source-generated JSON context but the CliJsonContext type is not defined in S4. Add a brief note that it is internal partial class CliJsonContext : JsonSerializerContext, internal, not public, AOT-safe.
6. Missing: --help / -h in framework flags table
S5.1 lists framework flags but --help/-h and --version are not in the table (they are root flags handled differently). This is technically correct since they are intercepted before dispatch, but the table should have a footnote or separate root-only flags row to avoid confusion.
Verdict: Approve with comments above addressed.
Follow-up on review items 3 and 4:#3 Decision: Add The consumer explicitly passes Example: CliHost host = new (o =>
{
o.ResourceAssembly = typeof (Program).Assembly;
o.AgentGuide = "AgentGuide.md";
});#4 Decision: HelpCommand uses TG 2.4.1-develop.11 ships both |
Agent-Logs-Url: https://github.com/gui-cs/clet/sessions/cd835337-755f-468a-8542-dc123ba0da47 Co-authored-by: tig <585482+tig@users.noreply.github.com>
CliHostOptions.ResourceAssemblyand clarify AgentGuide resource resolutionInputCommandRunneroverload usageCliJsonContext--help,--version, and--opencli