From 9f1315d1a8b7806a6159410e7558afb2aeb8b8ec Mon Sep 17 00:00:00 2001 From: Virgil Date: Thu, 2 Apr 2026 06:47:34 +0000 Subject: [PATCH] refactor(agentic): add namespaced command aliases Co-Authored-By: Virgil --- pkg/agentic/commands.go | 5 +++++ pkg/agentic/commands_test.go | 7 +++++++ pkg/agentic/lang.go | 2 ++ 3 files changed, 14 insertions(+) diff --git a/pkg/agentic/commands.go b/pkg/agentic/commands.go index b566060..a905c74 100644 --- a/pkg/agentic/commands.go +++ b/pkg/agentic/commands.go @@ -19,11 +19,15 @@ func (s *PrepSubsystem) registerCommands(ctx context.Context) { s.startupContext = ctx c := s.Core() c.Command("run/task", core.Command{Description: "Run a single task end-to-end", Action: s.cmdRunTask}) + c.Command("agentic:run/task", core.Command{Description: "Run a single task end-to-end", Action: s.cmdRunTask}) c.Command("run/flow", core.Command{Description: "Show a flow definition from disk or the embedded library", Action: s.cmdRunFlow}) + c.Command("agentic:run/flow", core.Command{Description: "Show a flow definition from disk or the embedded library", Action: s.cmdRunFlow}) c.Command("flow/preview", core.Command{Description: "Preview a flow definition with optional variable substitution", Action: s.cmdFlowPreview}) c.Command("agentic:flow/preview", core.Command{Description: "Preview a flow definition with optional variable substitution", Action: s.cmdFlowPreview}) c.Command("dispatch/sync", core.Command{Description: "Dispatch a single task synchronously and block until it completes", Action: s.cmdDispatchSync}) + c.Command("agentic:dispatch/sync", core.Command{Description: "Dispatch a single task synchronously and block until it completes", Action: s.cmdDispatchSync}) c.Command("run/orchestrator", core.Command{Description: "Run the queue orchestrator (standalone, no MCP)", Action: s.cmdOrchestrator}) + c.Command("agentic:run/orchestrator", core.Command{Description: "Run the queue orchestrator (standalone, no MCP)", Action: s.cmdOrchestrator}) c.Command("dispatch", core.Command{Description: "Dispatch queued agents", Action: s.cmdDispatch}) c.Command("agentic:dispatch", core.Command{Description: "Dispatch queued agents", Action: s.cmdDispatch}) c.Command("dispatch/start", core.Command{Description: "Start the dispatch queue runner", Action: s.cmdDispatchStart}) @@ -82,6 +86,7 @@ func (s *PrepSubsystem) registerCommands(ctx context.Context) { c.Command("prompt/version", core.Command{Description: "Read the current prompt snapshot for a workspace", Action: s.cmdPromptVersion}) c.Command("agentic:prompt/version", core.Command{Description: "Read the current prompt snapshot for a workspace", Action: s.cmdPromptVersion}) c.Command("extract", core.Command{Description: "Extract data from agent output or scaffold a workspace template", Action: s.cmdExtract}) + c.Command("agentic:extract", core.Command{Description: "Extract data from agent output or scaffold a workspace template", Action: s.cmdExtract}) s.registerPlanCommands() s.registerCommitCommands() s.registerSessionCommands() diff --git a/pkg/agentic/commands_test.go b/pkg/agentic/commands_test.go index 07dae10..582c884 100644 --- a/pkg/agentic/commands_test.go +++ b/pkg/agentic/commands_test.go @@ -1528,11 +1528,15 @@ func TestCommands_RegisterCommands_Good_AllRegistered(t *testing.T) { cmds := c.Commands() assert.Contains(t, cmds, "run/task") + assert.Contains(t, cmds, "agentic:run/task") assert.Contains(t, cmds, "run/flow") + assert.Contains(t, cmds, "agentic:run/flow") assert.Contains(t, cmds, "flow/preview") assert.Contains(t, cmds, "agentic:flow/preview") assert.Contains(t, cmds, "dispatch/sync") + assert.Contains(t, cmds, "agentic:dispatch/sync") assert.Contains(t, cmds, "run/orchestrator") + assert.Contains(t, cmds, "agentic:run/orchestrator") assert.Contains(t, cmds, "dispatch") assert.Contains(t, cmds, "agentic:dispatch") assert.Contains(t, cmds, "dispatch/start") @@ -1573,8 +1577,11 @@ func TestCommands_RegisterCommands_Good_AllRegistered(t *testing.T) { assert.Contains(t, cmds, "agentic:prompt_version") assert.Contains(t, cmds, "prompt/version") assert.Contains(t, cmds, "extract") + assert.Contains(t, cmds, "agentic:extract") assert.Contains(t, cmds, "lang/detect") + assert.Contains(t, cmds, "agentic:lang/detect") assert.Contains(t, cmds, "lang/list") + assert.Contains(t, cmds, "agentic:lang/list") assert.Contains(t, cmds, "epic") assert.Contains(t, cmds, "agentic:epic") assert.Contains(t, cmds, "plan") diff --git a/pkg/agentic/lang.go b/pkg/agentic/lang.go index 7952153..2246975 100644 --- a/pkg/agentic/lang.go +++ b/pkg/agentic/lang.go @@ -35,7 +35,9 @@ type LanguageListInput struct{} func (s *PrepSubsystem) registerLanguageCommands() { c := s.Core() c.Command("lang/detect", core.Command{Description: "Detect the primary language for a workspace or repository", Action: s.cmdLangDetect}) + c.Command("agentic:lang/detect", core.Command{Description: "Detect the primary language for a workspace or repository", Action: s.cmdLangDetect}) c.Command("lang/list", core.Command{Description: "List supported language identifiers", Action: s.cmdLangList}) + c.Command("agentic:lang/list", core.Command{Description: "List supported language identifiers", Action: s.cmdLangList}) } // result := c.Command("lang/detect").Run(ctx, core.NewOptions(core.Option{Key: "path", Value: "."}))