Documentation
¶
Overview ¶
Package activity writes the journal of the accounts (domain.Activity): what each did, on which item, from which client. The processes a client calls write it in their own transaction; the server's rounds and the admin's commands have no source and write nothing.
Index ¶
- Constants
- func Edited(ctx context.Context, db bun.IDB, itemID, title string) error
- func Quiet(ctx context.Context) context.Context
- func Source(ctx context.Context) string
- func WithSource(ctx context.Context, source string) context.Context
- func Write(ctx context.Context, db bun.IDB, entries ...Entry) error
- type Entry
Constants ¶
const ( App = "app" CLI = "cli" MCP = "mcp" API = "api" )
The clients an entry comes from: the web app's session, the CLI's login (tide and tide mcp), an OAuth connection (the MCP over HTTP), or an API token (a script, or an agent given one).
const ( Create = "create" Edit = "edit" Rename = "rename" Move = "move" Delete = "delete" Restore = "restore" EmptyTrash = "empty_trash" Import = "import" Replace = "replace" Login = "login" TokenCreated = "token_created" TokenDeleted = "token_deleted" )
The kinds of an entry.
const EditPause = 30 * time.Minute
EditPause ends an edit's entry: the saves of a note from one client, each less than EditPause after the last, are one entry, else autosave would write one per keystroke pause.
const Header = "Tide-Client"
Header tells the API a request comes from an MCP server (tide mcp, the MCP over HTTP), not the CLI or a script.
Variables ¶
This section is empty.
Functions ¶
func Edited ¶
Edited notes a save of the note itemID, now titled title: it moves the entry of the same note and client saved less than EditPause ago to now, or adds one.
func Quiet ¶
Quiet is ctx for a process nested in another that writes its own entry: an import does not write each note it creates.
func WithSource ¶
WithSource gives ctx the client its request comes from: the processes it runs write their entries from it.