feat: sync wire types with the latest API (additive fields) - #25
Merged
Conversation
nsollazzo
marked this pull request as ready for review
July 8, 2026 13:39
internal/api/types.go documents itself as a field-for-field mirror of the product's src/lib/types.ts; it had drifted, so --json silently dropped fields the server now returns. Re-sync the additive ones: - SoulCard/Listing: chargeCount (the "energy boost" running count) - Listing: profileTier (author seal), hasAsset / assetVersion / assetContentHash (hosted SKILL.md asset metadata — lets clients skip an identical re-download) - LoopData + new SkillData: bundles (a meta-skill/loop's bundled listing slugs) Human detail views surface CHARGES, a skill's ASSET VERSION, and loop/skill BUNDLES; everything flows into --json automatically. Adds a SkillData() decoder mirroring LoopData(), round-trip tests pinning the new fields (incl. null for the nullable asset fields), and the mock fixtures + regenerated goldens — the golden churn is the contract change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
nsollazzo
force-pushed
the
feat/sync-api-type-drift
branch
from
July 8, 2026 13:40
a4e15fa to
82ce66b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
internal/api/types.gois the CLI's field-for-field mirror of the product'ssrc/lib/types.ts. It had drifted — so--jsonwas silently dropping fields the server now returns. This re-syncs the additive ones.SoulCard/ListingchargeCount— the "energy boost" running countListingprofileTier(author seal:official/verified/null),hasAsset,assetVersion,assetContentHash(hosted SKILL.md asset metadata)LoopData, newSkillDatabundles— a meta-skill/loop's bundled listing slugshasAsset/assetVersion/assetContentHashare functionally useful: a client can skip re-downloading an identical hosted skill asset.Behavior
--jsonautomatically (agents see everything the server sends).CHARGES(soul + listing), a skill'sASSET VERSION, and loop/skillBUNDLES.SkillData()decoder mirroringLoopData()(typed access to bundled slugs).Contract changes (golden diffs)
Every soul/listing
--jsongolden and the MCP tool-schema golden (mcp-tools-list.json) gained the new fields — that is the contract change, regenerated viago test ./internal/cli -update. Mock fixtures updated with representative values (incl. averified-tier meta-skill with a hosted asset + bundles, exercising the non-officialtier,hasAsset:true, andSkillData/LoopDatabundles).Tests
TestListingSkillData— the new decoder, incl. fail-loud on a wrong-typed field.TestNewWireFieldsRoundTrip— the new fields survive decode→encode (never dropped), nullable asset fields round-trip as JSONnull, andSoulCard.chargeCountdecodes.go test ./... -race,go vet,golangci-lint runall clean. No auth/admin surface touched; nothing sensitive; no internal ids in the diff.