Add reusable PromptKit request flags

This commit is contained in:
2026-11-07 04:16:09 +00:00
parent 6378ceb3c5
commit c3d5f551c3
17 changed files with 450 additions and 239 deletions

View File

@@ -108,17 +108,17 @@ func TestRequirementsCommandForwardsNativeRequestAndProjectsInspection(t *testin
{
name: "conditional discovery",
request: promptkit.RequirementInspectionRequest{PromptID: "briefing", ProfileID: "editorial"},
args: []string{"promptkit", "requirements", "show", "briefing", "--profile", "editorial"},
args: []string{"promptkit", "requirements", "show", "briefing", "--llm-profile", "editorial"},
},
{
name: "supplied branch variable",
request: promptkit.RequirementInspectionRequest{PromptID: "briefing", ProfileID: "editorial", Vars: map[string]string{"mode": "full"}},
args: []string{"promptkit", "requirements", "show", "briefing", "--profile", "editorial", "--var", "mode=full", "--format", "yaml"},
args: []string{"promptkit", "requirements", "show", "briefing", "--llm-profile", "editorial", "--llm-var", "mode=full", "--format", "yaml"},
},
{
name: "prompt with a required variable",
request: promptkit.RequirementInspectionRequest{PromptID: "required-variable", ProfileID: "editorial"},
args: []string{"promptkit", "requirements", "show", "required-variable", "--profile", "editorial"},
args: []string{"promptkit", "requirements", "show", "required-variable", "--llm-profile", "editorial"},
},
{
name: "default profile selection",
@@ -128,22 +128,22 @@ func TestRequirementsCommandForwardsNativeRequestAndProjectsInspection(t *testin
{
name: "first distinct prompt ID",
request: promptkit.RequirementInspectionRequest{PromptID: "ambiguous-first", ProfileID: "editorial"},
args: []string{"promptkit", "requirements", "show", "ambiguous-first", "--profile", "editorial"},
args: []string{"promptkit", "requirements", "show", "ambiguous-first", "--llm-profile", "editorial"},
},
{
name: "second distinct prompt ID",
request: promptkit.RequirementInspectionRequest{PromptID: "ambiguous-second", ProfileID: "editorial"},
args: []string{"promptkit", "requirements", "show", "ambiguous-second", "--profile", "editorial"},
args: []string{"promptkit", "requirements", "show", "ambiguous-second", "--llm-profile", "editorial"},
},
{
name: "session template context",
request: promptkit.RequirementInspectionRequest{PromptID: "briefing", ProfileID: "editorial"},
args: []string{"promptkit", "requirements", "show", "briefing", "--profile", "editorial"},
args: []string{"promptkit", "requirements", "show", "briefing", "--llm-profile", "editorial"},
},
{
name: "session ID context",
request: promptkit.RequirementInspectionRequest{PromptID: "briefing", ProfileID: "editorial", SessionID: "session-42"},
args: []string{"promptkit", "requirements", "show", "briefing", "--profile", "editorial", "--session-id", "session-42"},
args: []string{"promptkit", "requirements", "show", "briefing", "--llm-profile", "editorial", "--llm-session-id", "session-42"},
},
} {
t.Run(test.name, func(t *testing.T) {
@@ -164,17 +164,17 @@ func TestRequirementsCommandPreservesNativeSelectionErrors(t *testing.T) {
}{
{
name: "missing prompt",
args: []string{"promptkit", "requirements", "show", "missing", "--profile", "editorial"},
args: []string{"promptkit", "requirements", "show", "missing", "--llm-profile", "editorial"},
cause: promptkit.ErrPromptNotFound,
},
{
name: "missing profile",
args: []string{"promptkit", "requirements", "show", "briefing", "--profile", "missing"},
args: []string{"promptkit", "requirements", "show", "briefing", "--llm-profile", "missing"},
cause: promptkit.ErrProfileNotFound,
},
{
name: "removed prompt version flag",
args: []string{"promptkit", "requirements", "show", "briefing", "--version", "2", "--profile", "editorial"},
args: []string{"promptkit", "requirements", "show", "briefing", "--version", "2", "--llm-profile", "editorial"},
cause: nil,
},
} {