feat(models): add RFC-named model aliases
Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
parent
e18dc12e1e
commit
863f76fb71
5 changed files with 58 additions and 0 deletions
31
pkg/agentic/alias_test.go
Normal file
31
pkg/agentic/alias_test.go
Normal file
|
|
@ -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")
|
||||
}
|
||||
}
|
||||
|
|
@ -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"`
|
||||
|
|
|
|||
|
|
@ -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"`
|
||||
|
|
|
|||
18
pkg/brain/alias_test.go
Normal file
18
pkg/brain/alias_test.go
Normal file
|
|
@ -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")
|
||||
}
|
||||
}
|
||||
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue