microapps

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CollectionName = "ai_micro_apps"
)

Variables

View Source
var ErrPinLimit = errors.New("you can pin at most 6 micro apps")

Functions

func PreviewURL

func PreviewURL(id string) string

func Register

func Register(app core.App)

func SetPinned

func SetPinned(ctx context.Context, app core.App, actorID, appID string, pinned bool) error

Types

type CreateInput

type CreateInput struct {
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
	HTML        string `json:"html,omitempty"`
}

type GetInput

type GetInput struct {
	ID          string `json:"id"`
	IncludeHTML bool   `json:"includeHtml,omitempty"`
}

type ListInput

type ListInput struct {
	Query   string `json:"query,omitempty"`
	Page    int    `json:"page,omitempty"`
	PerPage int    `json:"perPage,omitempty"`
}

type ReplaceInput

type ReplaceInput struct {
	ID         string `json:"id"`
	Find       string `json:"find"`
	Replace    string `json:"replace"`
	ReplaceAll bool   `json:"replaceAll,omitempty"`
}

type Result

type Result struct {
	OK           bool          `json:"ok"`
	ID           string        `json:"id"`
	Result       string        `json:"result"`
	PreviewURL   string        `json:"previewUrl"`
	Name         string        `json:"name,omitempty"`
	Description  string        `json:"description,omitempty"`
	AppStatus    string        `json:"appStatus,omitempty"`
	HTML         string        `json:"html,omitempty"`
	Matches      []SearchMatch `json:"matches,omitempty"`
	Items        []Summary     `json:"items,omitempty"`
	Page         int           `json:"page,omitempty"`
	PerPage      int           `json:"perPage,omitempty"`
	HasMore      bool          `json:"hasMore,omitempty"`
	SourceLength int           `json:"sourceLength,omitempty"`
	Replacements int           `json:"replacements,omitempty"`
	Error        string        `json:"error"`
}

func Create

func Create(ctx context.Context, app core.App, actorID string, input CreateInput) Result

func Get

func Get(ctx context.Context, app core.App, actorID string, input GetInput) Result

func List

func List(ctx context.Context, app core.App, actorID string, input ListInput) Result

func Replace

func Replace(ctx context.Context, app core.App, actorID string, input ReplaceInput) Result
func Search(ctx context.Context, app core.App, actorID string, input SearchInput) Result

func Update

func Update(ctx context.Context, app core.App, actorID string, input UpdateInput) Result

func WriteChunk

func WriteChunk(ctx context.Context, app core.App, actorID string, input WriteChunkInput) Result

type SearchInput

type SearchInput struct {
	ID           string `json:"id"`
	Query        string `json:"query"`
	ContextChars int    `json:"contextChars,omitempty"`
	MaxMatches   int    `json:"maxMatches,omitempty"`
}

type SearchMatch

type SearchMatch struct {
	Index  int    `json:"index"`
	Before string `json:"before"`
	Match  string `json:"match"`
	After  string `json:"after"`
}

type Summary

type Summary struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
	AppStatus   string `json:"appStatus"`
	PreviewURL  string `json:"previewUrl"`
	Updated     string `json:"updated,omitempty"`
}

type UpdateInput

type UpdateInput struct {
	ID          string  `json:"id"`
	Name        *string `json:"name,omitempty"`
	Description *string `json:"description,omitempty"`
	HTML        *string `json:"html,omitempty"`
	Status      *string `json:"status,omitempty"`
}

type WriteChunkInput

type WriteChunkInput struct {
	ID      string `json:"id"`
	Content string `json:"content"`
	Mode    string `json:"mode,omitempty"`
}

Jump to

Keyboard shortcuts

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