{"modulePath":"github.com/memcode-ai/memcode","version":"v0.56.16","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package server\n\nPackage server is the memcode gateway runtime — the first external surface of memcode's event/agent spine. It starts each configured channel, DURABLY records every accepted inbound message before acknowledging the provider, then a worker drains that inbox: each message runs as a detached agent job (crash-isolated subprocess, reusing internal/jobs) and the result is posted back. Gateway activity is logged to the main event store, but an inbound chat message is never turned into a project objective. Coding is one use of this loop, not what it's built around: an inbound message is just a task.\n\n## Functions\n\n```go\nfunc Run(ctx context.Context, root string, mainStore store.Store, settings gwconfig.Settings, out io.Writer) error\n```\nRun starts every configured surface, then drains the durable inbox until ctx is cancelled. root is the default project the agent operates in; mainStore is the gateway's (global) event log; settings holds the non-secret gateway config. The gateway's OWN durable state — inbox and singleton lock — lives at the global config dir, NOT under root/.memcode: it is gateway-operational, and a global singleton is what lets one daemon own single-consumer bot tokens.\n\n","path":"github.com/memcode-ai/memcode/internal/gateway/server","name":"server","synopsis":"Package server is the memcode gateway runtime — the first external surface of memcode's event/agent spine.","isRedistributable":true}
