{"modulePath":"github.com/memcode-ai/memcode","version":"v0.56.16","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package artifacts\n\nPackage artifacts is the CLI's client for memcode.ai's artifact hosting: the agent publishes a self-contained HTML page and gets a stable, unguessable URL (memcode.ai/code/artifact/\\\u003cid\u003e) back. Publish/Update/List/Delete map onto the www /api/cli/artifacts endpoints, authenticated with the same bearer token the login flow mints (MEMCODE\\_API\\_TOKEN). This talks to the WEB APP, not the inference gateway — a deliberate, separate client.\n\n## Constants\n\n```go\nconst (\n\n\t// MaxHTMLBytes mirrors the server's 1.5MB cap so an oversize artifact fails\n\t// fast locally instead of uploading 1.5MB to get a 413.\n\tMaxHTMLBytes = 1536 * 1024\n)\n```\n\n## Functions\n\n```go\nfunc RenderList(list []Artifact) string\n```\nRenderList formats artifacts as an aligned table — shared by the cobra command and the TUI /artifacts slash handler.\n\n## Types\n\n```go\ntype Artifact struct {\n\tID        string `json:\"id\"`\n\tTitle     string `json:\"title,omitempty\"`\n\tURL       string `json:\"url\"`\n\tUpdatedAt string `json:\"updated_at,omitempty\"`\n}\n```\nArtifact is one published page, as the www API reports it.\n\n```go\ntype Client struct {\n\t// contains filtered or unexported fields\n}\n```\nClient is an authenticated memcode.ai artifacts 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) Delete(ctx context.Context, id string) error\n```\nDelete takes a published artifact down.\n\n```go\nfunc (c *Client) List(ctx context.Context) ([]Artifact, error)\n```\nList returns the org's artifacts, newest first.\n\n```go\nfunc (c *Client) Publish(ctx context.Context, title, html string) (Artifact, error)\n```\nPublish creates a new artifact and returns it (URL included).\n\n```go\nfunc (c *Client) Update(ctx context.Context, id, title, html string) (Artifact, error)\n```\nUpdate replaces an artifact's content in place — the URL stays stable.\n\n","path":"github.com/memcode-ai/memcode/internal/artifacts","name":"artifacts","synopsis":"Package artifacts is the CLI's client for memcode.ai's artifact hosting: the agent publishes a self-contained HTML page and gets a stable, unguessable URL (memcode.ai/code/artifact/\u003cid\u003e) back.","isRedistributable":true}
