writeback

package
v0.7.19 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package writeback commits a <memory> block's content back to the skill repository using go-git. Push-to-remote is a separate method so commit is testable without network.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Path        string // relative to repo root
	Mode        string // "append" | "replace"
	Content     string
	Message     string
	AuthorName  string
	AuthorEmail string
}

Options controls a single writeback commit.

type Writer

type Writer struct{}

Writer performs writeback commits and optional pushes.

func New

func New() *Writer

New returns a Writer.

func (*Writer) Commit

func (w *Writer) Commit(repoRoot string, opts Options) (string, error)

Commit applies the writeback content to `repoRoot/Path`, stages it, and commits. Returns the commit SHA.

func (*Writer) Push

func (w *Writer) Push(repoRoot, remoteName, username, token string) error

Push sends the commit to the given remote using a PAT as basic-auth password. GitHub HTTPS push accepts any non-empty username.

func (*Writer) PushToURL

func (w *Writer) PushToURL(repoRoot, remoteURL string) error

PushToURL pushes the current HEAD to the given authenticated remote URL. Used by the /internal/writeback-push endpoint so the server can push using a short-lived install token without exposing it to the runner.

Jump to

Keyboard shortcuts

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