diff --git a/pkg/agentic/alias_test.go b/pkg/agentic/alias_test.go new file mode 100644 index 0000000..c094bad --- /dev/null +++ b/pkg/agentic/alias_test.go @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: EUPL-1.2 + +package agentic + +import "testing" + +func TestAlias_AgentPlan_Good(t *testing.T) { + var plan AgentPlan + plan.Title = "AX follow-up" + plan.Status = "draft" + + if plan.Title != "AX follow-up" { + t.Fatalf("expected AgentPlan alias to behave like Plan") + } + if plan.Status != "draft" { + t.Fatalf("expected AgentPlan alias to behave like Plan") + } +} + +func TestAlias_AgentSession_Good(t *testing.T) { + var session AgentSession + session.SessionID = "ses-123" + session.AgentType = "codex" + + if session.SessionID != "ses-123" { + t.Fatalf("expected AgentSession alias to behave like Session") + } + if session.AgentType != "codex" { + t.Fatalf("expected AgentSession alias to behave like Session") + } +} diff --git a/pkg/agentic/plan.go b/pkg/agentic/plan.go index 6cea91b..78812ea 100644 --- a/pkg/agentic/plan.go +++ b/pkg/agentic/plan.go @@ -31,6 +31,9 @@ type Plan struct { ArchivedAt time.Time `json:"archived_at,omitempty"` } +// AgentPlan is the RFC-named alias for Plan. +type AgentPlan = Plan + // phase := agentic.Phase{Number: 1, Name: "Migrate strings", Status: "in_progress"} type Phase struct { Number int `json:"number"` diff --git a/pkg/agentic/session.go b/pkg/agentic/session.go index 55d9f1e..daa3774 100644 --- a/pkg/agentic/session.go +++ b/pkg/agentic/session.go @@ -28,6 +28,9 @@ type Session struct { EndedAt string `json:"ended_at,omitempty"` } +// AgentSession is the RFC-named alias for Session. +type AgentSession = Session + // input := agentic.SessionStartInput{AgentType: "codex", PlanSlug: "ax-follow-up"} type SessionStartInput struct { PlanSlug string `json:"plan_slug,omitempty"` diff --git a/pkg/brain/alias_test.go b/pkg/brain/alias_test.go new file mode 100644 index 0000000..7112961 --- /dev/null +++ b/pkg/brain/alias_test.go @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: EUPL-1.2 + +package brain + +import "testing" + +func TestAlias_BrainMemory_Good(t *testing.T) { + var memory BrainMemory + memory.ID = "mem-123" + memory.Type = "convention" + + if memory.ID != "mem-123" { + t.Fatalf("expected BrainMemory alias to behave like Memory") + } + if memory.Type != "convention" { + t.Fatalf("expected BrainMemory alias to behave like Memory") + } +} diff --git a/pkg/brain/tools.go b/pkg/brain/tools.go index 3393ec3..9735d5a 100644 --- a/pkg/brain/tools.go +++ b/pkg/brain/tools.go @@ -86,6 +86,9 @@ type Memory struct { UpdatedAt string `json:"updated_at"` } +// BrainMemory is the RFC-named alias for Memory. +type BrainMemory = Memory + // input := brain.ForgetInput{ // ID: "mem_123", // Reason: "superseded",