tasks

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: MIT Imports: 13 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

Overview

Package tasks embeds the Tasks GTD terminal UI as a sidecar plugin, giving the full standalone experience — views, overlays, agent queue — inside a tab.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsRootContext

func IsRootContext(context string) bool

IsRootContext reports whether `q` in a Tasks context should reach sidecar's quit flow rather than the tab. Unknown contexts are not root: see rootContexts.

func IsTasksContext

func IsTasksContext(context string) bool

IsTasksContext reports whether a sidecar focus context belongs to the Tasks tab.

func IsTextInputContext

func IsTextInputContext(context string) bool

IsTextInputContext reports whether a Tasks context routes printable keys into an editor widget. It is derived from Tasks' exported context metadata rather than from a list maintained here.

Types

type Plugin

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

Plugin wraps the Tasks TUI as a sidecar plugin. Tasks keeps ownership of its configuration, storage, rendering, overlays, and agent queue; the plugin owns only placement and lifecycle.

func New

func New() *Plugin

New creates a new Tasks plugin.

func (*Plugin) BlocksGlobalKeys

func (p *Plugin) BlocksGlobalKeys() bool

BlocksGlobalKeys implements plugin.KeyRouter. Tasks' own overlays — modals, pickers, prompts, the agent activity list, and every text-input layer — own the keyboard while they are open, so sidecar's global keys must not fire underneath them.

Root contexts are listed (see rootContexts); everything else, INCLUDING an unknown context, is an overlay. A new Tasks overlay therefore routes safely without a change here, and the cost of the conservative default is a sidecar global that does not fire, never a quit out from under an open layer.

func (*Plugin) ClaimsKey

func (p *Plugin) ClaimsKey(key string) bool

ClaimsKey implements plugin.KeyRouter: the key has a live Tasks binding in the current context, so Tasks wins it over sidecar's global binding.

This is what makes `@`, `tab`, `M`, and `A` mean what they mean in Tasks while the tab is focused. Three rules decide it, in order:

  1. Host-reserved keys are never claimed (see hostReservedKeys; sidecar enforces the same set, this is defence in depth).
  2. A key sidecar binds globally is claimed only if the plan's conflict table decided that collision (mayShadowGlobal), and then unconditionally for the whole context (claimIsUnconditional) — so `K`, `W`, `#` and the number row keep their sidecar meanings, and `@` keeps its Tasks meaning no matter what is selected. Tasks' views step with `←`/`→` instead.
  3. Every other key is availability-aware: one whose only Tasks commands are unavailable right now is not claimed and falls through to sidecar. That is how `r` still refreshes when there is no proposal to reject and no recurrence to edit.

func (*Plugin) Commands

func (p *Plugin) Commands() []plugin.Command

Commands projects Tasks' exported command registry into sidecar commands. Tasks is the single source of truth; sidecar adds categorization and the handler that runs the command by its stable ID.

Commands belonging to the context Tasks is in right now are filtered by CommandAvailable, so the conditional pairs that share a key (`r` is either reject-proposal or open-recur-popup, never both) do not both appear in the palette. Commands for other contexts are kept: CommandAvailable answers for the live focus only, and the palette's other layers are still real help.

func (*Plugin) ConsumesTextInput

func (p *Plugin) ConsumesTextInput() bool

ConsumesTextInput reports whether printable keys belong to Tasks input.

func (*Plugin) ContentLinkSurfaces added in v1.2.0

func (p *Plugin) ContentLinkSurfaces() []contentlink.Surface

ContentLinkSurfaces stays empty until Tasks exports exact passive text rectangles. Its current spatial rectangles include rows and prompt/detail controls, so whole-frame scanning is intentionally unsafe.

func (*Plugin) Diagnostics

func (p *Plugin) Diagnostics() []plugin.Diagnostic

Diagnostics returns plugin health info.

A live model whose store cannot be read reports as an error even though the tab still renders. Tasks paints the user-facing banner (see storeReadHint); Diagnostics is where sidecar records the same condition for `sidecar doctor` and the logs, which is the surface Tasks' banner cannot reach.

