core

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: MIT Imports: 27 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckName

func CheckName(name string) error

CheckName validates a portable workspace, stage or task name.

func ErrorCode

func ErrorCode(err error) string

ErrorCode returns the application code or operation_failed for other errors.

func Fail

func Fail(code, message string) error

Fail constructs a coded application error.

func Home

func Home() (string, error)

Home resolves the configured or default WTF registry home.

func ID

func ID() (string, error)

ID generates a random workspace or repository identifier.

func NativeWorkspaces

func NativeWorkspaces(ctx context.Context, root string) (map[string]string, error)

NativeWorkspaces lists JJ workspace names and their registered paths.

Types

type App

type App struct {
	Cwd      string
	Home     string
	Out      io.Writer
	Reviews  ReviewClient
	PRs      PRClient
	Notifier func(Notification) error
}

App binds the current directory, registry home and subprocess output.

func New

func New(cwd, home string, out io.Writer) *App

New constructs a workspace application.

func (*App) ChangeWorkspace

func (a *App) ChangeWorkspace(ctx context.Context, name, message string) (Workspace, error)

ChangeWorkspace replaces the message on a registered workspace. An empty name selects the current workspace; an empty message clears its description.

func (*App) CommandDefaults

func (a *App) CommandDefaults(ctx context.Context, canonical func(string) (string, error)) (map[string]map[string]any, error)

CommandDefaults loads inherited declarative defaults without executing hooks.

func (*App) CompletionWorkspaces

func (a *App) CompletionWorkspaces(ctx context.Context, global, here bool) ([]WorkspaceView, error)

CompletionWorkspaces reads local registries without reconciliation or mutation.

func (*App) Doctor

func (a *App) Doctor(ctx context.Context, configurationErrors ...error) (Health, error)

Doctor checks tool readiness and current workspace health without repairing it.

func (*App) Exec

func (a *App) Exec(ctx context.Context, dir string, argv []string, env map[string]string, timeout time.Duration, quiet bool) error

Exec runs a bounded child command with explicit environment overrides.

func (*App) GitHubService

func (a *App) GitHubService() *PRService

GitHubService constructs the repository PR service.

func (*App) Hook

func (a *App) Hook(ctx context.Context, name string, args ...string) (Workspace, error)

Hook runs a named hook under the current workspace lock.

func (*App) Hooks

func (a *App) Hooks(ctx context.Context) (map[string][]string, error)

Hooks lists registered hooks and overrides without invoking them.

func (*App) Init

func (a *App) Init(ctx context.Context) (Workspace, error)

Init initializes the workspace and returns its durable record.

func (*App) Initialize

func (a *App) Initialize(ctx context.Context, args ...string) (Initialization, error)

Initialize registers the workspace and dispatches project initialization hooks.

func (*App) InspectRemoval

func (a *App) InspectRemoval(ctx context.Context, row WorkspaceView) (RemovalCandidate, error)

InspectRemoval observes and inspects a single workspace. Multi-row callers share Metadata().Observe results with a RemovalInspector instead.

func (*App) InvokeHooks

func (a *App) InvokeHooks(ctx context.Context, invocation HookInvocation, operation func() (any, error)) (any, error)

InvokeHooks wraps a command with explicit invocation and surface phases. Parsing, help, diagnostics and recovery commands are filtered by the CLI.

func (*App) List

func (a *App) List(ctx context.Context, global, here bool) ([]WorkspaceView, error)

List lists opted-in workspaces in the selected repository scope.

func (*App) Metadata

func (a *App) Metadata() *MetadataService

Metadata creates a command-owned metadata service.

func (*App) NewWorkspace

func (a *App) NewWorkspace(ctx context.Context, path, from string, args ...string) (Initialization, error)

NewWorkspace prepares an existing workspace root or creates one at the exact destination path. Bare names resolve beside the registered repository anchor; explicit relative paths resolve from the invoking directory.

func (*App) NewWorkspaceWithOptions

func (a *App) NewWorkspaceWithOptions(ctx context.Context, path, from string, options NewWorkspaceOptions, args ...string) (Initialization, error)

NewWorkspaceWithOptions creates or prepares a workspace with optional metadata.

func (*App) Notify

func (a *App) Notify(message, level string) error

Notify routes a script message through the host UI, or plain logs for embedders. Severity is presentation only: an error notification does not fail the hook.

func (*App) RemovalCandidates

