MCPcopy Create free account

hub / github.com/PerpetualSoftware/pad / functions

Functions8,091 in github.com/PerpetualSoftware/pad

↓ 6 callersMethodmatches
True when `key` names the live view. A null key never matches.
web/src/lib/attachments/viewFence.ts:92
↓ 6 callersFunctionmembersHandler
membersHandler returns an http.Handler that responds to any path with the standard `{members:[...], invitations:[]}` shape using the supplied rows.
internal/mcp/dispatch_http_advanced_test.go:877
↓ 6 callersFunctionmimeDispoFixture
BUG-2413: the attachment read path must fail CLOSED on Content-Disposition — a stored MIME that is not explicitly inline-safe is served as an attachme
internal/server/handlers_attachments_download_mime_test.go:27
↓ 6 callersMethodmove
Move one finger; sends `touchMove` with the full active set.
web/e2e/lib/attachment-viewer.ts:355
↓ 6 callersFunctionmustSeedWorkspaceForMutation
(t *testing.T, srv *Server, ownerID, slug, role string)
internal/server/handlers_connected_apps_mutations_test.go:86
↓ 6 callersFunctionmustWorkspace
(t *testing.T, srv *Server, name, ownerID string)
internal/server/authz_cross_workspace_test.go:93
↓ 6 callersFunctionnewClaimCodeEnv
(t *testing.T)
internal/server/handlers_claim_code_test.go:86
↓ 6 callersFunctionnewConnectedTestStore
Connected-apps store tests (PLAN-943 TASK-954). What's covered: - ListUserOAuthConnections deduplicates a chain across multiple access-token rows (r
internal/store/connected_apps_test.go:29
↓ 6 callersFunctionnewTestConfig
(t *testing.T)
internal/config/encryption_key_test.go:12
↓ 6 callersFunctionnormalizeStringEncodedJSONFields
normalizeStringEncodedJSONFields recursively walks a parsed JSON value, finds string-typed `fields` and `tags` properties, parses them as embedded JSO
internal/mcp/dispatch.go:209
↓ 6 callersFunctionnum
(n int)
internal/cli/format_markdown_test.go:22
↓ 6 callersFunctionpackageHTTPResponse
packageHTTPResponse turns the recorded handler response into an MCP CallToolResult, mirroring ExecDispatcher's "JSON → structured + text fallback" beh
internal/mcp/dispatch_http.go:677
↓ 6 callersFunctionparseAttachmentFilename
parseAttachmentFilename extracts the filename from a Content-Disposition header. Mirrors the CLI's helper of the same name (cmd/pad/main.go parseAttac
internal/mcp/dispatch_http_attachments.go:199
↓ 6 callersFunctionrecordInstallation
recordInstallation stores a skill install in the global registry (~/.pad/installations.json).
cmd/pad/cmd_agent.go:203
↓ 6 callersMethodregisterPendingAck
registerPendingAck creates an entry in the room's pending-acks map keyed on requestID, expecting acks/brackets from `applier`. It seeds the bracket ba
internal/collab/applier.go:527
↓ 6 callersFunctionrenderItemTable
renderItemTable is the testable core of PrintItemTable: it lays the item list out into maxWidth columns and writes to w. Columns are REF/TITLE · STATU
internal/cli/format.go:242
↓ 6 callersFunctionrequesterToOAuthRequest
===================================================================== Translation helpers ============================================================
internal/oauth/storage.go:444
↓ 6 callersMethodreset
()
internal/server/handlers_watch_events.go:355
↓ 6 callersMethodresolveWorkspace
resolveWorkspace resolves a workspace by slug or UUID, scoped to the authenticated user's accessible workspaces when a user context is present. Return
internal/server/server.go:2512
↓ 6 callersMethodrunWorkspacePurgeSweep
runWorkspacePurgeSweep purges every workspace whose deleted_at is older than cutoff. Blobs are reclaimed BEFORE the DB rows are removed so a failed re
internal/server/workspace_purge.go:215
↓ 6 callersFunctionsanitizeFTSQuery
sanitizeFTSQuery wraps each token in double quotes so FTS5 treats special characters (like hyphens) as literals rather than operators. Only used for S
internal/store/search.go:764
↓ 6 callersFunctionsanitizePGFTSQuery
sanitizePGFTSQuery returns a copy of q with hyphens replaced by spaces. Used as the second leg of the OR-combined PG FTS query: postgres' english pars
internal/store/search.go:790
↓ 6 callersFunctionscanAttachment
scanAttachment scans a single row into a models.Attachment, handling nullables via *string / *int.
internal/store/attachments.go:39
↓ 6 callersFunctionseedBackfillWorkspace
(t *testing.T, s *Store, name, ownerID string)
internal/store/oauth_connections_backfill_test.go:52
↓ 6 callersFunctionseedCollabFixture
seedCollabFixture creates the minimum fixture chain needed to test the collab WS endpoint: workspace + collection + item, all in the store, returning
internal/server/handlers_collab_test.go:62
↓ 6 callersFunctionseedStoredRow
seedStoredRow writes body to the registry and creates a live attachment row with an arbitrary stored MIME + filename attached to itemID. The row shape
internal/server/handlers_attachments_download_mime_test.go:58
↓ 6 callersFunctionseedUser
seedUser creates a user that subsequent oauth tokens can use as their `subject`.
internal/store/connected_apps_test.go:61
↓ 6 callersFunctionserveAttachment
serve issues a GET (method="GET") or HEAD against a seeded row and returns the recorder. variant, when non-empty, is appended as ?variant=.
internal/server/handlers_attachments_download_mime_test.go:99
↓ 6 callersMethodstartMCPSessionTracker
startMCPSessionTracker constructs the tracker + spawns the sweep goroutine. Called once at startup from SetMCPTransport (alongside startMCPAuditWriter
internal/server/middleware_mcp_session.go:225
↓ 6 callersFunctiontestStorePostgres
testStorePostgres creates an isolated test database on the PostgreSQL server. It connects to the base URL, creates a randomly-named database, runs mig
internal/store/store_test.go:159
↓ 6 callersFunctiontokenAllowedWorkspaceMatches
tokenAllowedWorkspaceMatches reports whether the OAuth token's workspace allow-list (set at consent time, TASK-952) permits the given workspace slug.
internal/server/middleware_auth.go:1132
↓ 6 callersMethodtrackMCPSession
(reqHeader, respHeader func(string) string, method string, httpStatus int)
internal/server/middleware_mcp_session.go:274
↓ 6 callersFunctionuploadChannels
uploadChannels drives the real route (no users exist in these tests, so RequireWorkspaceAccess grants implicit owner) with independent control over th
internal/server/handlers_attachments_test.go:391
↓ 6 callersMethodvalidateSessionCookie
validateSessionCookie validates a session cookie and returns the user if valid, nil otherwise. A User-Agent change is logged but NOT rejected — this m
internal/server/handlers_auth.go:259
↓ 6 callersFunctionveErrorCode
veErrorCode extracts the JSON error.code from a response, or "" if the body isn't an error envelope.
internal/server/middleware_verified_email_test.go:143
↓ 6 callersFunctionviewerDialog
(page: Page, name: string)
web/e2e/lib/attachment-viewer.ts:209
↓ 6 callersFunctionwriteBootstrapToken
writeBootstrapToken drops a token file at <dataDir>/.bootstrap-token in the same shape EnsureBootstrapToken would produce — token + trailing newline,
internal/cli/bootstrap_test.go:52
↓ 5 callersMethodAcquireParentChildrenLocks
AcquireParentChildrenLocks is the CANONICAL helper for taking `pad:parent-children:<id>` advisory locks. Every call site that needs to serialize again
internal/store/items.go:4156
↓ 5 callersFunctionApplyWorkspaceContext
(raw string, context *WorkspaceContext)
internal/models/workspace_settings.go:99
↓ 5 callersMethodAsPlanLimit
AsPlanLimit returns the parsed plan-limit details when this APIError carries them, or nil otherwise. Returns nil for any error other than "plan_limit_
internal/cli/client.go:1386
↓ 5 callersMethodBaseURL
BaseURL returns the base URL for the API. If URL is set (via config, --url flag, or PAD_URL), it takes precedence. Otherwise, constructs from host and
internal/config/config.go:355
↓ 5 callersMethodCancelCustomer
CancelCustomer asks pad-cloud to cancel every active Stripe subscription for customerID and then delete the Stripe customer object. Used by handleDele
internal/server/server.go:525
↓ 5 callersFunctionCapabilityLine
CapabilityLine returns the single-line capability bit a conforming CLI emits in response to `<cmd> help --capabilities` (or the `--cmdhelp-capabilitie
internal/cmdhelp/json.go:27
↓ 5 callersMethodConsumeEmailVerification
ConsumeEmailVerification atomically validates and marks a verification token as used, then sets users.email_verified_at to now. Returns the (now-verif
internal/store/email_verification.go:93
↓ 5 callersMethodConsumeTOTPStep
ConsumeTOTPStep atomically records a TOTP time-step as consumed, enforcing single-use semantics for login codes (BUG-2054). It succeeds only if step i
internal/store/users.go:1263
↓ 5 callersMethodCreatePasswordReset
CreatePasswordReset generates a reset token for the given user. Returns the plaintext token (to embed in the reset URL). The token is stored as a SHA-
internal/store/password_resets.go:19
↓ 5 callersMethodCrop
Crop returns the rectangular sub-image bounded by `rect`. The rectangle is interpreted in the image's coordinate space (origin top-left) and intersect
internal/attachments/processor.go:55
↓ 5 callersMethodDeleteItemLink
(id string)
internal/store/items.go:3123
↓ 5 callersFunctionDetect
Detect classifies a fetched document by inspecting its Content-Type header and the leading bytes of its body. It returns TypeOpenAPI when the document
internal/urlimport/detect.go:33
↓ 5 callersMethodDisableUser
DisableUser soft-disables a user account by setting disabled_at.
internal/store/users.go:885
↓ 5 callersMethodError
()
internal/server/handlers_items_bulk.go:84
↓ 5 callersMethodError
()
internal/billing/cloud_client.go:102
↓ 5 callersMethodEventsSince
EventsSince returns buffered notifications with ID > sinceID, for Last-Event-ID resume. Returns nil if sinceID has been evicted from the buffer (gap t
internal/watchevents/watchevents.go:176
↓ 5 callersMethodExportWorkspace
ExportWorkspace exports all data for a workspace into a portable format.
internal/store/export.go:66
↓ 5 callersMethodFTSMatch
FTSMatch returns the full-text search WHERE clause fragment. SQLite: "table MATCH ?" — consumes ONE arg. PostgreSQL: an OR-combined plainto_tsquery ma
internal/store/dialect.go:86
↓ 5 callersMethodGetAuthorizationCode
GetAuthorizationCode hydrates the code's session. Returns ErrOAuthInvalidatedCode if the row exists but active=false (fosite triggers grant-family rev
internal/store/oauth.go:269
↓ 5 callersMethodGetDashboard
--- Dashboard --- GetDashboard returns the workspace dashboard as raw JSON. The DashboardResponse type lives in the server package, so we use json.Raw
internal/cli/client.go:549
↓ 5 callersMethodGetItemContentFlushedOpLogID
GetItemContentFlushedOpLogID returns the per-item flush watermark (TASK-1309). Returns (0, false) for items with NULL watermark or no row.
internal/collab/room.go:246
↓ 5 callersMethodGetItemProgress
--- Child Item Progress --- GetItemProgress counts total and done child items linked to a parent via item_links. "Done" means the child item's done fi
internal/store/items.go:3660
↓ 5 callersMethodGetOAuthProviders
GetOAuthProviders parses the JSON oauth_providers field into a string slice.
internal/models/user.go:47
↓ 5 callersMethodGetShareLink
GetShareLink retrieves a share link by ID.
internal/store/share_links.go:98
↓ 5 callersMethodGetWatchByUserItem
GetWatchByUserItem returns the (at most one) watch a user holds on a specific item, or (nil, nil) if none exists.
internal/store/watches.go:33
↓ 5 callersMethodGetWorkspace
(slug string)
internal/cli/client.go:116
↓ 5 callersMethodImportWorkspace
ImportWorkspace imports a workspace from an exported data structure. It creates a new workspace with regenerated IDs, remapping all references. If new
internal/store/export.go:210
↓ 5 callersFunctionIsTerminalItem
IsTerminalItem reports whether an item's fields map indicates the item is in a terminal state for its collection. This is the canonical Go-side "is do
internal/models/terminal.go:120
↓ 5 callersFunctionIsTerminalStatusDefault
IsTerminalStatusDefault checks using the default fallback list (for cases where no collection schema is available).
internal/models/terminal.go:180
↓ 5 callersMethodListCollections
--- Collections ---
internal/cli/client.go:175
↓ 5 callersMethodListCommentsBeforeTime
ListCommentsBeforeTime returns comments for an item created before the given time, ordered newest-first, limited to `limit` results. Used for cursor-b
internal/store/comments.go:132
↓ 5 callersMethodListForUser
ListForUser implements SessionPresence, oldest connection first with the session id as a tiebreaker so the order is deterministic even for two connect
internal/server/session_presence.go:237
↓ 5 callersMethodListStarredItems
ListStarredItems returns all items starred by a user in a workspace, enriched with collection and assignment info. Only non-deleted items are returned
internal/store/item_stars.go:96
↓ 5 callersFunctionListTemplates
ListTemplates returns all workspace templates that should be shown in pickers. Templates flagged Hidden are excluded.
internal/collections/templates.go:1043
↓ 5 callersMethodListWorkspaceActivity
(workspaceID string, params models.ActivityListParams)
internal/store/activities.go:359
↓ 5 callersFunctionLookupMIME
LookupMIME returns the entry for a MIME type if it is on the allowlist, or (zero, false) if rejected.
internal/attachments/mime.go:135
↓ 5 callersFunctionNewCloudClient
NewCloudClient constructs a client pointed at the given pad-cloud base URL (e.g. "http://pad-cloud:7778") authenticated with cloudSecret. Both values
internal/billing/cloud_client.go:76
↓ 5 callersFunctionNewServer
NewServer constructs a pad MCP server. Call Run(ctx) to start it. The returned Server is wired with tool capabilities advertised but no tools registe
internal/mcp/server.go:45
↓ 5 callersFunctionNormalizeMIME
NormalizeMIME strips parameters and lowercases the type/subtype. We match strictly against the allowlist after normalization so callers can pass an ht
internal/attachments/mime.go:187
↓ 5 callersFunctionNormalizeWorkspaceSettings
(raw string)
internal/models/workspace_settings.go:82
↓ 5 callersMethodPIDFile
()
internal/config/config.go:415
↓ 5 callersFunctionPriorityColor
PriorityColor returns a *color.Color appropriate for the given priority string.
internal/cli/format.go:50
↓ 5 callersMethodPruneYjsUpdatesBefore
(itemID string, before time.Time)
internal/collab/room.go:242
↓ 5 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:231
↓ 5 callersFunctionRegisterResources
RegisterResources installs the read-only MCP resource templates on srv: - pad://workspace/{ws}/items/{ref} — single item markdown - pad://workspace/{
internal/mcp/resources.go:194
↓ 5 callersFunctionRegisterSession
RegisterSession writes a SessionRegistration for the CURRENT process (os.Getpid()) to ~/.pad/sessions/<pid>.json, mode 0600 — mirroring credentials.js
internal/cli/session_registry.go:63
↓ 5 callersFunctionRenderAttachmentChip
RenderAttachmentChip builds a Notion-style file-chip anchor for a non-image attachment. `target=_blank` + `rel=noopener noreferrer` matches the existi
internal/server/render/attachments.go:140
↓ 5 callersFunctionRenderAttachmentImage
RenderAttachmentImage builds an inline `<img>` element for an image attachment. Width/height attributes are emitted when both are known and positive s
internal/server/render/attachments.go:112
↓ 5 callersFunctionRenderAttachmentMissing
RenderAttachmentMissing builds a placeholder span for a missing/deleted attachment. Keeps the document layout intact and tells the user *why* there's
internal/server/render/attachments.go:169
↓ 5 callersMethodRevokeRefreshTokenFamily
============================================================ Token revocation (handler/oauth2/revocation_storage.go) =================================
internal/store/oauth.go:428
↓ 5 callersMethodSetAllowedWorkspaces
SetAllowedWorkspaces is the symmetric writer used by oauth/authorize/decide (TASK-952). Centralizing the key string here keeps producers + consumers i
internal/oauth/session.go:137
↓ 5 callersMethodSetAuthToken
SetAuthToken sets the authorization token for API requests.
internal/cli/client.go:83
↓ 5 callersMethodSetBootstrapToken
SetBootstrapToken wires the in-memory token + on-disk path into the Server. Called once at startup from cmd/pad/main.go after EnsureBootstrapToken suc
internal/server/bootstrap.go:145
↓ 5 callersMethodSetEventBus
SetEventBus attaches an event bus for real-time SSE streaming.
internal/server/server.go:738
↓ 5 callersMethodSetUserStripeCustomerID
SetUserStripeCustomerID stores the Stripe customer ID for a user.
internal/store/limits.go:355
↓ 5 callersMethodSoftDeleteAttachment
SoftDeleteAttachment marks the given attachment row deleted (and every variant whose parent_id points at it) so the orphan GC will reclaim the bytes a
internal/store/attachments.go:866
↓ 5 callersMethodStatus
Status checks each tracked installation and returns its current state. embeddedContent is the raw embedded skill bytes, used for freshness comparison.
internal/cli/registry.go:137
↓ 5 callersFunctionTokenAllowedWorkspaceSet
TokenAllowedWorkspaceSet returns the token's allow-list as a slug-set for filtering a multi-workspace result, or nil when no per-slug gate applies. It
internal/server/context.go:227
↓ 5 callersFunctionTokenAllowedWorkspacesFromContext
TokenAllowedWorkspacesFromContext returns the token's workspace allow-list, or nil if none was attached. Three return shapes matter to callers: - nil
internal/server/context.go:201
↓ 5 callersFunctionToolInstalled
ToolInstalled checks if the skill file exists for the given tool.
internal/cli/agents.go:153
↓ 5 callersFunctionToolSkillPath
ToolSkillPath returns the full path where a tool's skill file would be installed.
internal/cli/agents.go:144
↓ 5 callersFunctionValidateFieldsDetailed
ValidateFieldsDetailed is ValidateFields with per-field attribution: it returns one FieldIssue per failure instead of a joined error, and applies sche
internal/items/validate.go:104
↓ 5 callersFunctionWithTokenWorkspaceID
WithTokenWorkspaceID returns ctx decorated with a workspace-scope hint, mirroring TokenAuth's behaviour for workspace-scoped API tokens. Pass an empty
internal/server/context.go:48
← previousnext →701–800 of 8,091, ranked by callers