Help us shape the future of Go! Take the 2026 Go Developer Survey

projects

package
v0.241.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const MaxArtifactFrameBytes = 64 << 20

MaxArtifactFrameBytes caps the artifact a single panel frame carries, the binding's inbound frame limit.

Variables

View Source
var ErrArtifactName = errors.New("an artifact name is one file name under the session's artifacts dir")

ErrArtifactName refuses a name that is not one file directly under the session's artifacts dir.

Functions

func ArtifactPath added in v0.241.0

func ArtifactPath(dir, name string) (string, error)

ArtifactPath is the path of the artifact name under dir, refusing a name that names anything but one file directly under it.

func ParseRemoteURL

func ParseRemoteURL(url string) string

ParseRemoteURL extracts "org/repo" from an https or scp-style ssh git remote URL, returning "" when it does not match either form.

func Path

func Path() string

Path returns the absolute working directory, cached for the process lifetime. It identifies the project in conversation metadata and drives the per-project storage slug; an empty result means the cwd could not be resolved (process runs without a filesystem context).

func RemoteName

func RemoteName() string

RemoteName returns the "org/repo" name parsed from the origin remote URL, or "" when there is no repo/remote or the URL is unparsable.

func Slugify

func Slugify(name string) string

Slugify normalizes a name into a safe, flat filename segment: lowercased, non-alphanumeric runs collapsed to single hyphens, trimmed, and length-capped. Notably Slugify("org/repo") == "org-repo".

Types

type Artifact added in v0.241.0

type Artifact struct {
	Name       string    `json:"name"`
	Size       int64     `json:"size"`
	ModifiedAt time.Time `json:"modified_at"`
}

Artifact is one file a session saved under its artifacts dir.

func ListArtifacts added in v0.241.0

func ListArtifacts(dir string) ([]Artifact, error)

ListArtifacts lists the files directly under dir, newest first. A missing dir lists as empty, since a session may have saved nothing yet.

type Identity

type Identity struct {
	Name string
	Slug string
}

Identity is the detected project the process is running in. The zero value means global scope (no project).

func Detect

func Detect() Identity

Detect returns the current project, cached for the process lifetime (chat sessions and `infer headless` subprocesses run with a fixed cwd). Detection order: git remote origin -> org/repo; else the cwd basename; else global (the zero Identity).

Jump to

Keyboard shortcuts

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