func (a *App) RemovalCandidates(ctx context.Context) ([]RemovalCandidate, error)

RemovalCandidates observes active workspaces before an interactive cleanup. Normal JJ snapshotting captures on-disk edits; no hooks or removals run here.

func (*App) RemovalInspector

func (a *App) RemovalInspector(ctx context.Context) (*RemovalInspector, error)

RemovalInspector uses the current repository, or each row's repository when invoked from a parent directory, matching List's default scope.

func (*App) RemovalMetadata

func (a *App) RemovalMetadata(ctx context.Context, rows []WorkspaceView) []WorkspaceView

RemovalMetadata reuses the browser's repository observation. Missing or expired observations use targeted discovery, without CI hydration or cache pollution.

func (*App) Remove

func (a *App) Remove(ctx context.Context, name string) (Workspace, error)

Remove tears down and removes an owned workspace after safety checks.

func (*App) RemoveWithOptions

func (a *App) RemoveWithOptions(ctx context.Context, name string, options RemovalOptions) (Workspace, error)

RemoveWithOptions retains identity, ownership, and lifecycle checks in force mode.

func (*App) ResolveWorkspacePath

func (a *App) ResolveWorkspacePath(ctx context.Context, path string) (string, error)

ResolveWorkspacePath shares destination semantics between native creation and hook events: bare names are siblings of the anchor, explicit paths use cwd.

func (*App) RunCommand

func (a *App) RunCommand(ctx context.Context, dir string, argv []string, options CommandOptions) (CommandResult, error)

RunCommand executes argv directly. Captured contents never enter host records.

func (*App) Setup

func (a *App) Setup(ctx context.Context, schema []byte) (SetupResult, error)

Setup creates a local, ignored configuration scaffold without running hooks or registering a workspace. Only unchanged generated guides are refreshed.

func (*App) Stage

func (a *App) Stage(ctx context.Context, r Repo, w Workspace, name string, argv []string, o StageOptions) (Stage, error)

Stage runs and records a named project command, optionally reusing a verified result.

func (*App) Task

func (a *App) Task(ctx context.Context, name string, args []string) (Stage, error)

Task runs a configured task in the current workspace.

func (*App) TeardownSetup

func (a *App) TeardownSetup(ctx context.Context, confirmed bool) (SetupTeardownResult, error)

TeardownSetup inspects the current directory's .wtf and removes it only after explicit confirmation. Root-scoped removal never follows symlinks outside it.

func (*App) Validate

func (a *App) Validate(ctx context.Context) (Config, error)

Validate checks configuration without executing project hooks.

func (a *App) WithReviewLinks(ctx context.Context, rows []WorkspaceView, force bool) []WorkspaceView

WithReviewLinks augments matched PRs without replacing GitHub state or checks.

type CheckSummary

type CheckSummary struct {
	Head      string `json:"head"`
	Total     int    `json:"total"`
	Failed    int    `json:"failed"`
	Pending   int    `json:"pending"`
	Passed    int    `json:"passed"`
	Skipped   int    `json:"skipped"`
	Cancelled int    `json:"cancelled"`
	Unknown   int    `json:"unknown"`
	Truncated bool   `json:"truncated,omitempty"`
}

CheckSummary describes GitHub checks on the published PR head, not local work.

type Claim

type Claim struct {
	Owner string `json:"owner"`
	Kind  string `json:"kind"`
	Name  string `json:"name"`
	Value string `json:"value"`
}

Claim records a resource identity owned by a workspace.

type CommandOptions

type CommandOptions struct {
	Env          map[string]string
	Unset        []string
	NoInheritEnv bool
	Timeout      time.Duration
	Stdin        string
	Capture      bool
}

CommandOptions configures bounded execution and the child environment.

type CommandResult

type CommandResult struct {
	Started         bool   `json:"started"`
	OK              bool   `json:"ok"`
	Code            int    `json:"code"`
	Stdout          string `json:"stdout"`
	Stderr          string `json:"stderr"`
	StdoutTruncated bool   `json:"stdout_truncated"`
	StderrTruncated bool   `json:"stderr_truncated"`
	TimedOut        bool   `json:"timed_out"`
	Cancelled       bool   `json:"cancelled"`
}

CommandResult reports execution status and bounded captured output.

type Config

