artifacts

package
v0.11.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 13, 2026 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

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/<id>) 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.

Index

Constants

View Source
const (

	// MaxHTMLBytes mirrors the server's 1.5MB cap so an oversize artifact fails
	// fast locally instead of uploading 1.5MB to get a 413.
	MaxHTMLBytes = 1536 * 1024
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Artifact

type Artifact struct {
	ID        string `json:"id"`
	Title     string `json:"title,omitempty"`
	URL       string `json:"url"`
	UpdatedAt string `json:"updated_at,omitempty"`
}

Artifact is one published page, as the www API reports it.

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is an authenticated memcode.ai artifacts client.

func New

func New() (*Client, error)

New builds a client from the environment. Errors when the user has no token — the caller surfaces "run `memcode login`".

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, id string) error

Delete takes a published artifact down.

func (*Client) List

func (c *Client) List(ctx context.Context) ([]Artifact, error)

List returns the org's artifacts, newest first.

func (*Client) Publish

func (c *Client) Publish(ctx context.Context, title, html string) (Artifact, error)

Publish creates a new artifact and returns it (URL included).

func (*Client) Update

func (c *Client) Update(ctx context.Context, id, title, html string) (Artifact, error)

Update replaces an artifact's content in place — the URL stays stable.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL