MCPcopy Create free account

hub / github.com/Facets-cloud/flow / functions

Functions972 in github.com/Facets-cloud/flow

↓ 186 callersFunctionsetupFlowRoot
setupFlowRoot sets up a tempdir FLOW_ROOT and runs cmdInit to create the DB + tree. Returns the root path. Uses the init-test helper `initTempFlowRoot
internal/app/add_test.go:15
↓ 147 callersFunctionopenFlowDB
(t *testing.T)
internal/app/add_test.go:24
↓ 102 callersFunctionNowISO
---------- lifecycle ---------- NowISO returns the current time formatted as RFC3339.
internal/flowdb/db.go:213
↓ 89 callersMethodError
()
internal/app/owner_tick_test.go:823
↓ 79 callersFunctioncaptureStdout
captureStdout redirects os.Stdout and os.Stderr during f and returns combined output.
internal/app/show_test.go:50
↓ 76 callersFunctioninsertTask
(t *testing.T, db *sql.DB, slug, name, status, priority, wd string, project any)
internal/app/testhelpers_test.go:33
↓ 76 callersFunctionseedTask
seedTask creates a minimal task row (floating, workspace work_dir).
internal/app/do_test.go:79
↓ 75 callersFunctioncmdAdd
cmdAdd dispatches `flow add project|task|playbook ...`.
internal/app/add.go:28
↓ 72 callersFunctionGetTask
(db *sql.DB, slug string)
internal/flowdb/db.go:747
↓ 68 callersMethodString
()
internal/app/update.go:321
↓ 62 callersFunctionshowListEditDB
showListEditDB is the test harness used by cmd_show, cmd_list, and cmd_edit tests. It sets FLOW_ROOT, creates projects/ and tasks/ subtrees, opens flo
internal/app/show_test.go:32
↓ 58 callersFunctioncmdList
cmdList dispatches `flow list tasks|projects|playbooks|runs|tags|owners`.
internal/app/list.go:59
↓ 56 callersFunctioncmdDo
cmdDo flips a task to in-progress, bootstraps a Claude session if needed (race-free via atomic UPDATE ... WHERE session_id IS ?), and spawns an iTerm
internal/app/do.go:96
↓ 55 callersFunctionOpenDB
OpenDB opens (or creates) the SQLite database at path, ensures the schema is present, and runs idempotent migrations. The connection is opened with b
internal/flowdb/db.go:234
↓ 50 callersFunctionCreateOwner
CreateOwner inserts a new owner. Status defaults to 'active' and timestamps are stamped if unset. NextWakeAt is left as-is (NULL until the owner is st
internal/flowdb/owners.go:63
↓ 48 callersFunctionstubITerm
stubITerm replaces iterm.Runner with a counter + captured-script recorder. Returns the counter pointer and a function that reads the most recent Apple
internal/app/do_test.go:48
↓ 44 callersFunctioncmdUpdate
cmdUpdate dispatches `flow update task|project`. The command is the canonical lane for in-place field edits — including legacy field setters (priority
internal/app/update.go:17
↓ 38 callersFunctionGetOwner
(db *sql.DB, slug string)
internal/flowdb/owners.go:85
↓ 37 callersFunctionflagSet
flagSet creates a named flag.FlagSet that prints errors instead of exiting.
internal/app/helpers.go:12
↓ 35 callersFunctioncmdOwner
cmdOwner dispatches `flow owner list|show|start|pause`.
internal/app/owner.go:30
↓ 35 callersFunctioncmdShow
cmdShow dispatches `flow show task|project|playbook|owner`. Per spec §5.4.
internal/app/show.go:16
↓ 35 callersFunctionflowDBPath
flowDBPath returns the absolute path to flow.db under the flow root. Returns a clear error if the data directory hasn't been initialized.
internal/app/init.go:27
↓ 28 callersMethodName
Identity --------------------------------------------------------- Name returns the canonical short id (stored on tasks.harness).
internal/harness/harness.go:122
↓ 24 callersFunctionflowRoot
flowRoot returns the root directory for flow state. Honors $FLOW_ROOT if set, otherwise falls back to ~/.flow. The returned path is not guaranteed to
internal/app/init.go:14
↓ 23 callersFunctionNew
New returns a fresh claude harness. The struct is stateless; we expose it through the harness.Harness interface.
internal/harness/claude/claude.go:47
↓ 23 callersMethodWrap
Wrap returns text decorated with the given ANSI code. When color is disabled or code is empty, the input is returned unchanged.
internal/listfmt/listfmt.go:112
↓ 23 callersFunctioncmdSkill
cmdSkill dispatches `flow skill install|uninstall|update`.
internal/app/skill.go:97
↓ 20 callersFunctioninsertProject
(t *testing.T, db *sql.DB, slug, name, wd, priority string)
internal/app/testhelpers_test.go:23
↓ 19 callersFunctionopenTempDB
(t *testing.T)
internal/flowdb/db_test.go:10
↓ 18 callersFunctionUpsertPlaybook
UpsertPlaybook inserts a new playbook or updates an existing row by slug. Updates touch name, project_slug, work_dir, updated_at; archived_at is not t
internal/flowdb/db.go:1083
↓ 16 callersFunctioncmdRun
cmdRun handles `flow run <subcommand>`. Currently only `run playbook <slug>` is supported.
internal/app/run.go:16
↓ 16 callersFunctionsetupArchiveTestEnv
setupArchiveTestEnv creates a tempdir, sets FLOW_ROOT, initializes flow.db, and returns the opened handle. The db handle is closed on cleanup. We inte
internal/app/archive_test.go:16
↓ 16 callersFunctionwithTempHome
withTempHome redirects $HOME to a tempdir for the duration of the test.
internal/app/skill_test.go:62
↓ 15 callersFunctioncmdInit
cmdInit creates ~/.flow/ (or $FLOW_ROOT), initializes flow.db, installs the skill. Idempotent — re-running is safe.
internal/app/init.go:41
↓ 15 callersFunctioncolumnExists
(db *sql.DB, table, column string)
internal/flowdb/db.go:657
↓ 15 callersFunctionstubRunnerOutput
(t *testing.T, fn func([]string) ([]byte, error))
internal/kitty/kitty_test.go:155
↓ 14 callersFunctioncaptureShowStdout
(t *testing.T, fn func())
internal/app/show_test.go:662
↓ 14 callersFunctioncmdWorkdir
cmdWorkdir dispatches `flow workdir list|add|remove|scan`.
internal/app/workdir.go:18
↓ 13 callersFunctionGetProject
(db *sql.DB, slug string)
internal/flowdb/db.go:691
↓ 13 callersFunctioncmdDone
cmdDone marks a task done. Per spec §5.3 this is a single UPDATE that does NOT touch the iTerm tab, kill the Claude session, or clear session_id — the
internal/app/done.go:28
↓ 13 callersFunctionfakeSessionID
fakeSessionID makes a deterministic v4-shaped UUID derived from slug. Used by insertTask to satisfy the session-id invariant on non-backlog rows witho
internal/app/testhelpers_test.go:59
↓ 12 callersFunctionSpawnTab
SpawnTab opens a new Warp tab in cwd via the warp:// URI, then injects `command` (with envVars set, title set, and cwd entered) by keystroking the pat
internal/warp/warp.go:99
↓ 12 callersFunctioncmdArchive
cmdArchive sets archived_at = now() on the matching row.
internal/app/archive.go:10
↓ 11 callersFunctionFocusSession
FocusSession tries to focus the kitty window currently running `binary` with the given session UUID. The `binary` arg is the harness's executable name
internal/kitty/kitty.go:124
↓ 11 callersMethodSessionIDEnvVar
SessionIDEnvVar returns the env var the harness exports inside each running session so flow can reverse-lookup the bound task (e.g. "CLAUDE_CODE_SESSI
internal/harness/harness.go:133
↓ 11 callersFunctioncmdEdit
cmdEdit opens a brief.md in $EDITOR for either a task or a project. Per spec §5.5. Bumps updated_at after a clean editor exit.
internal/app/edit.go:15
↓ 11 callersFunctionhexColor
hexColor parses "#RRGGBB" into an opaque color.
internal/app/card_png.go:280
↓ 11 callersFunctionnewWarpStubs
(t *testing.T)
internal/warp/warp_test.go:25
↓ 11 callersFunctionreopenArchiveTestDB
(t *testing.T, root string)
internal/app/archive_test.go:32
↓ 10 callersFunctionEncodeCwd
---------- transcript ---------- RenderTranscript and the jsonl decoder it uses live in transcript.go in this package. EncodeCwd encodes an absolute
internal/harness/claude/claude.go:265
↓ 10 callersFunctionFocusSession
FocusSession tries to focus the zellij pane currently running `binary` with the given session UUID. The `binary` arg is the harness's executable name
internal/zellij/zellij.go:104
↓ 10 callersFunctionFocusSession
FocusSession tries to focus the iTerm2 session whose underlying process is `binary` running with `--session-id <sessionID>` or `--resume <sessionID>`
internal/iterm/iterm.go:100
↓ 10 callersFunctionGetWorkdir
(db *sql.DB, path string)
internal/flowdb/db.go:845
↓ 10 callersFunctionmustWriteAux
(t *testing.T, path, content string)
internal/app/aux_test.go:69
↓ 9 callersFunctionAddTaskTag
AddTaskTag attaches a tag to a task. Idempotent: re-adding an existing (task_slug, tag) pair is a no-op via INSERT OR IGNORE.
internal/flowdb/db.go:964
↓ 9 callersFunctionDefaultConstants
DefaultConstants are the shipped defaults.
internal/stats/model.go:18
↓ 9 callersFunctionDetect
Detect returns the backend that SpawnTab will use for the current process environment. Exposed so callers (and tests) can inspect the choice without s
internal/spawner/spawner.go:73
↓ 9 callersFunctionListTasks
(db *sql.DB, filter TaskFilter)
internal/flowdb/db.go:765
↓ 9 callersFunctionallHarnesses
allHarnesses returns every implemented harness adapter. The slice is the registry that ambient-harness detection and harnessByName consult. Adding cod
internal/app/harness.go:17
↓ 9 callersFunctionbgAgentsJSON
bgAgentsJSON builds a `claude agents --json` array of LIVE entries (pid set) — one per session id (short id = first 8 chars).
internal/app/background_test.go:46
↓ 8 callersFunctionResolvePlaybook
ResolvePlaybook resolves a ref to exactly one playbook by slug. includeArchived controls whether archived rows are eligible.
internal/app/resolve.go:58
↓ 8 callersFunctionSlugify
Slugify converts a free-form name into a URL-safe slug. It lowercases, replaces runs of non-alphanumeric chars with dashes, strips leading/trailing da
internal/app/slug.go:20
↓ 8 callersFunctionSpawnTab
SpawnTab opens a tab in the auto-detected backend. The contract matches every backend's SpawnTab.
internal/spawner/spawner.go:106
↓ 8 callersMethodTotal
Total is all tokens flow-managed sessions actually processed.
internal/stats/scan.go:39
↓ 8 callersFunctionUpsertWorkdir
(db *sql.DB, path, name, description, gitRemote string)
internal/flowdb/db.go:868
↓ 8 callersFunctioncontains
---- tiny helpers ----
internal/harness/claude/background_test.go:270
↓ 8 callersFunctioninitTempFlowRoot
initTempFlowRoot points FLOW_ROOT at a tempdir AND redirects $HOME so skill install lands inside the tempdir as well. Isolates every init test from th
internal/app/init_test.go:15
↓ 8 callersFunctionstubClaudeRunner
(t *testing.T, retErr error)
internal/app/done_test.go:19
↓ 8 callersFunctionstubPS
(t *testing.T, out string, retErr error)
internal/iterm/iterm_test.go:202
↓ 8 callersFunctionstubRunnerOutput
(t *testing.T, fn func([]string) ([]byte, error))
internal/zellij/zellij_test.go:312
↓ 8 callersFunctionwithFakeHTTP
withFakeHTTP swaps httpGetForVersion for the duration of the test.
internal/app/release_test.go:24
↓ 7 callersFunctionColorEnabled
ColorEnabled reports whether ANSI color codes should be emitted to w. Color is disabled when forceOff is true, when the NO_COLOR env var is set (per h
internal/listfmt/listfmt.go:91
↓ 7 callersFunctionDueOwners
DueOwners returns active, non-archived owners whose next_wake_at is set and at or before nowISO — i.e. the owners the scheduler should tick now. Pause
internal/flowdb/owners.go:232
↓ 7 callersFunctionFocusSession
FocusSession tries to focus the Terminal.app tab whose underlying process is `binary` running with `--session-id <sessionID>` or `--resume <sessionID>
internal/terminal/terminal.go:181
↓ 7 callersFunctionGetPlaybook
(db *sql.DB, slug string)
internal/flowdb/db.go:917
↓ 7 callersFunctionGetTaskTags
GetTaskTags returns the tags on a single task, sorted alphabetically.
internal/flowdb/db.go:1003
↓ 7 callersFunctionLoadCache
LoadCache reads a cache file. A missing or corrupt file yields an empty (usable) cache — never an error. Stats must never fail on a bad cache.
internal/stats/cache.go:22
↓ 7 callersMethodRender
Render writes the table to w. Trailing whitespace is trimmed from every emitted line so an empty last cell doesn't litter output with spaces.
internal/listfmt/listfmt.go:132
↓ 7 callersFunctionRenderTSV
RenderTSV emits a tab-separated values stream with a header row.
internal/listfmt/listfmt.go:194
↓ 7 callersFunctionResolveTask
---------- exact-match resolvers ---------- All ref resolution is exact match on slug (case-insensitive). ResolveTask resolves a ref to exactly one t
internal/app/resolve.go:17
↓ 7 callersFunctioncmdDoHere
cmdDoHere is the `--here` branch of `flow do`. Instead of spawning a new tab with a fresh Claude session, it binds the CURRENT Claude session (discove
internal/app/do.go:870
↓ 7 callersFunctioncmdOwnerTick
cmdOwnerTick is the hidden `flow __owner-tick <slug>` supervisor that runs inside the detached process: build the tick prompt, run the owner's harness
internal/app/owner_tick.go:281
↓ 7 callersFunctiondefaultHarness
defaultHarness returns the adapter for code paths that have no task context (e.g. `flow init`, `flow skill install`, the SessionStart hook handler bef
internal/app/harness.go:130
↓ 7 callersFunctionharnessForTask
harnessForTask returns the adapter for the task's stored harness. NULL/empty harness column → claude+nil (back-compat). Unknown non-empty name → nil+e
internal/app/harness.go:70
↓ 7 callersFunctionhumanCompact
humanCompact formats large numbers with B/M/K suffix for compact display. ≥1B → "X.XXB"; ≥1M → "X.XXM"; ≥1K → "XK" or "X.XK"; else plain integer.
internal/app/stats.go:187
↓ 7 callersFunctionnewFace
(f *truetype.Font, size float64)
internal/app/card_png.go:85
↓ 7 callersFunctionseedTaskAtCwd
seedTaskAtCwd creates a task with work_dir set to the test process's current cwd. Used by --here tests that want to satisfy the cwd-mismatch invariant
internal/app/do_test.go:89
↓ 7 callersFunctionstubBG
stubBG installs a BGCommandRunner that dispatches on args[0]: spawn / resume calls get the banner (and are recorded), `agents` calls get the JSON. Ret
internal/harness/claude/background_test.go:119
↓ 7 callersFunctionstubBGCommand
stubBGCommand swaps claude.BGCommandRunner with a recorder that dispatches on args: `agents` returns *agentsJSON (mutable so a test can change registr
internal/app/background_test.go:103
↓ 7 callersFunctionstubBGMode
stubBGMode forces spawner.IsBackground() true for the test.
internal/app/background_test.go:79
↓ 7 callersFunctionstubClaudeStatOK
stubClaudeStatOK makes claude.ValidateSession succeed for every (workDir, sessionID) pair, for tests that don't materialize fake jsonl files under a t
internal/app/do_test.go:104
↓ 7 callersFunctionstubRunnerOutput
(t *testing.T, fn func([]string) ([]byte, error))
internal/iterm/iterm_test.go:211
↓ 7 callersFunctionwithFlowRoot
withFlowRoot points $FLOW_ROOT at a tempdir so version-cache writes don't touch the developer's real ~/.flow.
internal/app/release_test.go:33
↓ 6 callersFunctionIsBackground
IsBackground reports whether flow should spawn this session as a terminal-free background agent ($FLOW_TERM=bg) rather than opening a terminal tab. bg
internal/spawner/spawner.go:63
↓ 6 callersFunctionLatestRelease
LatestRelease returns the latest tagged version of flow on GitHub as a tag string (e.g. "v0.1.0-alpha.3"), or "" if the lookup cannot be completed (of
internal/app/release.go:53
↓ 6 callersFunctionListOwners
ListOwners returns owners matching filter, sorted by slug. Archived owners are excluded unless IncludeArchived is set.
internal/flowdb/owners.go:275
↓ 6 callersMethodLiveSessionIDs
Live-session detection ------------------------------------------- LiveSessionIDs returns the count of running processes per session id. Used both for
internal/harness/harness.go:217
↓ 6 callersFunctionNormalizeTag
---------- task tag queries ---------- NormalizeTag canonicalizes a tag for storage and comparison: trim whitespace, lowercase. Returns "" for input t
internal/flowdb/db.go:958
↓ 6 callersFunctionParseFormat
ParseFormat converts a user-supplied string into a Format. Empty string and "table" both yield FormatTable; "json" and "tsv" are the other accepted va
internal/listfmt/listfmt.go:63
↓ 6 callersFunctionResolveProject
ResolveProject resolves a ref to exactly one project by slug.
internal/app/resolve.go:37
next →1–100 of 972, ranked by callers