type Config struct {
	Version    int                       `toml:"version" schema:"WTF configuration format version." schema-required:"true" schema-const:"1"`
	Lua        string                    `` /* 213-byte string literal not displayed */
	New        HookTriggers              `` /* 166-byte string literal not displayed */
	List       HookTriggers              `` /* 127-byte string literal not displayed */
	Remove     HookTriggers              `toml:"remove" schema:"Hooks around the remove command, including aliases. Native removal safety checks remain authoritative."`
	Invocation HookTriggers              `` /* 159-byte string literal not displayed */
	Tasks      map[string]Task           `` /* 129-byte string literal not displayed */
	Commands   map[string]map[string]any `` /* 214-byte string literal not displayed */
	// contains filtered or unexported fields
}

Config contains project hooks, tasks and command defaults.

func LoadConfig

func LoadConfig(root string) (Config, error)

LoadConfig loads and validates the project configuration.

func (Config) HookPath

func (c Config) HookPath(root string) (string, error)

HookPath resolves the configured Lua module within the project.

type CreationHooks

type CreationHooks = HookTriggers

CreationHooks retains the original Go type name for callers.

type DiagnosticCheck

type DiagnosticCheck struct {
	Code    string `json:"code"`
	Status  string `json:"status"`
	Message string `json:"message"`
	Remedy  string `json:"remedy,omitempty"`
}

DiagnosticCheck reports one independently inspected area.

type Fault

type Fault struct {
	Code    string
	Message string
}

Fault carries a stable application error code and message.

func (*Fault) Error

func (e *Fault) Error() string

type GHClient

type GHClient struct{ Binary string }

GHClient fetches PR metadata through the installed GitHub CLI.

func (GHClient) List

func (client GHClient) List(ctx context.Context, repository string) ([]PullRequest, error)

List fetches PR state and checks for the repository.

type Health

type Health struct {
	Workspace      Workspace       `json:"workspace"`
	Claims         []Claim         `json:"claims"`
	Issues         []string        `json:"issues"`
	Tools          []ToolCheck     `json:"tools"`
	Configuration  DiagnosticCheck `json:"configuration"`
	WorkspaceCheck DiagnosticCheck `json:"workspace_check"`
}

Health contains independent configuration, workspace and tool diagnostics.

type HookInvocation

type HookInvocation struct {
	Command string
	Args    []string
	Path    string
	From    string
}

HookInvocation identifies a parsed execution command without changing its argv.

type HookTriggers

type HookTriggers struct {
	Hooks   []string `` /* 284-byte string literal not displayed */
	Before  []string `` /* 128-byte string literal not displayed */
	After   []string `toml:"after" schema:"Ordered modules run after a successful operation. A failure stops the sequence and fails the command."`
	Failed  []string `toml:"failed" schema:"Modules run on failure with event.error. All are attempted; they cannot hide the primary error."`
	Finally []string `` /* 133-byte string literal not displayed */
}

HookTriggers selects explicit modules for lifecycle phases.

type Index

type Index struct {
	Version      int                   `json:"version"`
	Repositories map[string]Repository `json:"repositories"`
}

Index is the global index of opted-in repositories.

type Initialization

type Initialization struct {
	Workspace
	Code string `json:"code"`
}

Initialization reports a workspace identity and initialization outcome.

type MetadataPlan

type MetadataPlan struct {
	Cached []WorkspaceView
	// contains filtered or unexported fields
}

MetadataPlan contains a cache-first view and the prepared repository identities. Refresh publishes a separate observation, preserving any rendered preview.

func (MetadataPlan) Refresh

func (p MetadataPlan) Refresh(ctx context.Context) []WorkspaceView

Refresh requests live GitHub state even when the preview cache is recent. Failures retain previous observations with the provider's unavailable/stale status; they never become a successful empty association.

type MetadataRequest

type MetadataRequest struct {
	PRs          bool `json:"prs"`
	CI           bool `json:"ci"`
	Reviews      bool `json:"reviews"`
	ForceReviews bool `json:"force_reviews"`
}

MetadataRequest selects host-managed observations. CI and Reviews both depend on PR association; callers never need to fetch those dependencies themselves. ForceReviews bypasses the review-link cache, not account verification.

type MetadataService

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

MetadataService is the shared observation API for commands and future Lua bindings. Provider transport, grouping, caches and deadlines stay in the host.

func (*MetadataService) Observe

func (s *MetadataService) Observe(ctx context.Context, rows []WorkspaceView, request MetadataRequest) []WorkspaceView

