MCPcopy Create free account

hub / github.com/PerpetualSoftware/pad / functions

Functions6,412 in github.com/PerpetualSoftware/pad

↓ 3 callersFunctionFieldKeysForKind
FieldKeysForKind returns the frontmatter field keys for the given kind, or ErrUnknownKind if the kind is not recognized. A later phase's server code c
internal/artifact/artifact.go:64
↓ 3 callersMethodGet
Get / Stat / Delete are convenience helpers that resolve the key first.
internal/attachments/registry.go:63
↓ 3 callersMethodGetAccessTokenSession
GetAccessTokenSession hydrates an access token. Inactive rows surface as fosite.ErrInactiveToken so the introspection / authorization-bearer middlewar
internal/oauth/storage.go:247
↓ 3 callersMethodGetAllItemProgress
GetAllItemProgress returns child item completion counts for every item in the given collection within a workspace. includeArchived controls whether s
internal/store/items.go:3642
↓ 3 callersMethodGetBillingMetrics
GetBillingMetrics asks pad-cloud for an aggregated Stripe-derived snapshot (active subs, MRR, ARR, churn, cancellations). Auth is the same shared Clou
internal/billing/cloud_client.go:144
↓ 3 callersMethodGetBlocksEdges
GetBlocksEdges returns every `blocks` link in the workspace whose source and target items are both live (non-deleted), newest link first. The created_
internal/store/items.go:4067
↓ 3 callersMethodGetCLIAuthSession
GetCLIAuthSession retrieves a CLI auth session by code. Returns nil if not found. Expired sessions are returned with status updated to "expired".
internal/store/cli_auth_sessions.go:82
↓ 3 callersMethodGetCollectionAnyState
GetCollectionAnyState is GetCollection without the `deleted_at IS NULL` filter — used by the open-children guard (IDEA-1494 R3 P3) so a child still at
internal/store/collections.go:126
↓ 3 callersMethodGetCollectionGrant
GetCollectionGrant retrieves a collection grant by ID.
internal/store/grants.go:29
↓ 3 callersMethodGetCurrentUser
GetCurrentUser returns the authenticated user's profile.
internal/cli/client.go:1016
↓ 3 callersMethodGetInvitation
GetInvitation retrieves an invitation by ID.
internal/store/workspace_members.go:660
↓ 3 callersMethodGetItem
(wsSlug, itemSlug string)
internal/cli/client.go:238
↓ 3 callersMethodGetItemByRef
GetItemByRef looks up an item by its PREFIX-NUMBER reference (e.g. "IDEA-15"). Since item numbers are workspace-unique, this first tries an exact pref
internal/store/items.go:464
↓ 3 callersMethodGetItemBySlug
(workspaceID, slug string)
internal/store/items.go:444
↓ 3 callersMethodGetItemGrant
GetItemGrant retrieves an item grant by ID.
internal/store/grants.go:117
↓ 3 callersMethodGetItemsByIDsIncludeDeleted
GetItemsByIDsIncludeDeleted fetches items (soft-deleted included) for the given IDs in ONE `WHERE id IN (...)` query, keyed by item ID. It replaces th
internal/store/items.go:715
↓ 3 callersFunctionGetLibraryConvention
GetLibraryConvention finds a convention in the library by its title. Returns nil if no convention with the given title exists.
internal/collections/convention_library.go:210
↓ 3 callersFunctionGetLibraryPlaybook
GetLibraryPlaybook finds a playbook in the library by its title. Returns nil if no playbook with the given title exists.
internal/collections/playbook_library.go:80
↓ 3 callersMethodGetPKCERequest
GetPKCERequest hydrates the PKCE session. Returns ErrOAuthNotFound if the row is missing.
internal/store/oauth.go:531
↓ 3 callersMethodGetParentMap
GetParentMap returns a map of item ID -> parent item ID for all parent links in a workspace. Used for efficient batch lookups (e.g., dashboard, list e
internal/store/items.go:3317
↓ 3 callersMethodGetReportLayout
Per-user Insights/report layout preferences (PLAN-1628 / TASK-1634). GetReportLayout returns the user's saved layout for a workspace, or nil when they
internal/store/report_layouts.go:15
↓ 3 callersMethodGetUserMetrics
GetUserMetrics computes the AdminUserMetrics bundle. Cheap by design: - days_since_write reads users.last_write_at directly (one row) - writes_7d is a
internal/store/users.go:774
↓ 3 callersMethodGetUserWorkspaceMemberships
GetUserWorkspaceMemberships returns workspace memberships for admin user detail.
internal/store/workspace_members.go:1104
↓ 3 callersMethodHasPassword
HasPassword returns true if the user has explicitly set a password that they can sign in with. OAuth-only users have a random placeholder hash stored
internal/models/user.go:72
↓ 3 callersMethodImportArtifact
ImportArtifact POSTs the raw artifact bytes to the workspace import endpoint (POST /workspaces/{ws}/import-artifact) and decodes the {ref, slug, warni
internal/cli/client.go:741
↓ 3 callersMethodInvalidateAuthorizationCode
InvalidateAuthorizationCode marks a code inactive (single-use). Idempotent: invalidating an already-invalid or missing row is a no-op (fosite's contra
internal/store/oauth.go:287
↓ 3 callersMethodIsCloudServer
IsCloudServer reports whether THIS server process should run in cloud-tenant mode (enabling cloud-specific endpoints, requiring PAD_CLOUD_SECRET, wiri
internal/config/config.go:320
↓ 3 callersMethodItemLastRestoreSeq
ItemLastRestoreSeq returns the DURABLE per-item restore boundary (items.last_restore_seq) — the item.seq of the most recent version restore (BUG-2264)
internal/collab/room.go:274
↓ 3 callersMethodItemRestoreBoundaryOpID
ItemRestoreBoundaryOpID returns items.restore_boundary_op_id — the DURABLE op-log-id restore boundary (BUG-2264), or (0, false) when the item has neve
internal/store/yjs_updates.go:298
↓ 3 callersMethodJSONArrayContains
JSONArrayContains returns SQL + the arg to check if a JSON array column contains a given text value. SQLite: "column LIKE ?" with arg `%"value"%` Post
internal/store/dialect.go:105
↓ 3 callersMethodListMovedOutSince
ListMovedOutSince finds items that the main /items-changes delta drops because they moved OUT of the caller's visible scope: their CURRENT collection
internal/store/items.go:1376
↓ 3 callersMethodListUserGrants
--- Cross-cutting queries --- ListUserGrants returns all collection and item grants for a user in a workspace.
internal/store/grants.go:189
↓ 3 callersMethodListUsers
ListUsers returns all users.
internal/store/users.go:243
↓ 3 callersMethodListVersionsResolved
ListVersionsResolved returns versions with full content (diffs resolved). Requires the current document content to reconstruct diff-based versions.
internal/store/versions.go:102
↓ 3 callersFunctionLoadRegistry
LoadRegistry reads the installation registry from disk. Returns an empty registry if the file doesn't exist.
internal/cli/registry.go:44
↓ 3 callersMethodMCP
MCP returns the underlying mark3labs MCPServer. Use this to register tools / resources / prompts BEFORE Run() takes over the stdio transport — registr
internal/mcp/server.go:80
↓ 3 callersMethodMCPConnectionStatsForUser
MCPConnectionStatsForUser returns last-used + 30-day-count keyed by (token_kind, token_ref) for every connection the user has any audit-log activity f
internal/store/mcp_audit.go:204
↓ 3 callersFunctionMCPConnectionStatsKey
MCPConnectionStatsKey is the exported wrapper for callers in other packages (notably internal/server/handlers_connected_apps.go in TASK-954) that need
internal/store/mcp_audit.go:265
↓ 3 callersFunctionMCPPropertyName
MCPPropertyName converts a CLI flag or argument name to the snake_case form used inside the dispatch input map. Hyphens become underscores; everything
internal/mcp/registry.go:110
↓ 3 callersMethodManagesLocalServer
ManagesLocalServer reports whether this client configuration should auto-manage a local Pad server process.
internal/config/config.go:283
↓ 3 callersMethodMarkStripeEventProcessed
MarkStripeEventProcessed records a Stripe webhook event ID in stripe_processed_events if it hasn't been seen before. Returns alreadyProcessed=true whe
internal/store/stripe_events.go:27
↓ 3 callersMethodMaxOpLogID
MaxOpLogID is consulted ONLY by ForceRefreshRoom (BUG-2264), which reads it under the per-item lock WITH appendMu held (inbound persistence frozen) to
internal/collab/room.go:267
↓ 3 callersMethodMaxOpLogIDTx
MaxOpLogIDTx is the in-transaction variant of MaxOpLogID. Version-restore (BUG-2264) reads the pre-prune MAX inside the SAME tx as the op-log wipe + c
internal/store/yjs_updates.go:501
↓ 3 callersMethodMinOpLogID
MinOpLogID powers the resume-cursor / force-refresh check (TASK-1319): when a reconnecting client announces `?since=<id>` and that id is below MIN, ro
internal/collab/room.go:260
↓ 3 callersMethodMoveItemWithPreCheck
MoveItemWithPreCheck is MoveItem with the same precheck escape hatch UpdateItemWithPreCheck offers. Codex round-3 P1: a `pad item move ... --field sta
internal/store/items.go:4163
↓ 3 callersFunctionNewSharedWorkspaceState
NewSharedWorkspaceState returns a state for a multi-user process (the cloud /mcp transport). It records Set/Get like any other state, but ResolveDefau
internal/mcp/workspace.go:66
↓ 3 callersFunctionNewWithReplay
NewWithReplay creates a new in-memory EventBus with custom replay settings.
internal/events/bus.go:256
↓ 3 callersFunctionParseAttachmentHref
ParseAttachmentHref returns the UUID portion of a `pad-attachment:UUID` reference, or "" if href is not a pad-attachment reference / has an empty UUID
internal/server/render/attachments.go:53
↓ 3 callersFunctionParsePlaybookCLIArgs
ParsePlaybookCLIArgs splits a sequence of positional args + bareword flags + key=value pairs into a typed map matching the playbook's declared spec. E
internal/server/handlers_playbooks.go:424
↓ 3 callersFunctionPlaybookSummary
PlaybookSummary extracts a short prose hint from a playbook body. Picks the first non-heading non-empty paragraph and caps at ~240 chars so summary pa
internal/collections/summary.go:12
↓ 3 callersMethodPostRaw
PostRaw sends raw bytes to the API and decodes the JSON response.
internal/cli/client.go:838
↓ 3 callersMethodPruneAndApply
PruneAndApply runs applyFn under the per-item setup lock so it is strictly serialised with any in-flight Join's addConn+replayTo for the same itemID.
internal/collab/manager.go:943
↓ 3 callersMethodPruneItemOpLogTx
PruneItemOpLogTx deletes an item's ENTIRE op-log inside the caller's transaction. Used by version-restore (BUG-2264): the restore's canonical items.co
internal/store/yjs_updates.go:538
↓ 3 callersMethodPruneYjsUpdatesBefore
PruneYjsUpdatesBefore deletes every row for itemID whose CreatedAt is strictly less than the cutoff. The schema-mismatch rebuild path passes a far-fut
internal/collab/manager_test.go:126
↓ 3 callersMethodPublish
Publish fans an event out to every subscriber whose itemID matches. Non-blocking: a slow subscriber whose buffer is full has new events dropped (logg
internal/collab/memory_bus.go:113
↓ 3 callersMethodPurgeWorkspaceData
PurgeWorkspaceData hard-deletes every child row of a soft-deleted workspace and the workspace row itself, in a single transaction. Blob bytes are NOT
internal/store/workspace_purge.go:221
↓ 3 callersFunctionReadBootstrapToken
ReadBootstrapToken reads <DataDir>/.bootstrap-token. The file is created by EnsureBootstrapToken in internal/server/bootstrap.go with mode 0600 and co
internal/cli/bootstrap.go:197
↓ 3 callersFunctionRegister
Register installs pad's MCP tools on srv: the built-in pad_set_workspace plus every v0.2 catalog tool. Returns the count of registered tools (includin
internal/mcp/registry.go:68
↓ 3 callersMethodRegister
Register creates a new user account.
internal/cli/client.go:933
↓ 3 callersFunctionRegisterCatalog
RegisterCatalog installs the v0.2 catalog tools on srv. Returns the count of tools registered (excluding pad_set_workspace, which the cmdhelp-walk pat
internal/mcp/catalog.go:215
↓ 3 callersMethodRegisterOAuthActiveTokensCollector
RegisterOAuthActiveTokensCollector exposes pad_oauth_active_tokens as a callback-driven gauge. Pulled on every scrape — same pattern as the db-stats c
internal/metrics/metrics.go:317
↓ 3 callersMethodRemoveConnectionWorkspace
RemoveConnectionWorkspace deletes one (request_id, workspace_id) row. Idempotent: removing a pair that isn't present is a no-op (no error). Phase D's
internal/store/oauth_connections.go:334
↓ 3 callersMethodRenameConnection
RenameConnection updates the human-readable name. Touches updated_at. Returns ErrOAuthConnectionNotFound if the row doesn't exist. Trim is the caller
internal/store/oauth_connections.go:246
↓ 3 callersMethodResolveBacklinksVisibility
ResolveBacklinksVisibility computes the (fullCollectionIDs, grantedItemIDs) access vectors for `userID` in `workspaceID`, REQUEST-INDEPENDENT. Mirrors
internal/store/backlinks_visibility.go:59
↓ 3 callersMethodResolveDefault
ResolveDefault returns the workspace to inject into a dispatched call that didn't carry an explicit `workspace` — or "" when this state must not be tr
internal/mcp/workspace.go:99
↓ 3 callersMethodResolvePath
ResolvePath returns the config path for the given agent using the installer's home/cwd + goos overrides. CWDBased agents (Claude Code) resolve against
internal/mcp/install.go:622
↓ 3 callersMethodRestoreWorkspace
RestoreWorkspace un-soft-deletes a workspace: it clears deleted_at so the workspace (and every item/collection/member/attachment that was only transit
internal/store/workspaces.go:282
↓ 3 callersFunctionRewriteBracketAt
RewriteBracketAt rewrites the wiki-link bracket starting at byte position `position` in `content`, replacing the bracket's title segment with `newTitl
internal/links/links.go:113
↓ 3 callersMethodRotate
Rotate returns a new image rotated by deg degrees clockwise. Only multiples of 90 (90, 180, 270, plus their negatives) are supported in Phase 1 — that
internal/attachments/processor.go:48
↓ 3 callersMethodRunStdio
RunStdio is Run with explicit stdin / stdout streams. Used by tests that drive the server in-process via io.Pipe. The same shutdown semantics as Run
internal/mcp/server.go:97
↓ 3 callersMethodSave
Save writes the registry to disk.
internal/cli/registry.go:67
↓ 3 callersMethodSaveReportLayout
SaveReportLayout upserts the user's layout for a workspace. The caller is responsible for sanitizing the layout (see server handler) before saving.
internal/store/report_layouts.go:40
↓ 3 callersMethodSearchUsers
SearchUsers returns a filtered, paginated list of users for admin management. Each row carries the User model plus two cheap aggregations the admin t
internal/store/users.go:378
↓ 3 callersMethodSendEmailVerification
SendEmailVerification sends an email-verification link to a newly registered user. Mirrors SendPasswordReset (buildHTMLShell/buildPlainShell, CloudMod
internal/email/templates.go:151
↓ 3 callersMethodSendInvitation
SendInvitation sends a workspace invitation email. If unsubscribeURL is non-empty, an unsubscribe link is included in the footer.
internal/email/templates.go:11
↓ 3 callersFunctionSetBcryptCostForTesting
SetBcryptCostForTesting overrides the bcrypt cost used by CreateUser and UpdateUser for the lifetime of a test binary. It returns a restore function —
internal/store/testing_helpers.go:19
↓ 3 callersMethodSetCollabRoomManager
SetCollabRoomManager attaches a Yjs collab RoomManager (PLAN-1248). When set, the /api/v1/collab/{itemID} WebSocket endpoint hands new connections to
internal/server/server.go:685
↓ 3 callersMethodSetImageProcessor
SetImageProcessor wires the image processor that the upload handler uses to derive thumbnail variants (TASK-878). Optional — without it uploads still
internal/server/server.go:742
↓ 3 callersMethodSetRevocationObserver
SetRevocationObserver wires a callback that fires after each access-token family revocation. Optional — leaving it unset is equivalent to wiring a no-
internal/oauth/storage.go:82
↓ 3 callersMethodSetScopeFlags
SetScopeFlags updates the three boolean scope flags atomically. All three values are written every call — there's no PATCH semantic at the store layer
internal/store/oauth_connections.go:269
↓ 3 callersFunctionSniffMIME
SniffMIME detects the MIME type from the leading bytes of a payload using net/http's stdlib detector (the same RFC 6838 algorithm browsers use). The r
internal/attachments/mime.go:172
↓ 3 callersMethodStampRestoreBoundaryOpIDTx
StampRestoreBoundaryOpIDTx sets items.restore_boundary_op_id INSIDE the caller's transaction (BUG-2264) — the DURABLE counterpart of the in-memory Roo
internal/store/yjs_updates.go:263
↓ 3 callersMethodStat
(ctx context.Context, key string)
internal/attachments/registry.go:71
↓ 3 callersMethodSubscribe
Subscribe delegates to the inner bus and increments the SSE connection gauge.
internal/metrics/instrumented_bus.go:31
↓ 3 callersFunctionTerminalPlaceholdersForDoneField
TerminalPlaceholdersForDoneField is a SQL-layer convenience that returns the done-field key plus the placeholder + args pair needed for an IN clause.
internal/models/terminal.go:96
↓ 3 callersFunctionThumbnailExt
ThumbnailExt returns the file extension for a thumbnail encoded in `format`. Used to build a synthetic filename for the derived row (parent's basename
internal/attachments/processor.go:156
↓ 3 callersFunctionThumbnailFormat
Format-policy helpers — shared between the pure-Go and libvips backends. These are intentionally NOT inside a build-tagged file so they compile under
internal/attachments/processor.go:132
↓ 3 callersFunctionThumbnailMime
ThumbnailMime returns the canonical MIME type for a thumbnail encoded in `format` (paired with ThumbnailFormat above).
internal/attachments/processor.go:141
↓ 3 callersFunctionToItemSummaries
ToItemSummaries projects a slice of items into summary shape, preserving order. A nil input yields a non-nil empty slice so the JSON encodes as `[]`.
internal/cli/item_summary.go:120
↓ 3 callersFunctionToolSkillPath
ToolSkillPath returns the full path where a tool's skill file would be installed.
internal/cli/agents.go:144
↓ 3 callersMethodUnsubscribe
Unsubscribe delegates to the inner bus and decrements the SSE connection gauge.
internal/metrics/instrumented_bus.go:61
↓ 3 callersMethodUpdateView
UpdateView modifies an existing view.
internal/store/views.go:137
↓ 3 callersMethodUpdateWorkspaceMemberRole
UpdateWorkspaceMemberRole changes a member's role in a workspace.
internal/store/workspace_members.go:606
↓ 3 callersMethodUserID
UserID returns the pad user ID this session was issued to. Equivalent to GetSubject() under our model where Subject is always the user ID; kept as a t
internal/oauth/session.go:63
↓ 3 callersFunctionValidateBoolArity
ValidateBoolArity asserts that every bool-typed flag in doc obeys spec §5.3: bool flags MUST be presence switches. They MUST NOT appear in `--flag=val
internal/cmdhelp/example_validation.go:197
↓ 3 callersFunctionValidateURL
ValidateURL is the pre-flight SSRF guard: it rejects non-http(s) schemes, URLs with embedded credentials, missing hostnames, and IP-literal hosts in p
internal/urlimport/fetch.go:219
↓ 3 callersFunctionValidateUsername
ValidateUsername checks a username for format, length, and reserved word violations. It does NOT check uniqueness (that requires a store call).
internal/server/username.go:51
↓ 3 callersMethodWorkspaceHasAgentActivity
WorkspaceHasAgentActivity reports whether any non-deleted item VISIBLE to the caller was created via an agent surface — direct CLI invocation or the R
internal/store/items.go:4658
↓ 3 callersMethodWorkspaceSubscriberCount
WorkspaceSubscriberCount returns the number of active subscribers for a specific workspace.
internal/events/bus.go:154
↓ 3 callersMethodacquireParentChildrenLocksForUpdate
acquireParentChildrenLocksForUpdate is the in-tx helper UpdateItem uses to serialize itself against the open-children guard (IDEA-1494 R2 / R4). It ac
internal/store/items.go:3759
← previousnext →901–1,000 of 6,412, ranked by callers