func (*Plugin) FocusContext

func (p *Plugin) FocusContext() string

FocusContext returns the interaction layer currently consuming keys, as reported by Tasks itself.

func (*Plugin) FooterStatus

func (p *Plugin) FooterStatus() (string, bool)

FooterStatus implements plugin.FooterStatusProvider.

Tasks still paints its own store-read banner — sidecar suppresses only the key-hint row — but that banner lives inside the tab, which is not where a user looks when they are on another tab or reading the chrome. Restating it in the host footer is what keeps "what you are looking at is not your task list" visible at a glance. It is reported here as well as in Diagnostics because the diagnostics modal is a place you have to think to look.

A live sidecar toast outranks it (see renderFooter): the toast expires and this condition does not, so it comes straight back.

func (*Plugin) ID

func (p *Plugin) ID() string

ID returns the plugin identifier.

func (*Plugin) Icon

func (p *Plugin) Icon() string

Icon returns the plugin icon character.

func (*Plugin) Init

func (p *Plugin) Init(ctx *plugin.Context) error

Init initializes the plugin with context. It deliberately performs no I/O: no configuration walk, no store open, no agent process. All of that happens in the command returned by Start(), after the first frame.

func (*Plugin) IsFocused

func (p *Plugin) IsFocused() bool

IsFocused returns whether the plugin is focused.

func (*Plugin) Name

func (p *Plugin) Name() string

Name returns the plugin display name.

func (*Plugin) PaneFocus added in v1.2.0

func (p *Plugin) PaneFocus() string

func (*Plugin) PaneFocusStops added in v1.2.0

func (p *Plugin) PaneFocusStops() []plugin.PaneFocusStop

PaneFocusStops projects Tasks' visible list/detail panes in rendered order. Prompt input and overlays own Tab, so the outer ring disappears while they are active instead of replaying or double-handling the key.

func (*Plugin) QuitKeyExits

func (p *Plugin) QuitKeyExits() bool

QuitKeyExits implements plugin.KeyRouter. In a Tasks root context `q` is sidecar's quit; inside a Tasks overlay it is the overlay's own dismissal, and BlocksGlobalKeys has already routed it there.

func (*Plugin) SetFocused

func (p *Plugin) SetFocused(f bool)

SetFocused sets the focus state.

func (*Plugin) SetPaneFocus added in v1.2.0

func (p *Plugin) SetPaneFocus(id string) tea.Cmd

SetPaneFocus delegates to Tasks' direct focus contract. Unknown, hidden, or input-owned stops are refused by the embedded model without mutation.

func (*Plugin) SetPaneFocusActive added in v1.2.0

func (p *Plugin) SetPaneFocusActive(active bool)

func (*Plugin) Start

func (p *Plugin) Start() tea.Cmd

Start begins plugin operation.

func (*Plugin) Stop

func (p *Plugin) Stop()

Stop closes the embedded model, which saves the sidecar session and shuts down the Tasks agent queue.

Close, not Discard: this is the model the host actually presented, so the view and filters the user left it on are exactly the state the next lifecycle should reload.

func (*Plugin) Update

func (p *Plugin) Update(msg tea.Msg) (plugin.Plugin, tea.Cmd)

Update handles messages by delegating to the embedded Tasks model.

func (*Plugin) View

func (p *Plugin) View(width, height int) string

View renders the plugin by delegating to the embedded Tasks model.

type TasksReadyMsg

type TasksReadyMsg struct {
	Epoch uint64
	// Generation is the plugin lifecycle this build belongs to. It makes
	// staleness structural instead of dependent on the host bumping Epoch.
	Generation uint64
	Model      *tasksui.Model
	Err        error
}

TasksReadyMsg carries the embedded Tasks model once it has been built.

func (TasksReadyMsg) GetEpoch

func (m TasksReadyMsg) GetEpoch() uint64

GetEpoch implements plugin.EpochMessage.

Jump to

Keyboard shortcuts

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