Documentation
¶
Overview ¶
Package plaud ingests Plaud Note recordings into Dibs. It reads recordings through the official Plaud MCP server over stdio and submits each one as a private draft idea through the Dibs MCP endpoint (submit_idea).
Plaud's OAuth token stays in the Plaud MCP server's own store (~/.plaud/tokens-mcp.json); this package never reads or copies it.
Index ¶
Constants ¶
const ( // DefaultServer is the public Dibs origin. DefaultServer = ingest.DefaultServer // DefaultTags are attached to every ingested idea. DefaultTags = "plaud,voice-note" // EnvToken holds the hub bearer token (preferred over --token, which is // visible in the process list). EnvToken = ingest.EnvToken // EnvServer overrides the default --server. EnvServer = ingest.EnvServer // EnvMCPCommand overrides the default --mcp-command. EnvMCPCommand = "DIBS_PLAUD_MCP_COMMAND" // EnvHome overrides the default --home. EnvHome = "DIBS_PLAUD_HOME" )
const ( // DefaultSinceDays bounds how far back the first run looks. DefaultSinceDays = ingest.DefaultSinceDays // DefaultMaxPerHour and DefaultMaxPerDay match the intake budget per // identity (10/h, 30/24h). DefaultMaxPerHour = ingest.DefaultMaxPerHour DefaultMaxPerDay = ingest.DefaultMaxPerDay )
const DefaultCommand = "npx -y @plaud-ai/mcp@latest"
DefaultCommand launches the official (free) Plaud MCP server.
Variables ¶
var ErrRateLimited = ingest.ErrRateLimited
ErrRateLimited reports that Dibs (or a proxy in front of it) answered 429; the batch stops and resumes on the next run.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a minimal MCP client session: initialize handshake, then tools/call returning the text content.
func Dial ¶
Dial spawns command (split on whitespace; no shell quoting) and connects to it over stdin/stdout. The server's stderr is forwarded to stderr, which is how Plaud's sign-in URL reaches the user on the first run. The child gets an allowlisted environment (see ChildEnv), not the caller's: the server is a third-party package fetched from the registry on every start and has no use for the hub bearer token or anything else the caller's shell exports. A non-empty home becomes the child's $HOME, so the Plaud MCP server keeps its OAuth token store (~/.plaud) under that directory instead of the caller's home.
type Cursor ¶
Cursor is the persisted ingest state (see ingest.Cursor).
func LoadCursor ¶
LoadCursor reads path; a missing file is an empty cursor.
type Ingester ¶
type Ingester struct {
// Dial opens a Plaud MCP session; it is called once per run.
Dial func(ctx context.Context) (Tools, error)
Sink Sink
CursorPath string
Tags []string
SinceDays int
MaxPerHour int
MaxPerDay int
// MaxPerRun caps recordings handled in one run (0 = no cap).
MaxPerRun int
// DryRun builds and logs each idea without submitting it or advancing
// the cursor.
DryRun bool
Log *slog.Logger
Now func() time.Time
}
Ingester moves new Plaud recordings into Dibs. It is ingest.Ingester with a Plaud MCP session as the source.