Observe fetches one fresh repository observation shared by all workspace rows. Review links retain their own cache policy unless ForceReviews is requested.

func (*MetadataService) Prepare

func (s *MetadataService) Prepare(ctx context.Context, rows []WorkspaceView, request MetadataRequest) MetadataPlan

Prepare reads local identities and cached PR data without provider requests.

type MetadataState

type MetadataState string

MetadataState separates absence from provider freshness and failures.

const (
	MetadataPresent       MetadataState = "present"
	MetadataNone          MetadataState = "none"
	MetadataLoading       MetadataState = "loading"
	MetadataUnavailable   MetadataState = "unavailable"
	MetadataNotApplicable MetadataState = "not_applicable"
)

Provider observation states retain missing, pending and unavailable distinctions.

type NativeReviewClient

type NativeReviewClient struct{}

NativeReviewClient uses the embedded adapter and Codex-owned MCP OAuth.

func (NativeReviewClient) Diagnose

Diagnose checks the configured Linear connection and account identity.

func (NativeReviewClient) Resolve

func (NativeReviewClient) Resolve(ctx context.Context, root, prURL string) ReviewResolution

Resolve finds a verified Linear review or retains the GitHub destination.

func (NativeReviewClient) ResolveBatch

func (NativeReviewClient) ResolveBatch(ctx context.Context, lookups []ReviewLookup) []ReviewResolution

ResolveBatch uses one app-server, at most two verified ephemeral contexts and four outstanding calls per context. It never starts a model turn or retries.

type NewWorkspaceOptions

type NewWorkspaceOptions struct {
	Message *string
}

NewWorkspaceOptions contains optional metadata changes. A nil message preserves an existing description; an explicitly empty message clears it.

type Notification

type Notification struct {
	Message string
	Level   string
}

Notification is a host-rendered script message, independent of terminal styles.

type PRClient

type PRClient interface {
	List(context.Context, string) ([]PullRequest, error)
}

PRClient fetches pull requests for a GitHub repository.

type PRInfo

type PRInfo struct {
	PRState    MetadataState `json:"pr_state"`
	CIState    MetadataState `json:"ci_state"`
	Repository string        `json:"repository,omitempty"`
	Lookup     string        `json:"lookup"`
	CheckedAt  *time.Time    `json:"checked_at,omitempty"`
	Matches    []PullRequest `json:"matches"`
	Truncated  bool          `json:"truncated,omitempty"`
	Error      string        `json:"error,omitempty"`
}

PRInfo is a workspace PR observation, including lookup failures.

type PRPlan

type PRPlan struct {
	Groups       []prGroup
	Rows         []WorkspaceView
	NeedsRefresh bool
}

PRPlan groups workspace observations for a bounded refresh.

type PRService

type PRService struct {
	Home   string
	Client PRClient
	Now    func() time.Time
	Log    io.Writer
}

PRService loads, associates and caches GitHub PR observations.

func (*PRService) Prepare

func (s *PRService) Prepare(ctx context.Context, rows []WorkspaceView, force bool) PRPlan

Prepare plans a refresh using local identity and cached observations.

func (*PRService) Refresh

func (s *PRService) Refresh(ctx context.Context, plan PRPlan) []WorkspaceView

Refresh fetches planned PR observations with bounded concurrency.

type PullRequest

type PullRequest struct {
	Number          int    `json:"number"`
	Title           string `json:"title"`
	URL             string `json:"url"`
	State           string `json:"state"`
	Draft           bool   `json:"isDraft"`
	Branch          string `json:"headRefName"`
	Head            string `json:"headRefOid"`
	Base            string `json:"baseRefName"`
	CrossRepository bool   `json:"isCrossRepository"`
	Owner           struct {
		Login string `json:"login"`
	} `json:"headRepositoryOwner"`
	Relation string            `json:"relation,omitempty"`
	Rollup   json.RawMessage   `json:"statusCheckRollup,omitempty"`
	Checks   *CheckSummary     `json:"checks,omitempty"`
	Review   *ReviewResolution `json:"review,omitempty"`
}

PullRequest contains GitHub state, checks and its resolved review link.

type RemovalCandidate

