agent: move TokenUsage and SkillEvent to the leaf types package

main

Commit

Soph3mo ago

The checkpoint contract DTOs embed TokenUsage and SkillEvent, but both lived in the heavy agent package — so any package referencing the checkpoint metadata types transitively pulled in agent (and its TUI/launch/review dependencies). That blocks relocating the contract to a standalone api/checkpoint package.

Move the type definitions (and the SkillEvent string constants) into the existing leaf agent/types package (which has no imports) and leave transparent aliases in agent:

type TokenUsage = types.TokenUsage type SkillEvent = types.SkillEvent (+ the four Skill* sub-types) const SkillEventTypePromptInvocation = types.SkillEventTypePromptInvocation (+ the rest)

All ~34 existing agent.TokenUsage / agent.SkillEvent references keep compiling unchanged via the aliases. The SkillEventExtractor interface stays in agent (it's agent-implementation behavior, not contract data); the constants move alongside the structs so the leaf package is self-contained for constructing skill events. checkpoint.go now references types.* and no longer imports agent — the prerequisite for the api/checkpoint relocation (next in the stack).

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com Entire-Checkpoint: 44f690c46059

Checkpoints

can you look at this branch / pr also in the context of https://github.com/entireio/cli/issues/1433 and especially https://github.com/entireio/cli/issues/1433#issuecomment-4722283362

Claude CodeOpus 4.8[1m]
View session
Checkpoint 1