Documentation
¶
Overview ¶
SPDX-License-Identifier: MIT Purpose: sin-code todo hook — manage pre/post event shell commands.
SPDX-License-Identifier: MIT Purpose: todo event hooks — pre/post shell command execution, TOML config, timeout, env-var injection. Inspired by beads (gastownhall/beads).
Index ¶
- Variables
- func DefaultHooksPath() string
- func GenerateID() string
- func IsValidID(id string) bool
- type AuditEntry
- type CompactOptions
- type CompactResult
- type DepType
- type Dependency
- type Hook
- type HookConfig
- type HookContext
- type HookEvent
- type HookResult
- type ListFilter
- type Memory
- type Priority
- type Stats
- type Status
- type Store
- func (s *Store) Add(t *Todo) error
- func (s *Store) AddDep(dep Dependency) error
- func (s *Store) AddMemory(m *Memory) error
- func (s *Store) AppendAudit(e AuditEntry) error
- func (s *Store) Blocked() ([]*Todo, error)
- func (s *Store) BlockingDepsOf(id string) ([]Dependency, error)
- func (s *Store) ByProject(project string) ([]*Todo, error)
- func (s *Store) Close() error
- func (s *Store) Compact(opts CompactOptions) (*CompactResult, error)
- func (s *Store) ComputeStats() (*Stats, error)
- func (s *Store) CountAudit() (int, error)
- func (s *Store) DB() *bolt.DB
- func (s *Store) Delete(id string, hard bool) error
- func (s *Store) DependencyTree(root string, maxDepth int) (map[string][]Dependency, error)
- func (s *Store) Get(id string) (*Todo, error)
- func (s *Store) GetDeps(id string) ([]Dependency, error)
- func (s *Store) GetMeta(key string) (string, error)
- func (s *Store) GetReverseDeps(id string) ([]Dependency, error)
- func (s *Store) IndexKeys(bucketName, key string) ([]string, error)
- func (s *Store) List() ([]*Todo, error)
- func (s *Store) ListAudit(todoID string) ([]*AuditEntry, error)
- func (s *Store) ListFiltered(f ListFilter) ([]*Todo, error)
- func (s *Store) ListMemories() ([]*Memory, error)
- func (s *Store) Mine(assignee string) ([]*Todo, error)
- func (s *Store) Path() string
- func (s *Store) Ready() ([]*Todo, error)
- func (s *Store) RemoveDep(from, to string) error
- func (s *Store) Search(query string) ([]*Todo, error)
- func (s *Store) SetMeta(key, value string) error
- func (s *Store) Update(t *Todo) error
- type Todo
- type TodoType
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = errors.New("todo: not found") ErrInvalid = errors.New("todo: invalid argument") )
View Source
var TodoCmd = &cobra.Command{ Use: "todo", Short: "Issue tracker with dependencies, audit log, and project namespaces", Long: "todo is the SIN-Code issue tracker, matching the UX of `bd` and opencode's todo system. Backed by bbolt for durability, append-only audit log for history, and project namespaces for multi-repo work.\n\nCommon workflows:\n sin-code todo add --title \"...\" --priority P0 --type feature\n sin-code todo ready\n sin-code todo dep add st-1234 st-5678 --type blocks\n sin-code todo compact --older-than 30d", SilenceUsage: true, }
Functions ¶
func DefaultHooksPath ¶
func DefaultHooksPath() string
func GenerateID ¶
func GenerateID() string
Types ¶
type AuditEntry ¶
type CompactOptions ¶
type CompactResult ¶
type Dependency ¶
type Hook ¶
type HookConfig ¶
type HookConfig struct {
Hooks map[HookEvent][]Hook `toml:"hooks"`
// contains filtered or unexported fields
}
func LoadHooksConfig ¶
func LoadHooksConfig(path string) (*HookConfig, error)
func (*HookConfig) Fire ¶
func (c *HookConfig) Fire(ctx HookContext) []HookResult
func (*HookConfig) Get ¶
func (c *HookConfig) Get(event HookEvent) []Hook
func (*HookConfig) Path ¶
func (c *HookConfig) Path() string
type HookContext ¶
type HookEvent ¶
type HookEvent string
const ( EventPreAdd HookEvent = "pre_add" EventPostAdd HookEvent = "post_add" EventPreUpdate HookEvent = "pre_update" EventPostUpdate HookEvent = "post_update" EventPreClaim HookEvent = "pre_claim" EventPostClaim HookEvent = "post_claim" EventPreComplete HookEvent = "pre_complete" EventPostComplete HookEvent = "post_complete" EventPreCancel HookEvent = "pre_cancel" EventPostCancel HookEvent = "post_cancel" EventPreDelete HookEvent = "pre_delete" EventPostDelete HookEvent = "post_delete" EventPreDepAdd HookEvent = "pre_dep_add" EventPostDepAdd HookEvent = "post_dep_add" )
type HookResult ¶
type HookResult struct {
Hook Hook
Event HookEvent
Stdout string
Stderr string
Err error
Elapsed time.Duration
}
func (HookResult) OK ¶
func (r HookResult) OK() bool
type ListFilter ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) AddDep ¶
func (s *Store) AddDep(dep Dependency) error
func (*Store) AppendAudit ¶
func (s *Store) AppendAudit(e AuditEntry) error
func (*Store) BlockingDepsOf ¶
func (s *Store) BlockingDepsOf(id string) ([]Dependency, error)
func (*Store) Compact ¶
func (s *Store) Compact(opts CompactOptions) (*CompactResult, error)
func (*Store) ComputeStats ¶
func (*Store) CountAudit ¶
func (*Store) DependencyTree ¶
func (*Store) GetReverseDeps ¶
func (s *Store) GetReverseDeps(id string) ([]Dependency, error)
func (*Store) ListFiltered ¶
func (s *Store) ListFiltered(f ListFilter) ([]*Todo, error)
func (*Store) ListMemories ¶
type Todo ¶
type Todo struct {
ID string `json:"id"`
Title string `json:"title"`
Description string `json:"description,omitempty"`
Status Status `json:"status"`
Priority Priority `json:"priority"`
Type TodoType `json:"type"`
Tags []string `json:"tags,omitempty"`
Assignee string `json:"assignee,omitempty"`
Parent string `json:"parent,omitempty"`
ExternalRef string `json:"external_ref,omitempty"`
Project string `json:"project,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
ClosedAt *time.Time `json:"closed_at,omitempty"`
DueAt *time.Time `json:"due_at,omitempty"`
Estimate int `json:"estimate_minutes,omitempty"`
Notes string `json:"notes,omitempty"`
Compacted bool `json:"compacted,omitempty"`
Summary string `json:"summary,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.