MCPcopy Create free account

hub / github.com/PerpetualSoftware/pad / functions

Functions6,005 in github.com/PerpetualSoftware/pad

↓ 7 callersMethodGet
Get returns the current session workspace, or empty string when none has been set.
internal/mcp/workspace.go:72
↓ 7 callersMethodGetDocument
(id string)
internal/store/documents.go:193
↓ 7 callersMethodIsConnectionWorkspaceAllowed
IsConnectionWorkspaceAllowed reports whether workspace_id appears in the connection's allow-list. Used internally by GetOAuthConnectionAccess when cal
internal/store/oauth_connections.go:428
↓ 7 callersMethodIsDisabled
IsDisabled returns true if the user account has been disabled.
internal/models/user.go:35
↓ 7 callersMethodListMCPAuditByUser
ListMCPAuditByUser returns the user's most recent audit rows in reverse-chronological order. limit caps the page; offset paginates. Caller must enforc
internal/store/mcp_audit.go:104
↓ 7 callersFunctionNewSQLite
NewSQLite returns a *store.Store backed by a fresh SQLite file in t.TempDir(), fully migrated. See the package doc for the template+copy mechanism. St
internal/store/storetest/storetest.go:54
↓ 7 callersMethodProvider
Provider returns the fosite.OAuth2Provider that sub-PR C's HTTP handlers will call (NewAuthorizeRequest, NewAccessRequest, WriteAuthorizeResponse, etc
internal/oauth/server.go:220
↓ 7 callersMethodPruneSweep
PruneSweep finds every item whose ENTIRE op-log is older than `minAge` and prunes the whole op-log for those items under the per-item lock. Returns a
internal/collab/manager.go:418
↓ 7 callersFunctionRelativeTime
RelativeTime returns a human-readable relative time string.
internal/cli/format.go:108
↓ 7 callersMethodSearchItems
(workspaceID, query string)
internal/store/items.go:2436
↓ 7 callersMethodSubscriberCount
SubscriberCount returns the number of active subscribers for the given item. Useful for room-manager TTL accounting (TASK-1255 — when the count hits 0
internal/collab/bus.go:113
↓ 7 callersFunctionadminBillingReq
adminBillingReq fires GET /api/v1/admin/billing-stats with the cookie from a logged-in user. Returns the recorder so callers can inspect status + body
internal/server/handlers_admin_billing_test.go:43
↓ 7 callersFunctionbuildPlainShell
buildPlainShell builds the plain-text body for transactional emails. Self-hosted output is byte-equivalent to the prior templates. Cloud output adds a
internal/email/shell.go:93
↓ 7 callersFunctionbuildQuery
buildQuery returns the URL-encoded query string for the mapping (without the leading '?'). Empty mapping → empty string. Numbers from JSON arrive as
internal/mcp/dispatch_http_routes.go:125
↓ 7 callersMethodcallCount
()
internal/server/handlers_account_test.go:50
↓ 7 callersFunctioncancelInit
cancelInit is the canonical exit path for both Ctrl+C and explicit "Cancel" actions during pad init / pad workspace init. It prints a brief message to
cmd/pad/cancel.go:25
↓ 7 callersMethodcheckItemVisible
checkItemVisible is the context-free visibility decision. Returns (true, nil) when the (user, role) pair can see `item` under the same rules `requireI
internal/server/server.go:2046
↓ 7 callersFunctiondecodeEnvelope
decodeEnvelope helper extracts the ErrorEnvelope from an MCP error result. Uses textOf (the shared helper in catalog_test.go) to retrieve the JSON bod
internal/mcp/errors_test.go:306
↓ 7 callersMethoddispatchWebhook
dispatchWebhook fires a webhook event if a dispatcher is configured.
internal/server/handlers_webhooks.go:25
↓ 7 callersMethoddoClaim
doClaim issues a POST /api/v1/oauth/claim with Bearer PAT auth. extraReqID, if non-empty, attaches a WithMCPTokenIdentity context override to simulate
internal/server/handlers_oauth_claim_test.go:103
↓ 7 callersFunctiondoRequestFromRemoteAddr
(srv *Server, method, path string, body interface{}, remoteAddr string)
internal/server/server_test.go:48
↓ 7 callersMethodencrypt
encrypt encrypts plaintext using AES-256-GCM and returns a base64-encoded ciphertext prefixed with "enc:" to distinguish from plaintext values.
internal/store/encryption.go:30
↓ 7 callersMethodenrichItemsWithParent
enrichItemsWithParent batch-populates parent link info on a slice of items. Used by list endpoints where calling enrichItemForResponse per-item is too
internal/server/item_lineage.go:13
↓ 7 callersFunctionensureWorkspace
── Shared helpers ──────────────────────────────────────────────────────────── ensureWorkspace checks if the current directory is linked to a workspac
cmd/pad/init.go:373
↓ 7 callersFunctionfindFieldOptions
findFieldOptions returns the Options slice for the named field on a collection's schema, or nil if the field is missing.
internal/collections/templates_test.go:11
↓ 7 callersFunctiongetConfig
--- helpers ---
cmd/pad/main.go:176
↓ 7 callersMethodgetWorkspace
getWorkspace returns the full workspace object resolved by middleware. Falls back to direct resolution for routes without RequireWorkspaceAccess.
internal/server/server.go:1878
↓ 7 callersFunctiongraphNode
(resp GraphResponse, ref string)
internal/server/handlers_graph_test.go:23
↓ 7 callersMethodhandleResponse
(resp *http.Response, result interface{})
internal/cli/client.go:1591
↓ 7 callersFunctionhopTransitions
hopTransitions returns only the "real" status hops — excluding the create-time "entered initial status" seed row (id prefix "create_") that every crea
internal/store/status_transitions_test.go:37
↓ 7 callersFunctionisCancellation
isCancellation reports whether err represents a user-initiated abort from any interactive init prompt. Init RunEs use this to convert the sentinel int
cmd/pad/cancel.go:84
↓ 7 callersFunctionisSupported
()
web/src/lib/stores/localIndexPersistence.ts:67
↓ 7 callersFunctionisolateHome
isolateHome redirects HOME to a temp dir and chdirs to a fresh temp project dir so credential writes and .pad.toml detection don't leak into the real
cmd/pad/setup_headless_test.go:89
↓ 7 callersFunctionitemPrefetchHandler
itemPrefetchHandler routes /api/v1/workspaces/{ws}/items/{ref} GETs to a static map keyed by ref so each link-test can declare just the items it needs
internal/mcp/dispatch_http_links_test.go:18
↓ 7 callersMethodparseError
(resp *http.Response)
internal/cli/client.go:1601
↓ 7 callersFunctionreadControlWithin
readControlWithin reads frames off the conn within d, drains payload (binary) frames, and returns the FIRST TextMessage parsed as a ControlMessage. Te
internal/collab/manager_test.go:1205
↓ 7 callersMethodseedGrantee
seedGrantee creates a throwaway user to be the recipient of a grant, for tests that need a real grant/link ID on a hidden or visible resource (BUG-192
internal/server/handlers_grant_visibility_test.go:128
↓ 7 callersMethodstopMCPSessionTracker
stopMCPSessionTracker signals the sweeper to exit. Called from Server.Stop. Idempotent.
internal/server/middleware_mcp_session.go:245
↓ 7 callersFunctiontokenWorkspaceID
tokenWorkspaceID returns the workspace ID set by the TokenAuth middleware, or an empty string if no token was used.
internal/server/middleware_auth.go:437
↓ 7 callersFunctionwriteCredsFile
(t *testing.T, home, body string)
internal/cli/credentials_test.go:21
↓ 6 callersMethodAllowedAudience
AllowedAudience returns the canonical resource URL the server is configured to accept. Sub-PR C's /authorize handler reads this to reject mismatched `
internal/oauth/server.go:236
↓ 6 callersFunctionApplyPatch
ApplyPatch applies a patch to baseText to produce the target text. Returns an error if the patch cannot be applied cleanly.
internal/diff/diff.go:24
↓ 6 callersMethodCloudMode
CloudMode reports whether the marketing footer is currently enabled. Templates read it through getCloudMode() so they pick up the same snapshot for th
internal/email/sender.go:87
↓ 6 callersMethodComputeRef
ComputeRef sets the Ref field from CollectionPrefix and ItemNumber. Call this after populating the item from a database query.
internal/models/item.go:87
↓ 6 callersFunctionConvertGeneric
ConvertGeneric converts an HTML document into markdown by first running go-readability to strip chrome, navigation, and ads, then piping the cleaned H
internal/urlimport/generic.go:37
↓ 6 callersMethodDeleteCollection
(id string)
internal/store/collections.go:317
↓ 6 callersMethodDeleteUserSessions
DeleteUserSessions destroys all sessions for a user (logout everywhere).
internal/store/sessions.go:247
↓ 6 callersFunctionDetectTools
DetectTools returns the tools that appear to be in use, based on any of: a project-local directory, a home-directory install, or a binary on PATH.
internal/cli/agents.go:104
↓ 6 callersFunctionEmitJSON
EmitJSON walks the command tree below `target`, builds a cmdhelp v0.1 Document, and writes it to w as indented JSON terminated by a newline. `root` M
internal/cmdhelp/json.go:73
↓ 6 callersMethodEnableTOTP
EnableTOTP atomically enables 2FA for a user and stores hashed recovery codes. The expectedSecret is the plaintext secret — it's compared against the
internal/store/users.go:1198
↓ 6 callersFunctionEnsureBootstrapToken
EnsureBootstrapToken generates a fresh first-run bootstrap token (or loads the existing one if a valid file is already present). Returns the token str
internal/server/bootstrap.go:66
↓ 6 callersMethodError
()
internal/attachments/mime.go:249
↓ 6 callersMethodError
()
internal/server/handlers_items.go:643
↓ 6 callersFunctionExtractItemImplementationNotes
(fieldsJSON string)
internal/models/item.go:317
↓ 6 callersMethodGetAccessToken
GetAccessToken hydrates an access token by its HMAC signature. Returns ErrOAuthInactiveToken if the row exists but has been revoked / rotated out, Err
internal/store/oauth.go:317
↓ 6 callersMethodGetBillingMetrics
GetBillingMetrics fetches an aggregated Stripe-derived snapshot from pad-cloud's /admin/metrics/billing endpoint (active subs, MRR, ARR, churn, cancel
internal/server/server.go:465
↓ 6 callersMethodGetClient
===================================================================== fosite.ClientManager ===========================================================
internal/oauth/storage.go:143
↓ 6 callersMethodGetRefreshToken
GetRefreshToken hydrates a refresh token. Returns ErrOAuthInactiveToken when active=false, which fosite uses to trigger family revocation on the match
internal/store/oauth.go:357
↓ 6 callersMethodHasOAuthProvider
HasOAuthProvider returns true if the user has linked the given provider.
internal/models/user.go:59
↓ 6 callersFunctionInstallForTool
InstallForTool writes the skill content to the appropriate location for a tool.
internal/cli/agents.go:163
↓ 6 callersMethodIsExpired
IsExpired reports whether an invitation is past its expiration window. Invitations created before the expires_at migration (nil ExpiresAt) are treated
internal/models/user.go:127
↓ 6 callersMethodIsItemStarred
IsItemStarred checks whether a specific item is starred by a user.
internal/store/item_stars.go:43
↓ 6 callersMethodListAuditLog
ListAuditLog returns activities matching the given audit log filters. Supports filtering by action, actor, workspace, and date range.
internal/store/activities.go:507
↓ 6 callersFunctionNewRoomManagerWithConfig
NewRoomManagerWithConfig is the explicit-config form. Empty config fields fall back to package defaults.
internal/collab/manager.go:125
↓ 6 callersFunctionNewSender
NewSender creates a new email sender.
internal/email/sender.go:35
↓ 6 callersFunctionNormalizeSlug
NormalizeSlug maps the common singular / shorthand collection-name forms users actually type ("task", "idea", "doc", etc.) to the canonical plural slu
internal/collections/prefix.go:15
↓ 6 callersFunctionPlaybookLibrary
PlaybookLibrary returns all pre-defined playbook categories with their playbooks. As of PLAN-1397's invokable-first overhaul (TASK-1403), the library
internal/collections/playbook_library.go:37
↓ 6 callersFunctionPromptBody
PromptBody returns the canonical body text for a registered prompt. Exported so tests can assert lockstep with SKILL.md without duplicating the litera
internal/mcp/prompts.go:85
↓ 6 callersMethodRegister
Register installs store under prefix (e.g. "fs", "s3"). The prefix MUST NOT contain a colon — Resolve splits keys on the first colon, so a prefix with
internal/attachments/registry.go:37
↓ 6 callersMethodRemoveWorkspaceMember
RemoveWorkspaceMember removes a user from a workspace.
internal/store/workspace_members.go:35
↓ 6 callersFunctionRenderMarkdown
RenderMarkdown writes a Document as markdown matching cmdhelp v0.1 §6. Useful for tests that build a Document manually and want to render it without r
internal/cmdhelp/md.go:29
↓ 6 callersMethodRenewSessionIfStale
RenewSessionIfStale implements sliding-window expiration. When a session is past its renewal threshold (less than half its renewal window remaining) i
internal/store/sessions.go:120
↓ 6 callersFunctionResolveTool
ResolveTool finds an AgentTool by name or alias. Returns nil if not found.
internal/cli/agents.go:86
↓ 6 callersMethodRevokeAccessTokenFamily
RevokeAccessTokenFamily mirrors RevokeRefreshTokenFamily for access tokens. fosite calls these in pairs when revoking by request_id (the unified Revok
internal/store/oauth.go:504
↓ 6 callersMethodServeHTTP
(w http.ResponseWriter, r *http.Request)
internal/mcp/dispatch_http_advanced_test.go:910
↓ 6 callersMethodSetEmailSender
SetEmailSender attaches a transactional email sender. The apiKey is stored separately for deriving the unsubscribe HMAC secret. If the server is alre
internal/server/server.go:702
↓ 6 callersMethodSetOpLogGCConfig
SetOpLogGCConfig overrides the default sweep interval (1h) and minimum row age (24h). Pass 0 for either to keep the package default. Must be called be
internal/server/oplog_gc.go:44
↓ 6 callersMethodSetSpawn
SetSpawn injects the goroutine spawner used for deliveries. Passing the server's tracked-goroutine helper (Server.goAsync) makes Server.Stop() wait fo
internal/webhooks/dispatcher.go:93
↓ 6 callersMethodSetUserPlanOverrides
SetUserPlanOverrides updates per-user limit overrides (JSON string).
internal/store/limits.go:298
↓ 6 callersMethodStartOpLogGC
StartOpLogGC kicks off the periodic prune-sweep loop. Idempotent — calling twice silently no-ops. Must be called AFTER SetCollabRoomManager; the loop
internal/server/oplog_gc.go:64
↓ 6 callersMethodSubscribe
Subscribe registers a subscriber for itemID and returns a buffered channel of size subscriberBufSize.
internal/collab/memory_bus.go:50
↓ 6 callersMethodTouchUserWrite
TouchUserWrite updates last_write_at for a user, throttled to avoid write amplification. Only writes if the stored value is older than 5 minutes. Best
internal/store/users.go:864
↓ 6 callersMethodUnmarkStripeEventProcessed
UnmarkStripeEventProcessed deletes a row from stripe_processed_events, allowing Stripe retries of the same event ID to be handled again (TASK-736). Us
internal/store/stripe_events.go:86
↓ 6 callersMethodUnsubscribe
Unsubscribe removes a subscriber and closes its channel. Safe to call with an already-removed channel — no-op in that case.
internal/collab/bus.go:102
↓ 6 callersMethodUpdateDocument
(id string, input models.DocumentUpdate)
internal/store/documents.go:224
↓ 6 callersMethodUpdateUser
UpdateUser updates mutable user fields.
internal/store/users.go:162
↓ 6 callersFunctionValidatePartialFields
ValidatePartialFields validates ONLY the keys present in `patch` against the schema (TASK-2022, field-level PATCH / IDEA-1480). Unlike ValidateFields
internal/items/validate.go:85
↓ 6 callersMethodValidatePassword
ValidatePassword checks an email/password combination. Returns the user if valid, nil if the credentials are wrong (not an error).
internal/store/users.go:214
↓ 6 callersMethodValidateToken
ValidateToken hashes the provided plaintext token, looks it up in the database, checks expiry, and updates last_used_at. Returns nil if the token is i
internal/store/api_tokens.go:219
↓ 6 callersFunctionVerifyClaimCode
VerifyClaimCode returns true if code matches the derived code for (userID, workspaceID) at the current OR previous time bucket — the sliding 5–10 minu
internal/server/claim_codes.go:127
↓ 6 callersMethodWorkspaceStorageUsage
WorkspaceStorageUsage returns the total bytes consumed by non-deleted attachments in the workspace. Includes derived blobs (thumbnails) — those are re
internal/store/attachments.go:903
↓ 6 callersFunctionWriteWorkspaceLink
WriteWorkspaceLink writes a .pad.toml in the given directory. serverURL is the base URL of the Pad server hosting this workspace. Pass the empty stri
internal/cli/workspace.go:94
↓ 6 callersMethodacquireWorkspaceSeqLock
acquireWorkspaceSeqLock takes a Postgres advisory transaction lock keyed on the workspace ID so concurrent seq-bumping mutations serialize. The lock a
internal/store/items.go:94
↓ 6 callersFunctionapiRequest
apiRequest makes a JSON API request to the test server.
internal/server/handlers_events_test.go:91
↓ 6 callersFunctionbuildToolFromDef
buildToolFromDef compiles a ToolDef into the mcp.Tool shape mcp-go expects. The schema is flat: `action` is required, every other parameter is optiona
internal/mcp/catalog.go:266
↓ 6 callersFunctionconventionsCollection
conventionsCollection returns a Conventions collection scoped to the caller's domain. The trigger and scope select options are supplied by the caller
internal/collections/templates.go:304
↓ 6 callersFunctioncountIPChangeEvents
countIPChangeEvents returns the number of session_ip_changed rows in the audit log.
internal/server/middleware_session_ip_test.go:405
↓ 6 callersFunctiondecodeItemFields
(t *testing.T, fieldsJSON string)
internal/server/handlers_items_fieldpatch_test.go:27
↓ 6 callersMethoddecryptUserTOTP
decryptUserTOTP decrypts the TOTP secret on a User struct in place.
internal/store/users.go:72
↓ 6 callersFunctiondisplayWidth
displayWidth returns the visible column width of s: ANSI SGR escape sequences are stripped, then the remaining runes are counted. Every rune is approx
internal/cli/format.go:148
← previousnext →401–500 of 6,005, ranked by callers