type RemovalCandidate struct {
	WorkspaceView
	Revision      string   `json:"revision,omitempty"`
	Base          string   `json:"base,omitempty"`
	Integrated    bool     `json:"integrated"`
	Evidence      string   `json:"evidence,omitempty"`
	Ahead         int      `json:"ahead"`
	Changes       []string `json:"changes"`
	Selectable    bool     `json:"selectable"`
	Code          string   `json:"code,omitempty"`
	Warning       string   `json:"warning,omitempty"`
	ObservedEdits bool     `json:"observed_edits"`
	// contains filtered or unexported fields
}

RemovalCandidate describes local changes and evidence that workspace work has landed.

func (RemovalCandidate) CanRemove

func (r RemovalCandidate) CanRemove(force bool) bool

CanRemove keeps destructive intent separate from non-overridable guards.

func (RemovalCandidate) RemovalOptions

func (r RemovalCandidate) RemovalOptions(force bool) RemovalOptions

RemovalOptions carries this inspection into deletion without provider reads.

type RemovalInspector

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

RemovalInspector assesses local cleanup safety using a shared observation. Inspection never fetches provider metadata. Actual deletion still revalidates.

func (*RemovalInspector) Inspect

Inspect publishes one independent, bounded local safety assessment.

type RemovalOptions

type RemovalOptions struct {
	Force bool
	// contains filtered or unexported fields
}

RemovalOptions controls whether remaining source changes may be discarded.

type Repo

type Repo struct {
	Root  string
	Store string
}

Repo locates a JJ workspace and its shared WTF registry.

func Discover

func Discover(ctx context.Context, dir string) (Repo, error)

Discover resolves the shared WTF registry for a JJ workspace.

func (Repo) Claim

func (r Repo) Claim(ctx context.Context, w Workspace, kind, name, value string) (Claim, error)

Claim reserves a unique resource identity for a workspace.

func (Repo) Claims

func (r Repo) Claims(w Workspace) ([]Claim, error)

Claims lists a workspace's recorded resource claims.

func (Repo) Edit

func (r Repo) Edit(ctx context.Context, fn func(*State) error) error

Edit updates the registry atomically under its lock.

func (Repo) Load

func (r Repo) Load() (State, error)

Load reads and validates the repository registry.

func (Repo) LockWorkspace

func (r Repo) LockWorkspace(ctx context.Context, id string) (func(), error)

LockWorkspace locks lifecycle operations for a workspace identity.

func (Repo) Release

func (r Repo) Release(ctx context.Context, w Workspace, kind, name string) error

Release releases a workspace-owned resource identity.

func (Repo) Select

func (r Repo) Select(name string) (Workspace, error)

Select resolves a workspace by ID, name or path.

func (Repo) Update

func (r Repo) Update(ctx context.Context, id string, fn func(*Workspace)) error

Update changes one registered workspace under the registry lock.

func (Repo) Workspace

func (r Repo) Workspace(_ context.Context) (Workspace, error)

Workspace finds the current registered workspace.

type Repository

type Repository struct {
	ID    string `json:"id"`
	Path  string `json:"path"`
	Store string `json:"store"`
}

Repository locates an opted-in repository and its registry.

type ReviewBatchClient

type ReviewBatchClient interface {
	ResolveBatch(context.Context, []ReviewLookup) []ReviewResolution
}

ReviewBatchClient resolves a compatible account group with bounded async work. Results correspond to input order. Providers retain authentication ownership.

type ReviewClient

type ReviewClient interface {
	Resolve(context.Context, string, string) ReviewResolution
	Diagnose(context.Context, string) ReviewResolution
}

ReviewClient resolves PRs and probes their repository's existing MCP connection.

type ReviewLookup

type ReviewLookup struct {
	Root string `json:"root"`
	URL  string `json:"url"`
}

ReviewLookup identifies an exact PR and its repository's account configuration.

type ReviewResolution

type ReviewResolution struct {
	URL               string    `json:"url,omitempty"`
	Provider          string    `json:"provider"`
	Code              string    `json:"code"`
	Status            string    `json:"status,omitempty"`
	Profile           string    `json:"profile,omitempty"`
	Server            string    `json:"server,omitempty"`
	Workspace         string    `json:"workspace,omitempty"`
	WorkspaceID       string    `json:"workspace_id,omitempty"`
	ExpectedWorkspace string    `json:"expected_workspace,omitempty"`
	CheckedAt         time.Time `json:"checked_at"`
}

ReviewResolution identifies a verified review destination and its account scope.

type Runtime

