scratchpad

package
v0.1.39 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name                   = "scratchpad"
	EnvScratchpadURI       = "AGENTLY_SCRATCHPAD_URI"
	DefaultRootURITemplate = afsscratchpad.DefaultRootURITemplate
)
View Source
const MaxArtifactBytes int64 = 64 << 20

Variables

This section is empty.

Functions

func ArtifactID added in v0.1.39

func ArtifactID(uri string) (string, error)

func ArtifactURI added in v0.1.39

func ArtifactURI(id string) string

func RegisterProvider added in v0.1.39

func RegisterProvider()

RegisterProvider initializes AFS once per runtime, never with a fixed user.

func ResolveRootURI

func ResolveRootURI(ctx context.Context, template string) (string, string, error)

Types

type AppendInput

type AppendInput = afsscratchpad.AppendInput

type AppendOutput

type AppendOutput = afsscratchpad.AppendOutput

type ArtifactDescriptor added in v0.1.39

type ArtifactDescriptor struct {
	URI       string `json:"uri"`
	ID        string `json:"id"`
	Name      string `json:"name"`
	MimeType  string `json:"mimeType"`
	SizeBytes int64  `json:"sizeBytes"`
	SHA256    string `json:"sha256,omitempty"`
	SourceURI string `json:"sourceURI,omitempty"`
}

ArtifactDescriptor is public resource metadata, never a backing storage URL.

type Entry

type Entry = afsscratchpad.Entry

type FetchInput

type FetchInput = afsscratchpad.FetchInput

type FetchOutput

type FetchOutput = afsscratchpad.FetchOutput

type ListInput

type ListInput = afsscratchpad.ListInput

type ListOutput

type ListOutput = afsscratchpad.ListOutput

type MemorizeInput

type MemorizeInput = afsscratchpad.MemorizeInput

type MemorizeOutput

type MemorizeOutput = afsscratchpad.MemorizeOutput

type Option

type Option func(*Service)

func WithAFS

func WithAFS(fs afs.Service) Option

func WithArtifactClient added in v0.1.39

func WithArtifactClient(client *afsscratchpad.Service, fs afs.Service) Option

WithArtifactClient reuses an already configured trusted publisher (reporting).

func WithNow

func WithNow(now func() time.Time) Option

func WithRootURI

func WithRootURI(template string) Option

type Service

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

func New

func New(opts ...Option) *Service

func (*Service) DescribeArtifact added in v0.1.39

func (s *Service) DescribeArtifact(ctx context.Context, uri string) (*ArtifactDescriptor, error)

func (*Service) ListArtifacts added in v0.1.39

func (s *Service) ListArtifacts(ctx context.Context, cursor string, limit int) ([]*ArtifactDescriptor, string, error)

ListArtifacts returns user-owned public descriptors in stable ID order. cursor is the last returned id, not a filesystem path.

func (*Service) Method

func (s *Service) Method(name string) (svc.Executable, error)

func (*Service) Methods

func (s *Service) Methods() svc.Signatures

func (*Service) Name

func (s *Service) Name() string

func (*Service) OpenArtifact added in v0.1.39

func (s *Service) OpenArtifact(ctx context.Context, uri string) (*ArtifactDescriptor, io.ReadCloser, error)

func (*Service) PublishArtifact added in v0.1.39

func (s *Service) PublishArtifact(ctx context.Context, id, name, mime, sourceURI string, body io.Reader) (*ArtifactDescriptor, error)

PublishArtifact writes immutable bytes before exposing the private manifest. A repeated id is accepted only for identical content. IDs should be unique across producers; the lock coordinates publication in this process.

Jump to

Keyboard shortcuts

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