{"modulePath":"github.com/memcode-ai/memcode","version":"v0.56.16","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package websites\n\ncheck.go — will this site build on memcode.ai? Answered here, before a push.\n\nThe local dev server renders in the browser; the hosted build pre-renders every route in Node (vite-react-ssg). Code that touches window at import time, a missing package, or a broken route works in the preview and fails the build. BuildCheck runs the same \\`npm run build\\` the builder runs and applies the same output rules, so the user finds out now, not after a push.\n\nPackage websites is the CLI's client for memcode.ai's Websites feature — AI-built static sites. list/pull/push/publish map onto the www /api/website endpoints, authenticated with the same bearer token the login flow mints (MEMCODE\\_API\\_TOKEN). Like the artifacts client, this talks to the WEB APP, not the inference gateway.\n\nThe local workflow is deliberately git-native: \\`pull\\` clones the site's repo bundle into ./\\\u003cslug\u003e (which carries MEMCODE.md + .memcode/, so plain \\`memcode\\` in that directory IS website mode), \\`push\\` bundles the repo back up and queues a server-side rebuild of the draft preview.\n\ndeps.go — what a site may depend on, decided the same way everywhere.\n\nA site's packages come from two places:\n\n  - The kit: the template's own dependency set (React, Tailwind, motion, GSAP, fonts, 3D…). The hosted builder has it preinstalled, so a site that uses only the kit builds offline in seconds.\n  - Vetted additions: any other npm package that passes Vet — old enough to have survived a compromised release being noticed, widely used, a permissive license, no install scripts, not deprecated, a sane size. Additions install with --ignore-scripts here and on memcode.ai.\n\nThe local site worker adds packages through Add, a push runs Check before uploading, and the hosted builder runs the same Check (\\`memcode websites deps check\\`) before it installs anything. One policy, one implementation: a site that works locally builds when pushed, and nothing reaches the builder that this machine would have refused.\n\nkitsync.go — sites follow the kit.\n\nA site starts with the kit's exact versions pinned in its package.json. When memcode moves the kit (a security fix, a patch release), a site that still has the versions the kit gave it moves with the kit; a version the site's owner chose (\\`deps add pkg@x\\` for a kit package, an edit) stays where it is. The kit's history tells the two apart: every version the kit has ever pinned, with the epoch it shipped in.\n\nEpochs are the compatibility gate. A kit change that can break a site's code (a major release with API changes) starts a new epoch, and a site whose kit packages are from an older epoch is not moved automatically: it needs a migration. Within an epoch, following the kit is safe by construction.\n\nThe local dev server syncs before it installs, and the hosted builder syncs before every build (\\`memcode websites deps sync\\`), so both land on the same versions.\n\nlocal.go — local-first sites, the way git works: create a site on this machine, work on it with a local dev server, and decide later whether to push it to memcode.ai. A site made here does not exist on memcode.ai (no address, no slot) until its first push creates it there.\n\nLocal sites live in managed workspaces (~/.memcode/websites/\\\u003cname\u003e/source). The folder keeps its name after the first push, so a dev server running from it is never moved out from under; a site is found by scanning the workspaces' .memcode/website.json markers (remote sites pulled before this existed sit under their site id, and are found the same way).\n\nworkspace.go — the on-disk layout \\`memcode websites dev\\` works from.\n\nTwo modes, mirroring the revised architecture's LOCAL layer:\n\n\tmanaged:  ~/.memcode/websites/\u003csite_id\u003e/{source,assets,runtime}/ — used\n\t          when `dev` is given a slug with no local checkout. Mirrors\n\t          internal/plans's ~/.memcode/plans convention (user-level, not\n\t          per-repo, so it survives outside any git working tree).\n\texplicit: \u003cdir\u003e/.memcode/{assets,runtime}/ — used when `dev` is pointed\n\t          at an existing pulled checkout. The caller MUST run\n\t          config.EnsureGitignore(dir) before writing here (that's what\n\t          keeps .memcode/assets and .memcode/runtime untracked and out of\n\t          `git bundle create --all`) — this package deliberately does not\n\t          import internal/config to avoid widening its dependency surface.\n\nNeither mode ever touches draft/ or repo.bundle — those stay exactly as the Pull/Push flow already manages them.\n\n## Constants\n\n```go\nconst (\n\t// MinPackageAge: a version must have been public this long. Compromised\n\t// releases are typically caught and pulled within days.\n\tMinPackageAge = 14 * 24 * time.Hour\n\t// MinWeeklyDownloads keeps additions to packages many people already run.\n\tMinWeeklyDownloads = 10000\n\t// MaxUnpackedBytes bounds one package's published size.\n\tMaxUnpackedBytes = 30 \u003c\u003c 20\n)\n```\nPolicy limits for a package outside the kit.\n\n```go\nconst KitHistoryFile = \"memcode-kit.json\"\n```\nKitHistoryFile sits next to the kit's package.json in the template. It is the template's, not the site's: scaffolding removes it from a new site.\n\n```go\nconst MaxSiteBytes int64 = 50 \u003c\u003c 20\n```\nMaxSiteBytes is the hosted builder's cap on a site's built output.\n\n## Variables\n\n```go\nvar ErrBehind = errors.New(\"memcode.ai has changes this copy doesn't have yet\")\n```\nErrBehind means memcode.ai has changes this working copy doesn't (made by a build on memcode.ai, or pushed from another copy). A push replaces the hosted repo wholesale, so pushing now would throw those changes away.\n\n```go\nvar ErrBuildsGated = errors.New(\"website building is in limited internal preview — this account can't build or push sites yet\")\n```\nErrBuildsGated is returned by Build/Edit/Push when the server's internal- preview gate (canSeeTestPlans) rejects the request: hosted building — an agent build, an inline edit, or a pushed-repo rebuild — is limited to internal accounts. There is no local fallback for these accounts (a site that was never built has no repo to pull), so callers report it plainly rather than retrying or suggesting a workaround.\n\n```go\nvar WorkerGuide string\n```\nWorkerGuide is what the local site worker is told about the project, how to work (see, plan, build, look again, check) and how to avoid a generic site. The hosted builder's doctrine and the dependency policy enforce the same stack rules, so local work stays publishable.\n\n## Functions\n\n```go\nfunc ChangedFiles(dir, since string) []string\n```\nChangedFiles lists the files that differ between commit since and HEAD.\n\n```go\nfunc DesignPlan(dir string) string\n```\nDesignPlan is the worker's saved design plan for the site (\"\" if none).\n\n```go\nfunc Head(dir string) string\n```\nHead is the working copy's current commit (\"\" when it has none).\n\n```go\nfunc ManagedDir(siteID string) (string, error)\n```\nManagedDir returns ~/.memcode/websites/\\\u003csite\\_id\u003e, creating no directories.\n\n```go\nfunc RenderList(sites []Site) string\n```\nRenderList formats sites as an aligned table — shared by the cobra command and the TUI /websites slash handler.\n\n```go\nfunc SaveDesignPlan(dir, plan string) error\n```\nSaveDesignPlan records the worker's design plan for the site, replacing the previous one. It lives with memcode's state for the site, not in the site.\n\n```go\nfunc ShareCode(s string) string\n```\nShareCode extracts the code from a share link or returns a bare code.\n\n```go\nfunc Zip(dir, out string) (int, error)\n```\nZip writes a shareable copy of the site at dir to out: the project's own files, with everything that is generated or machine-specific left out (node\\_modules, the build output, git internals, memcode's .memcode folder). In a git repo the file list is git's: tracked files plus new ones that aren't ignored, so the site's .gitignore decides. Returns the number of files written.\n\n## Types\n\n```go\ntype APIError struct {\n\tStatus  int\n\tMessage string\n}\n```\nAPIError is a non-2xx response from memcode.ai: the HTTP status plus the server's {error} message. Kept typed so callers branch on the status, never on the wording of a message someone may later rephrase.\n\n```go\nfunc (e *APIError) Error() string\n```\n\n```go\ntype Asset struct {\n\tName string `json:\"name\"`\n\tSize int64  `json:\"size\"`\n\tURL  string `json:\"url,omitempty\"`\n}\n```\nAsset is one uploaded file in the site's durable assets/ prefix — a sibling of the build output, never touched by a rebuild.\n\n```go\ntype Brief struct {\n\tReferences []string  `json:\"references,omitempty\"`\n\tRequests   []Request `json:\"requests,omitempty\"`\n}\n```\nBrief is what a site has been asked to be: the references it should look like and the requests made of it, kept with the site (in its gitignored .memcode/) so a later session that says \"pick up where we left off\" or \"make sure it's like the reference\" still knows what that was. The worker's design plan sits beside it (site plan saves it).\n\n```go\nfunc ReadBrief(dir string) Brief\n```\nReadBrief loads a site's brief (empty when it has none).\n\n```go\nfunc Remember(dir, request string, refs []string) (Brief, error)\n```\nRemember adds a request and any new references to the site's brief and returns the updated brief. References accumulate: one named once still applies to every later change.\n\n```go\ntype Build struct {\n\tID            string `json:\"id\"`\n\tStatus        string `json:\"status\"` // pending|running|completed|failed\n\tMode          string `json:\"mode\"`   // build|rebuild|edit\n\tPrompt        string `json:\"prompt,omitempty\"`\n\tSummary       string `json:\"summary,omitempty\"`\n\tError         string `json:\"error,omitempty\"`\n\tDateStarted   string `json:\"date_started,omitempty\"`\n\tDateCompleted string `json:\"date_completed,omitempty\"`\n}\n```\nBuild is one website\\_build row — a queued or finished build/edit run.\n\n```go\ntype BuildReport struct {\n\tOK       bool\n\tPages    int\n\tBytes    int64\n\tProblems []string // what must be fixed before the site will build/serve\n\tOutput   string   // the build's output tail, when it failed\n}\n```\nBuildReport is the outcome of a local production build.\n\n```go\nfunc BuildCheck(ctx context.Context, dir string) BuildReport\n```\nBuildCheck runs the site's production build into dist/ (gitignored) and checks what it produced.\n\n```go\nfunc (r BuildReport) Summary() string\n```\nSummary describes the report in a few lines.\n\n```go\ntype Client struct {\n\t// contains filtered or unexported fields\n}\n```\nClient is an authenticated memcode.ai websites client.\n\n```go\nfunc New() (*Client, error)\n```\nNew builds a client from the environment. Errors when the user has no token — the caller surfaces \"run \\`memcode login\\`\".\n\n```go\nfunc (c *Client) Build(ctx context.Context, siteID, prompt, model string) (Build, error)\n```\nBuild queues a build for the site: a fresh build from a prompt (prompt non-empty) or a no-prompt rebuild of the current state. model may be empty to use the site's own pinned model. Returns ErrBuildsGated when the server's canSeeTestPlans gate rejects the request.\n\n```go\nfunc (c *Client) CatchUp(ctx context.Context, l LocalSite) (bool, error)\n```\nCatchUp brings a working copy up to date with memcode.ai when it has no changes of its own (a fast-forward). It reports whether anything changed; a copy with its own unpushed work is left alone.\n\n```go\nfunc (c *Client) Checkpoint(dir, since, message string) (string, error)\n```\nCheckpoint records a round of changes in a managed working copy as one commit, so each change has a diff the user can see and undo, and returns what changed since the commit \\`since\\` (\"3 files changed, 120 insertions(+), 8 deletions(-)\"), \"\" when nothing did. A checkout the user pulled themselves is left to their own git; its uncommitted changes are reported.\n\n```go\nfunc (c *Client) Create(ctx context.Context, name, prompt, model string) (Site, error)\n```\nCreate makes a new site. At least one of name/prompt should be given — the server distills a short name from the prompt when name is empty. This does NOT queue a build; call Build afterward to produce content (internal accounts only — others get ErrBuildsGated).\n\n```go\nfunc (c *Client) Delete(ctx context.Context, siteID string) error\n```\nDelete soft-deletes the site: it stops serving and disappears from the org.\n\n```go\nfunc (c *Client) DeleteAsset(ctx context.Context, siteID, name string) error\n```\nDeleteAsset removes one uploaded asset by name.\n\n```go\nfunc (c *Client) Edit(ctx context.Context, siteID string, edits []Edit, model string) (Build, error)\n```\nEdit queues an inline-edit build: verbatim find/replace edits applied by the builder without the agent, then a fast vite rebuild. Returns ErrBuildsGated when the server's canSeeTestPlans gate rejects the request.\n\n```go\nfunc (c *Client) Get(ctx context.Context, siteID string) (Site, error)\n```\nGet fetches one site by id (not slug), including its live URL. The detail route does NOT compute has\\_preview (only the list route does) — use GetBySlug when you need it.\n\n```go\nfunc (c *Client) GetBySlug(ctx context.Context, slug string) (Site, error)\n```\nGetBySlug resolves a slug and returns the site's full detail. It merges the two routes' views: the detail route has every column (model, published\\_at, …) but not has\\_preview, which only the list route computes — so the list row's HasPreview is carried over instead of being reset to false.\n\n```go\nfunc (c *Client) InitLocal(ctx context.Context, name string) (LocalSite, error)\n```\nInitLocal creates a site on this machine only: the starter template in a new managed workspace, as a git repository with one commit. Nothing is created on memcode.ai.\n\n```go\nfunc (c *Client) Kit(ctx context.Context) (Kit, error)\n```\nKit returns the current template's dependency set, from the same template memcode.ai scaffolds new sites from (and bakes into the hosted builder).\n\n```go\nfunc (c *Client) List(ctx context.Context) ([]Site, error)\n```\nList returns the org's sites.\n\n```go\nfunc (c *Client) ListAssets(ctx context.Context, siteID string) ([]Asset, error)\n```\nListAssets returns the site's durable uploaded assets.\n\n```go\nfunc (c *Client) ListBuilds(ctx context.Context, siteID string) ([]Build, error)\n```\nListBuilds returns the site's build history, newest first.\n\n```go\nfunc (c *Client) MergeHosted(ctx context.Context, l LocalSite) error\n```\nMergeHosted merges memcode.ai's changes into a managed working copy that has its own: local work is committed, then the hosted history merged in. A conflict is aborted, leaving the copy as it was, and reported as ErrBehind.\n\n```go\nfunc (c *Client) Preview(ctx context.Context, siteID string) (string, error)\n```\nPreview mints a short-lived draft-preview URL: preview--{slug}.{apex}, carrying the token website-host's draft serving path checks. Mirrors the exact construction the web app's UI does from the same /preview-token response — there is no separate CLI auth scheme.\n\n```go\nfunc (c *Client) Publish(ctx context.Context, siteID string) (string, error)\n```\nPublish promotes the site's draft to its live URL. Returns the live URL when the server reports one.\n\n```go\nfunc (c *Client) Pull(ctx context.Context, slug, destDir string) (Site, error)\n```\nPull clones the site's repo bundle into destDir (which must not exist) and writes the .memcode/website.json marker.\n\n```go\nfunc (c *Client) Push(ctx context.Context, dir string) (Site, error)\n```\nPush bundles the repo at dir and uploads it; the server rebuilds the draft preview from the pushed source. A site that exists only on this machine is created on memcode.ai by its first push, like pushing a new git repo. Pending changes in a managed working copy are committed first, so the push carries what the dev server shows.\n\n```go\nfunc (c *Client) Resolve(ctx context.Context, slug string) (Site, error)\n```\nResolve finds a site by slug (exact match).\n\n```go\nfunc (c *Client) Share(ctx context.Context, siteID string, days int) (ShareLink, error)\n```\nShare makes a share link for a site's draft, valid for days (0 = the server's default, a week).\n\n```go\nfunc (c *Client) ShareLinks(ctx context.Context, siteID string) ([]ShareLink, error)\n```\nShareLinks lists a site's share links that still work.\n\n```go\nfunc (c *Client) SyncLocalKit(ctx context.Context, dir string) (KitPlan, error)\n```\nSyncLocalKit moves a local site's kit packages to the current kit (see SyncKit) and, in a managed copy, commits the change on its own so it isn't mixed into the user's work.\n\n```go\nfunc (c *Client) Unpublish(ctx context.Context, siteID string) error\n```\nUnpublish takes the site offline.\n\n```go\nfunc (c *Client) Unshare(ctx context.Context, siteID, codeOrURL string) error\n```\nUnshare turns a share link off. It takes the code or the whole link.\n\n```go\nfunc (c *Client) Update(ctx context.Context, siteID string, name, model *string) (Site, error)\n```\nUpdate patches the site's name and/or model. Either pointer may be nil to leave that field untouched; at least one must be set.\n\n```go\nfunc (c *Client) UploadAsset(ctx context.Context, siteID, localPath, name string) (Asset, error)\n```\nUploadAsset uploads the file at localPath, named by its own base name unless name is non-empty. The file goes straight to storage through a signed URL (no request-body limit in the way), then the server checks and adopts the stored object. A server without the signed flow gets the multipart upload instead.\n\n```go\ntype Edit struct {\n\tFind    string `json:\"find\"`\n\tReplace string `json:\"replace\"`\n}\n```\nEdit is one verbatim find/replace applied by an edit-mode build, bypassing the agent for a fast, deterministic rebuild.\n\n```go\ntype ErrDependencies struct{ Problems []Verdict }\n```\nErrDependencies is a site whose package.json the policy refuses.\n\n```go\nfunc (e *ErrDependencies) Error() string\n```\n\n```go\ntype Kit struct {\n\tDependencies    map[string]string `json:\"dependencies\"`\n\tDevDependencies map[string]string `json:\"devDependencies\"`\n\t// History is the kit's version history (KitHistoryFile), when known.\n\tHistory KitHistory `json:\"-\"`\n}\n```\nKit is the template's dependency set.\n\n```go\nfunc BaselineKit(dir string) (Kit, error)\n```\nBaselineKit is the dependency set the site itself started from: package.json in its first commit. The fallback when the current template can't be read.\n\n```go\nfunc ReadKit(path string) (Kit, error)\n```\nReadKit reads a kit from a package.json file, with the kit history beside it when there is one.\n\n```go\nfunc SiteDeps(dir string) (Kit, error)\n```\nSiteDeps reads a site's package.json.\n\n```go\nfunc SiteKit(ctx context.Context, c *Client, dir string) Kit\n```\nSiteKit is the kit to judge a site against: the current template's when memcode.ai can be reached, else the one the site started from.\n\n```go\nfunc (k Kit) Has(name, version string) bool\n```\nHas reports whether name@version is a kit runtime dependency.\n\n```go\ntype KitHistory struct {\n\tEpoch    int                       `json:\"epoch\"`\n\tVersions map[string]map[string]int `json:\"versions\"`\n}\n```\nKitHistory is every version the kit has pinned, by package, with the epoch each shipped in. Epoch is the kit's current epoch.\n\n```go\ntype KitMove struct {\n\tName string `json:\"name\"`\n\tFrom string `json:\"from\"`\n\tTo   string `json:\"to\"`\n\tDev  bool   `json:\"dev,omitempty\"`\n}\n```\nKitMove is one package moving to the kit's version.\n\n```go\nfunc (m KitMove) String() string\n```\n\n```go\ntype KitPlan struct {\n\tMoves []KitMove `json:\"moves\"`\n\t// Kept lists kit packages at a version the site's owner chose.\n\tKept []string `json:\"kept,omitempty\"`\n\t// Migration lists kit packages from an older epoch. When it is non-empty,\n\t// nothing moves.\n\tMigration []string `json:\"migration,omitempty\"`\n}\n```\nKitPlan is what syncing a site with the kit would do.\n\n```go\nfunc PlanKitSync(site, kit Kit) KitPlan\n```\nPlanKitSync decides which of the site's packages follow the kit.\n\n```go\nfunc SyncKit(ctx context.Context, dir string, kit Kit) (KitPlan, error)\n```\nSyncKit moves the site's kit packages to the kit's versions, updating package.json and package-lock.json (not node\\_modules). It returns the plan it carried out.\n\n```go\nfunc (p KitPlan) Summary() string\n```\nSummary describes a plan in one line for the terminal.\n\n```go\ntype LocalSite struct {\n\tRoot   string // the managed workspace root (~/.memcode/websites/\u003ckey\u003e)\n\tSource string // the site's repo working tree\n\tMeta   Meta\n}\n```\nLocalSite is a site with a managed working copy on this machine.\n\n```go\nfunc FindLocal(key string) (LocalSite, bool)\n```\nFindLocal finds a managed working copy by local name, local id, slug, or site id.\n\n```go\nfunc ListLocal() ([]LocalSite, error)\n```\nListLocal returns every site with a managed working copy.\n\n```go\nfunc (l LocalSite) Label() string\n```\nLabel is how the site is named to the user: its address once pushed, its local name before.\n\n```go\nfunc (l LocalSite) NeedsPush() bool\n```\nNeedsPush reports whether memcode.ai is behind this working copy: never pushed, uncommitted changes, or commits since the last push.\n\n```go\nfunc (l LocalSite) Pushed() bool\n```\nPushed reports whether the site exists on memcode.ai.\n\n```go\nfunc (l LocalSite) Workspace() (Workspace, error)\n```\nWorkspace is the managed {source, assets, runtime} layout \\`dev\\` runs from.\n\n```go\ntype Meta struct {\n\tSiteID string `json:\"site_id,omitempty\"` // empty until a local-only site is first pushed\n\tSlug   string `json:\"slug,omitempty\"`\n\t// A site created on this machine (InitLocal) before it exists on memcode.ai.\n\tLocalID string `json:\"local_id,omitempty\"`\n\tName    string `json:\"name,omitempty\"`\n\t// PushedHead is the commit the last push uploaded: a working copy whose\n\t// HEAD differs, or that has uncommitted changes, has something to push.\n\tPushedHead string `json:\"pushed_head,omitempty\"`\n}\n```\nMeta is the .memcode/website.json marker written at pull time.\n\n```go\nfunc ReadMeta(dir string) (Meta, error)\n```\nReadMeta loads the .memcode/website.json marker from a pulled repo.\n\n```go\ntype Registry struct {\n\tBaseURL      string // registry, e.g. https://registry.npmjs.org\n\tDownloadsURL string // downloads API, e.g. https://api.npmjs.org/downloads/point/last-week\n\tHTTP         *http.Client\n\tNow          func() time.Time\n}\n```\nRegistry reads package facts from npm.\n\n```go\nfunc NewRegistry() *Registry\n```\nNewRegistry returns a registry client for the public npm registry.\n\n```go\nfunc (r *Registry) Vet(ctx context.Context, name, version string) Verdict\n```\nVet judges a package outside the kit. version \"\" picks the newest version that passes; an explicit version is judged as given.\n\n```go\ntype Request struct {\n\tAt   time.Time `json:\"at\"`\n\tText string    `json:\"text\"`\n}\n```\nRequest is one change asked of the site.\n\n```go\ntype ShareLink struct {\n\tCode      string    `json:\"code\"`\n\tURL       string    `json:\"url\"`\n\tExpiresAt time.Time `json:\"expiresAt\"`\n}\n```\nShareLink is a short link to a site's draft preview (memcode.ai/p/{code}). Anyone with it can view the draft until it expires or is turned off; it never shows or changes the live site.\n\n```go\ntype Site struct {\n\tID          string `json:\"id\"`\n\tName        string `json:\"name\"`\n\tSlug        string `json:\"slug\"`\n\tStatus      string `json:\"status\"`\n\tModel       string `json:\"model,omitempty\"`\n\tHasPreview  bool   `json:\"has_preview,omitempty\"`  // list route: a completed build exists to show\n\tPublishedAt string `json:\"published_at,omitempty\"` // non-empty once Publish has run\n\tLiveURL     string `json:\"url,omitempty\"`          // www list route emits `url` (siteUrl(slug))\n}\n```\nSite is one website, as the www API reports it.\n\n```go\ntype Verdict struct {\n\tName      string    `json:\"name\"`\n\tVersion   string    `json:\"version\"`\n\tKit       bool      `json:\"kit,omitempty\"`\n\tOK        bool      `json:\"ok\"`\n\tReason    string    `json:\"reason,omitempty\"` // why not, when !OK\n\tLicense   string    `json:\"license,omitempty\"`\n\tDownloads int       `json:\"weekly_downloads,omitempty\"`\n\tPublished time.Time `json:\"published,omitzero\"`\n}\n```\nVerdict is the policy's answer for one package.\n\n```go\nfunc Add(ctx context.Context, dir, name, version string, kit Kit, reg *Registry) (Verdict, error)\n```\nAdd installs one package into the site at dir: a kit package at the kit's version, anything else only when Vet passes. Installs never run package scripts, exactly as on memcode.ai.\n\n```go\nfunc Check(ctx context.Context, dir string, kit Kit, reg *Registry) ([]Verdict, error)\n```\nCheck judges every dependency of the site at dir against kit and the policy. It returns one verdict per dependency outside the kit (the kit is fine by definition) plus any devDependency change, which is never allowed: the build toolchain is the template's.\n\n```go\nfunc Problems(vs []Verdict) []Verdict\n```\nProblems keeps the verdicts that fail.\n\n```go\nfunc (v Verdict) Summary() string\n```\nSummary is the verdict in one line for the user and the model.\n\n```go\ntype Workspace struct {\n\tRoot       string // managed: ManagedDir(siteID); explicit: the checkout dir itself\n\tManaged    bool\n\tSourceDir  string // the site's repo working tree (== Root for explicit mode)\n\tAssetsDir  string // asset cache, fully refreshed on every `dev` run\n\tRuntimeDir string // generated, untracked dev-server config override\n}\n```\nWorkspace is the resolved {source, assets, runtime} layout \\`dev\\` works from, whichever mode produced it.\n\n```go\nfunc ExplicitWorkspace(dir string) (Workspace, error)\n```\nExplicitWorkspace resolves (and creates .memcode/assets + .memcode/runtime for) the workspace rooted at an existing checkout dir. Callers MUST call config.EnsureGitignore(dir) first — see the package doc comment.\n\n```go\nfunc ManagedWorkspace(siteID string) (Workspace, error)\n```\nManagedWorkspace resolves (and creates assets/ + runtime/ for) the managed workspace for siteID. source/ is created separately, only when the caller actually clones into it (see Workspace.SourceDir, populated on demand).\n\n```go\nfunc (ws Workspace) SourceExists() bool\n```\nSourceExists reports whether SourceDir already holds a cloned repo (a non-empty directory) — the signal \\`dev\\` uses to decide whether to Pull.\n\n","path":"github.com/memcode-ai/memcode/internal/websites","name":"websites","synopsis":"check.go — will this site build on memcode.ai? Answered here, before a push.","isRedistributable":true}