type Runtime struct {
	App           *App
	Repo          Repo
	Workspace     Workspace
	L             *lua.LState
	Context       context.Context
	Cancel        context.CancelFunc
	CTX           *lua.LTable
	Hooks         *lua.LTable
	Overrides     *lua.LTable
	ModuleRoot    string
	Modules       map[string]lua.LValue
	Loading       map[string]bool
	Request       *lua.LTable
	Destination   string
	CreationHooks []string
	Parents       []*Runtime
}

Runtime owns a restricted Lua hook interpreter and workspace context.

func (*Runtime) Bind

func (r *Runtime) Bind(w Workspace)

Bind sets the current registered workspace in the hook context.

func (*Runtime) Close

func (r *Runtime) Close()

Close cancels hook execution and closes the Lua interpreter.

func (*Runtime) Override

func (r *Runtime) Override(op, name, from string, def func(string, string) (Workspace, error), args ...string) error

Override invokes an explicit lifecycle override or its default operation.

func (*Runtime) Run

func (r *Runtime) Run(name string, args ...string) error

Run invokes a registered project hook.

type SetupResult

type SetupResult struct {
	Path            string   `json:"path"`
	Created         []string `json:"created"`
	Existing        []string `json:"existing"`
	Updated         []string `json:"updated"`
	UpdateAvailable []string `json:"update_available"`
}

SetupResult reports scaffold files relative to the current directory.

type SetupTeardownResult

type SetupTeardownResult struct {
	Path   string `json:"path"`
	Status string `json:"status"`
}

SetupTeardownResult reports removal of local configuration only.

type Stage

type Stage struct {
	Status      string     `json:"status"`
	Fingerprint string     `json:"fingerprint"`
	StartedAt   time.Time  `json:"started_at"`
	FinishedAt  *time.Time `json:"finished_at,omitempty"`
	Error       string     `json:"error,omitempty"`
	Reused      bool       `json:"reused"`
}

Stage records a project command result and its input fingerprint.

type StageOptions

type StageOptions struct {
	Inputs         []string          `json:"inputs"`
	Check          []string          `json:"check"`
	Env            map[string]string `json:"-"`
	TimeoutSeconds int               `json:"timeout_seconds"`
	Reuse          bool              `json:"reuse"`
	Cwd            string            `json:"cwd,omitempty"`
	EnvUnset       []string          `json:"-"`
	NoInheritEnv   bool              `json:"-"`
}

StageOptions controls command inputs, reuse checks and execution limits.

type State

type State struct {
	Version      int                  `json:"version"`
	RepositoryID string               `json:"repository_id"`
	Anchor       string               `json:"anchor"`
	Workspaces   map[string]Workspace `json:"workspaces"`
	Claims       map[string]Claim     `json:"claims"`
}

State is the repository registry of workspaces and resource claims.

type Task

type Task struct {
	Command        []string `` /* 178-byte string literal not displayed */
	Inputs         []string `` /* 142-byte string literal not displayed */
	TimeoutSeconds int      `` /* 150-byte string literal not displayed */
}

Task defines a project command and its recorded inputs.

type ToolCheck

type ToolCheck struct {
	Tool     string            `json:"tool"`
	Code     string            `json:"code"`
	Status   string            `json:"status"`
	Required bool              `json:"required"`
	Feature  string            `json:"feature"`
	Message  string            `json:"message"`
	Remedy   string            `json:"remedy,omitempty"`
	Review   *ReviewResolution `json:"review,omitempty"`
}

ToolCheck describes readiness for a feature, independently of workspace health.

type Workspace

type Workspace struct {
	ID        string           `json:"id"`
	Name      string           `json:"name"`
	Path      string           `json:"path"`
	Owned     bool             `json:"owned"`
	Status    string           `json:"status"`
	Stages    map[string]Stage `json:"stages"`
	LastError string           `json:"last_error,omitempty"`
	// CreatedAt is the first WTF registration time, absent for legacy records.
	CreatedAt *time.Time `json:"created_at,omitempty"`
	Message   string     `json:"message,omitempty"`
}

Workspace is the durable identity and lifecycle record for a JJ workspace.

type WorkspaceView

type WorkspaceView struct {
	Workspace
	RepositoryID   string  `json:"repository_id"`
	RepositoryPath string  `json:"repository_path,omitempty"`
	Exists         bool    `json:"exists"`
	GitHub         *PRInfo `json:"github,omitempty"`
}

WorkspaceView adds repository and remote observations to a workspace record.

Jump to

Keyboard shortcuts

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