diff --git a/pkg/agentic/prep.go b/pkg/agentic/prep.go index d1fb849..959e29d 100644 --- a/pkg/agentic/prep.go +++ b/pkg/agentic/prep.go @@ -209,12 +209,28 @@ func (s *PrepSubsystem) OnStartup(ctx context.Context) core.Result { c.Action("plan.archive", s.handlePlanArchive).Description = "Archive an implementation plan by slug" c.Action("plan.delete", s.handlePlanDelete).Description = "Delete an implementation plan by ID" c.Action("plan.list", s.handlePlanList).Description = "List implementation plans with optional filters" + c.Action("agentic.plan.create", s.handlePlanCreate).Description = "Create a structured implementation plan" + c.Action("agentic.plan.get", s.handlePlanGet).Description = "Read an implementation plan by ID or slug" + c.Action("agentic.plan.read", s.handlePlanRead).Description = "Read an implementation plan by ID" + c.Action("agentic.plan.update", s.handlePlanUpdate).Description = "Update plan status, phases, notes, or agent assignment" + c.Action("agentic.plan.update_status", s.handlePlanUpdateStatus).Description = "Update an implementation plan lifecycle status by slug" + c.Action("agentic.plan.from.issue", s.handlePlanFromIssue).Description = "Create a plan from a tracked issue" + c.Action("agentic.plan.check", s.handlePlanCheck).Description = "Check whether a plan or phase is complete" + c.Action("agentic.plan.archive", s.handlePlanArchive).Description = "Archive an implementation plan by slug" + c.Action("agentic.plan.delete", s.handlePlanDelete).Description = "Delete an implementation plan by ID" + c.Action("agentic.plan.list", s.handlePlanList).Description = "List implementation plans with optional filters" c.Action("phase.get", s.handlePhaseGet).Description = "Read a plan phase by slug and order" c.Action("phase.update_status", s.handlePhaseUpdateStatus).Description = "Update plan phase status by slug and order" c.Action("phase.add_checkpoint", s.handlePhaseAddCheckpoint).Description = "Append a checkpoint note to a plan phase" + c.Action("agentic.phase.get", s.handlePhaseGet).Description = "Read a plan phase by slug and order" + c.Action("agentic.phase.update_status", s.handlePhaseUpdateStatus).Description = "Update plan phase status by slug and order" + c.Action("agentic.phase.add_checkpoint", s.handlePhaseAddCheckpoint).Description = "Append a checkpoint note to a plan phase" c.Action("task.create", s.handleTaskCreate).Description = "Create a plan task in a phase" c.Action("task.update", s.handleTaskUpdate).Description = "Update a plan task by slug, phase, and identifier" c.Action("task.toggle", s.handleTaskToggle).Description = "Toggle a plan task between pending and completed" + c.Action("agentic.task.create", s.handleTaskCreate).Description = "Create a plan task in a phase" + c.Action("agentic.task.update", s.handleTaskUpdate).Description = "Update a plan task by slug, phase, and identifier" + c.Action("agentic.task.toggle", s.handleTaskToggle).Description = "Toggle a plan task between pending and completed" c.Action("session.start", s.handleSessionStart).Description = "Start an agent session for a plan" c.Action("session.get", s.handleSessionGet).Description = "Read a session by session ID" c.Action("session.list", s.handleSessionList).Description = "List sessions with optional plan or status filters" @@ -226,10 +242,25 @@ func (s *PrepSubsystem) OnStartup(ctx context.Context) core.Result { c.Action("session.handoff", s.handleSessionHandoff).Description = "Hand off a session with notes for the next agent" c.Action("session.resume", s.handleSessionResume).Description = "Resume a paused or handed-off session from local cache" c.Action("session.replay", s.handleSessionReplay).Description = "Build replay context for a session from work logs and artifacts" + c.Action("agentic.session.start", s.handleSessionStart).Description = "Start an agent session for a plan" + c.Action("agentic.session.get", s.handleSessionGet).Description = "Read a session by session ID" + c.Action("agentic.session.list", s.handleSessionList).Description = "List sessions with optional plan or status filters" + c.Action("agentic.session.continue", s.handleSessionContinue).Description = "Continue a session from its latest saved context" + c.Action("agentic.session.end", s.handleSessionEnd).Description = "End a session with status and summary" + c.Action("agentic.session.complete", s.handleSessionEnd).Description = "Mark a session completed with status, summary, and handoff notes" + c.Action("agentic.session.log", s.handleSessionLog).Description = "Append a typed work-log entry to a stored session" + c.Action("agentic.session.artifact", s.handleSessionArtifact).Description = "Record a created, modified, deleted, or reviewed artifact for a session" + c.Action("agentic.session.handoff", s.handleSessionHandoff).Description = "Hand off a session with notes for the next agent" + c.Action("agentic.session.resume", s.handleSessionResume).Description = "Resume a paused or handed-off session from local cache" + c.Action("agentic.session.replay", s.handleSessionReplay).Description = "Build replay context for a session from work logs and artifacts" c.Action("state.set", s.handleStateSet).Description = "Store shared plan state for later sessions" c.Action("state.get", s.handleStateGet).Description = "Read shared plan state by key" c.Action("state.list", s.handleStateList).Description = "List shared plan state for a plan" c.Action("state.delete", s.handleStateDelete).Description = "Delete shared plan state by key" + c.Action("agentic.state.set", s.handleStateSet).Description = "Store shared plan state for later sessions" + c.Action("agentic.state.get", s.handleStateGet).Description = "Read shared plan state by key" + c.Action("agentic.state.list", s.handleStateList).Description = "List shared plan state for a plan" + c.Action("agentic.state.delete", s.handleStateDelete).Description = "Delete shared plan state by key" c.Action("template.list", s.handleTemplateList).Description = "List available YAML plan templates" c.Action("agentic.template.list", s.handleTemplateList).Description = "List available YAML plan templates" c.Action("template.preview", s.handleTemplatePreview).Description = "Preview a YAML plan template with variable substitution" @@ -255,10 +286,15 @@ func (s *PrepSubsystem) OnStartup(ctx context.Context) core.Result { c.Action("sprint.archive", s.handleSprintArchive).Description = "Archive a tracked platform sprint by slug" c.Action("content.generate", s.handleContentGenerate).Description = "Generate content using the platform content pipeline" c.Action("agentic.generate", s.handleContentGenerate).Description = "Generate content using the platform content pipeline" + c.Action("agentic.content.generate", s.handleContentGenerate).Description = "Generate content using the platform content pipeline" c.Action("content.batch", s.handleContentBatchGenerate).Description = "Start or continue batch content generation" c.Action("content.batch.generate", s.handleContentBatchGenerate).Description = "Start or continue batch content generation" c.Action("content.batch_generate", s.handleContentBatchGenerate).Description = "Start or continue batch content generation" c.Action("content_batch", s.handleContentBatchGenerate).Description = "Start or continue batch content generation" + c.Action("agentic.content.batch", s.handleContentBatchGenerate).Description = "Start or continue batch content generation" + c.Action("agentic.content.batch.generate", s.handleContentBatchGenerate).Description = "Start or continue batch content generation" + c.Action("agentic.content.batch_generate", s.handleContentBatchGenerate).Description = "Start or continue batch content generation" + c.Action("agentic.content_batch", s.handleContentBatchGenerate).Description = "Start or continue batch content generation" c.Action("content.brief.create", s.handleContentBriefCreate).Description = "Create a reusable content brief" c.Action("content.brief_create", s.handleContentBriefCreate).Description = "Create a reusable content brief" c.Action("content.brief.get", s.handleContentBriefGet).Description = "Read a content brief by ID or slug" @@ -271,6 +307,15 @@ func (s *PrepSubsystem) OnStartup(ctx context.Context) core.Result { c.Action("content.from.plan", s.handleContentFromPlan).Description = "Generate content from plan context" c.Action("content.from_plan", s.handleContentFromPlan).Description = "Generate content from plan context" c.Action("content.schema.generate", s.handleContentSchemaGenerate).Description = "Generate SEO schema JSON-LD for article, FAQ, or how-to content" + c.Action("agentic.content.brief.create", s.handleContentBriefCreate).Description = "Create a reusable content brief" + c.Action("agentic.content.brief.get", s.handleContentBriefGet).Description = "Read a content brief by ID or slug" + c.Action("agentic.content.brief.list", s.handleContentBriefList).Description = "List content briefs with optional filters" + c.Action("agentic.content.status", s.handleContentStatus).Description = "Read batch content generation status" + c.Action("agentic.content.usage.stats", s.handleContentUsageStats).Description = "Read content provider usage statistics" + c.Action("agentic.content.usage_stats", s.handleContentUsageStats).Description = "Read content provider usage statistics" + c.Action("agentic.content.from.plan", s.handleContentFromPlan).Description = "Generate content from plan context" + c.Action("agentic.content.from_plan", s.handleContentFromPlan).Description = "Generate content from plan context" + c.Action("agentic.content.schema.generate", s.handleContentSchemaGenerate).Description = "Generate SEO schema JSON-LD for article, FAQ, or how-to content" c.Action("agentic.prompt", s.handlePrompt).Description = "Read a system prompt by slug" c.Action("agentic.prompt.version", s.handlePromptVersion).Description = "Read the current prompt snapshot for a workspace" diff --git a/pkg/agentic/prep_test.go b/pkg/agentic/prep_test.go index 68437a0..cbd130d 100644 --- a/pkg/agentic/prep_test.go +++ b/pkg/agentic/prep_test.go @@ -552,6 +552,25 @@ func TestPrep_OnStartup_Good_RegistersSessionActions(t *testing.T) { assert.True(t, c.Action("sprint.archive").Exists()) } +func TestPrep_OnStartup_Good_RegistersNamespacedActionAliases(t *testing.T) { + t.Setenv("CORE_WORKSPACE", t.TempDir()) + t.Setenv("CORE_AGENT_DISPATCH", "") + + c := core.New(core.WithOption("name", "test")) + s := NewPrep() + s.ServiceRuntime = core.NewServiceRuntime(c, AgentOptions{}) + + require.True(t, s.OnStartup(context.Background()).OK) + assert.True(t, c.Action("agentic.plan.create").Exists()) + assert.True(t, c.Action("agentic.plan.read").Exists()) + assert.True(t, c.Action("agentic.phase.get").Exists()) + assert.True(t, c.Action("agentic.task.create").Exists()) + assert.True(t, c.Action("agentic.session.start").Exists()) + assert.True(t, c.Action("agentic.state.set").Exists()) + assert.True(t, c.Action("agentic.content.generate").Exists()) + assert.True(t, c.Action("agentic.content.schema.generate").Exists()) +} + func TestPrep_OnStartup_Good_RegistersForgeActions(t *testing.T) { t.Setenv("CORE_WORKSPACE", t.TempDir()) t.Setenv("CORE_AGENT_DISPATCH", "") @@ -592,6 +611,9 @@ func TestPrep_OnStartup_Good_RegistersContentActions(t *testing.T) { assert.True(t, c.Action("content.from.plan").Exists()) assert.True(t, c.Action("content.from_plan").Exists()) assert.True(t, c.Action("content.schema.generate").Exists()) + assert.True(t, c.Action("agentic.content.generate").Exists()) + assert.True(t, c.Action("agentic.content.batch").Exists()) + assert.True(t, c.Action("agentic.content.schema.generate").Exists()) } func TestPrep_OnStartup_Good_RegistersTemplateActions(t *testing.T) {