An unofficial terminal client for Tangled, optimized for humans and agents. tgcli.wisp.place
tg internal tangledlex
2 folders · 29 files

cborgen
schemas
actordefs.go
cbor_gen.go
embedcommit.go
embedimage.go
embedvideo.go
feedcomment.go
generate-lexicons.sh
generate.go
gitoid.go
gitrefs.go
graphattestation.go
keysshKey.go
labeldefs.go
lexgen.json
lock.json
markupmarkdown.go
README.md
repodeclaration.go
repodefs.go
repomanifest.go
reviewpatch.go
schemas.txt
snippetstring.go
trackdefs.go
trackticket.go
update-schemas.sh
validate_fuzz_test.go
validate_test.go
validate.go
README.md

Tangled lexicons #

This package contains the generated Go representations of the Tangled record lexicons that tg consumes. It is deliberately internal: tangled/ remains the handwritten Bobbin client and turns these generated types into the CLI's stable application types.

lock.json pins the upstream Tangled Core commit used for the checked-in schemas. schemas.txt is the explicit allowlist of upstream lexicons that tg depends on. Keeping both means an upstream schema addition cannot silently become part of tg's wire contract.

Updating #

Choose a reviewed, full 40-character Tangled Core commit and run:

cd internal/tangledlex
./update-schemas.sh <tangled-core-commit>

The script fetches only that commit, replaces exactly the paths listed in schemas.txt, updates lock.json, and regenerates the Go and CBOR code. Review the resulting schema and generated-code diff, then run nix fmt and nix build path:.#tg from the repository root.

To add support for a new lexicon, add its path (relative to Tangled Core's lexicons/) to schemas.txt. Add any new map types used by generated unions to the CBOR generator's list in cborgen/main.go; then run the update script.