driver

package
v0.29.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package driver runs a project's tracker driver: an executable at .f10/driver satisfying the verb contract in docs/driver-contract.md.

f10 specifies that contract and implements none of it. What a driver talks to - Notion, Jira, a wiki, a spreadsheet - is the project's business, and so is the language it is written in. The one thing f10 fixes is the shape of the conversation: a verb, an argument, data on stdout, and a reserved exit code for a verb the driver does not offer.

Drivers return data and never act. f10 performs every side effect, which is what lets `open` mean the same thing for a task as for a pull request, where no driver is involved at all.

Index

Constants

View Source
const (
	VerbRead   = "read"   // stdout: the task as markdown
	VerbURL    = "url"    // stdout: one url
	VerbSearch = "search" // stdout: JSON rows, one task each
	VerbBranch = "branch" // stdout: one branch name, never created
)

Verbs a driver may implement.

View Source
const ExitUnsupported = 3

ExitUnsupported is the contract's reserved exit code: the driver ran and understood the call, but does not implement that verb. It is a normal answer, not a failure, so a driver can offer `read` without `search`.

Variables

View Source
var ErrUnsupported = errors.New("driver does not implement this verb")

ErrUnsupported reports the reserved exit code back to the caller, which then falls back or explains, rather than failing the command.

Functions

This section is empty.

Types

type Driver

type Driver struct {
	Path string // the executable
	Dir  string // the checkout it runs in
}

A Driver is one project's executable.

func Find

func Find(storageRoot, dir string) *Driver

Find returns the driver for a storage root, or nil when the project has none - the ordinary case, which callers answer by falling back to the host's issues.

func (*Driver) Run

func (d *Driver) Run(ctx context.Context, verb string, args ...string) (string, error)

Run invokes one verb and returns its stdout. The reserved code becomes ErrUnsupported; any other non-zero exit is a failure carrying the driver's own stderr verbatim, because the driver knows why it failed and f10 does not.

Jump to

Keyboard shortcuts

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