Files
zip/go.mod
T
zeekayandHanzo Dev 88b93b8fae zipgen reads the schema it was refusing to project from
The registry a projection reduces over came from Go declarations, so zipgen —
which links no service — had an empty one, and every SDK, MCP server, CLI and
docs page it wrote was empty. It refused rather than write those, and named a
missing connection: a .zap schema, read into a registry.

zip.ReadZAP is that connection. It parses with github.com/zap-proto/go/idl,
which is the parser cmd/zapgen has always used and which is a package rather
than a command as of that repository's v1.8.3; there is one grammar, not a
second one written here to agree with the first until it did not. It answers
with one app per declared interface, each carrying one op per method, which is
the exact inverse of ZAPSchema taking any number of apps and writing them as one
interface each. A file read and projected back is the same text, and there is a
test that closes that loop over this package's own output.

Two things stood between a declaration and an op. Go makes no named types at run
time, so a struct built from a declaration carries the name it was declared under
in a decl tag on its fields, and typeName is now the one place any projection
asks a type for its name — without that, Ping and Pong of identical shape intern
to a single reflect type and a method declared to answer Pong answers Ping. And
a .zap field states an offset while LayoutOf derives one: every field is
compared and any disagreement is refused, naming all of them. That refusal earns
its place immediately, because the IDL assigns offsets by packing and this
layout aligns each slot to its own width, so a hand-written schema with an i32
before a wider field describes a wire this process does not speak.

An op read from a schema knows what it takes and what it answers and refuses to
run, because a schema states a contract and the implementation of it is
somewhere else.

Co-authored-by: Hanzo Dev <[email protected]>
2026-09-06 11:14:59 -07:00

70 lines
2.6 KiB
AMPL

module github.com/zap-proto/zip
go 1.26.5
// v1.36.21 does not compile: mcp.go calls networkOf, which was staged in a
// file the commit left behind. It built locally because the working tree held
// both halves, which is the whole lesson — verify the commit, not the
// directory it came from.
//
// The tag is not moved. A version is a permanent address, and a consumer that
// already resolved to it must keep getting the same bytes. Retract is how Go
// says "published in error" without rewriting history: the resolver stops
// choosing it, `go list -m -versions` stops offering it, and anyone pinned to
// it is told rather than silently moved. v1.36.22 is the re-cut.
retract v1.36.21
require (
github.com/dop251/goja v0.0.0-20260607120635-348e6bea910d
github.com/evanw/esbuild v0.28.1
github.com/fasthttp/websocket v1.5.12
github.com/luxfi/log v1.4.3
github.com/luxfi/metric v1.10.0
github.com/luxfi/zap v1.2.7
github.com/valyala/fasthttp v1.70.0
github.com/zap-proto/fiber/v3 v3.2.1
github.com/zap-proto/go v1.8.3
)
require (
github.com/cenkalti/backoff v2.2.1+incompatible // indirect
github.com/cloudflare/circl v1.6.3 // indirect
github.com/gorilla/rpc v1.2.1 // indirect
github.com/grandcat/zeroconf v1.0.0 // indirect
github.com/luxfi/accel v1.2.4 // indirect
github.com/luxfi/crypto v1.20.2 // indirect
github.com/luxfi/mdns v0.1.1 // indirect
github.com/miekg/dns v1.1.72 // indirect
google.golang.org/protobuf v1.36.11 // indirect
)
require (
golang.org/x/mod v0.36.0 // indirect
golang.org/x/sync v0.20.0 // indirect
golang.org/x/tools v0.45.0
)
require (
github.com/andybalholm/brotli v1.2.1 // indirect
github.com/dlclark/regexp2/v2 v2.2.1 // indirect
github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect
github.com/gofiber/schema v1.7.1 // indirect
github.com/gofiber/utils/v2 v2.0.4 // indirect
github.com/google/pprof v0.0.0-20230207041349-798e818bf904 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/klauspost/compress v1.18.6 // indirect
github.com/mattn/go-colorable v0.1.14 // indirect
github.com/mattn/go-isatty v0.0.21 // indirect
github.com/philhofer/fwd v1.2.0 // indirect
github.com/savsgio/gotils v0.0.0-20240704082632-aef3928b8a38 // indirect
github.com/tinylib/msgp v1.6.4 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/zap-proto/http v0.3.5
github.com/zap-proto/mcp v1.0.5
golang.org/x/crypto v0.52.0 // indirect
golang.org/x/net v0.55.0 // indirect
golang.org/x/sys v0.45.0
golang.org/x/text v0.37.0 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
)