MCPcopy Create free account

hub / github.com/PerpetualSoftware/pad / functions

Functions6,412 in github.com/PerpetualSoftware/pad

↓ 14 callersFunctiondoTransform
(srv *Server, slug, attachmentID string, body transformRequestBody)
internal/server/handlers_attachments_transform_test.go:29
↓ 14 callersFunctionisBearerAuth
isBearerAuth reports whether the request was authenticated via an Authorization: Bearer header rather than a browser session cookie. True for: PATs on
internal/server/middleware_auth.go:506
↓ 14 callersFunctionmcpAndOAuthEnabledTestServer
===================================================================== mcp ↔ OAuth integration (sub-PR E, TASK-1027) ==================================
internal/server/handlers_mcp_test.go:405
↓ 14 callersMethodnewRequest
newRequest creates an http.Request with auth and agent headers set.
internal/cli/client.go:1505
↓ 14 callersFunctionpostFormWithCookie
postFormWithCookie POSTs an x-www-form-urlencoded body with both a session cookie and the matching CSRF cookie set, plus the session-bound User-Agent.
internal/server/handlers_oauth_test.go:2403
↓ 13 callersMethodBackfillOAuthConnections
BackfillOAuthConnections walks every distinct grant chain found in oauth_access_tokens and oauth_refresh_tokens, parses the newest chain row's session
internal/store/oauth_connections_backfill.go:93
↓ 13 callersMethodClose
Close shuts down the event bus and cleans up resources.
internal/events/bus.go:147
↓ 13 callersMethodCreateShareLink
CreateShareLink creates a new share link and returns it with the raw token. The raw token is only available in this response — it is not stored.
internal/store/share_links.go:47
↓ 13 callersMethodDispatch
(ctx context.Context, cmdPath []string, cliArgs []string)
internal/mcp/dispatch.go:40
↓ 13 callersMethodGetCrossWorkspaceBacklinks
GetCrossWorkspaceBacklinks returns inbound `[[ws::REF]]` backlinks pointing at the queried target (`targetWorkspaceID`, `targetRef`) from EVERY OTHER
internal/store/wiki_links.go:1191
↓ 13 callersMethodGetMemberCollectionAccess
GetMemberCollectionAccess returns the collection IDs a member has been explicitly granted access to (only meaningful when collection_access = "specifi
internal/store/workspace_members.go:310
↓ 13 callersMethodInsertMCPAuditEntry
InsertMCPAuditEntry persists one audit row. Called from the audit middleware's async writer; the caller owns the buffered channel + the ordering, so t
internal/store/mcp_audit.go:53
↓ 13 callersMethodIsConfigured
IsConfigured reports whether the client has an explicit global connection configuration, either from config.toml or an environment/flag override.
internal/config/config.go:277
↓ 13 callersMethodListDocumentActivity
(documentID string, params models.ActivityListParams)
internal/store/activities.go:407
↓ 13 callersMethodListWorkspaces
(ctx context.Context)
internal/mcp/errors.go:297
↓ 13 callersFunctionLoad
()
internal/config/config.go:105
↓ 13 callersFunctionNewDispatcher
NewDispatcher creates a Dispatcher with the given store. The delivery client enforces the SSRF guard at connect time, not just at parse time: its dia
internal/webhooks/dispatcher.go:115
↓ 13 callersFunctionNormalizeItemLinkType
NormalizeItemLinkType canonicalizes supported link types and returns an error for unknown values.
internal/models/item_links.go:33
↓ 13 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
↓ 13 callersMethodValidateSession
ValidateSession hashes the provided token, looks it up, checks expiry, and returns the session info including the associated user and binding metadata
internal/store/sessions.go:62
↓ 13 callersMethodVisibleCollectionIDs
VisibleCollectionIDs returns the set of collection IDs a member can see. Returns nil if the member has "all" access (meaning no filtering needed). Sys
internal/store/workspace_members.go:139
↓ 13 callersFunctionactorNameFromRequest
actorNameFromRequest returns the authenticated user's display name, or empty string.
internal/server/handlers_documents.go:240
↓ 13 callersFunctionbootstrapAccountDeleteUser
bootstrapAccountDeleteUser creates the first admin user, sets a Stripe customer ID on them, and returns (userID, sessionToken). Used by the handleDele
internal/server/handlers_account_test.go:70
↓ 13 callersFunctionbrowserLogin
(page: Page)
web/e2e/lib/collab-helpers.ts:18
↓ 13 callersFunctiondeleteAccountReq
deleteAccountReq issues the delete-account request from a client IP that differs from the loopback address bootstrap ran on. The session-IP-change mid
internal/server/handlers_account_test.go:93
↓ 13 callersMethodexecuteRequest
executeRequest builds + serves + packages a single HTTP request against the wrapped handler. Pulled out of Dispatch so the special-case methods (dispa
internal/mcp/dispatch_http.go:445
↓ 13 callersMethodgoAsync
goAsync spawns fn in a goroutine that's tracked by s.bg, so Stop() can wait for in-flight background work to finish. Use this for any fire-and-forget
internal/server/server.go:264
↓ 13 callersFunctionmustSeedWorkspaceWithRole
mustSeedWorkspaceWithRole is a test helper that creates a workspace + adds the user as a member with the given role. Centralized here because TASK-952
internal/server/handlers_oauth_test.go:1821
↓ 13 callersFunctionnewTestClient
Tests for the OAuth 2.1 storage layer (PLAN-943 TASK-951 sub-PR A). The store layer is fosite-agnostic by design — sub-PR B introduces the fosite impo
internal/store/oauth_test.go:22
↓ 13 callersFunctionpassThrough
passThrough returns an ActionFn that forwards the input verbatim to the given cmdPath via env.Dispatch. The vast majority of catalog actions use this
internal/mcp/catalog.go:178
↓ 13 callersFunctiontaskSchema
()
internal/items/validate_test.go:9
↓ 13 callersFunctionuploadIntegrationPNG
(t *testing.T, srv *Server, slug string, w, h int)
internal/server/handlers_attachments_transform_test.go:41
↓ 12 callersMethodAddConnectionWorkspace
AddConnectionWorkspace inserts a (request_id, workspace_id) row in the allow-list join table. Idempotent: re-adding an existing pair is a no-op (INSER
internal/store/oauth_connections.go:303
↓ 12 callersMethodDeleteWorkspace
(slug string)
internal/store/workspaces.go:255
↓ 12 callersFunctionExtractWikiLinks
ExtractWikiLinks scans `content` for [[...]] occurrences OUTSIDE any fenced or inline code region, parses each into a WikiLinkRef, and returns them in
internal/links/extract.go:477
↓ 12 callersMethodFetch
(ctx context.Context, args []string)
internal/mcp/resources.go:47
↓ 12 callersMethodForceRefreshRoom
ForceRefreshRoom makes items.content the canonical source for an item's collab state: it runs `commit` under the per-item lock (so the caller can atom
internal/collab/manager.go:1058
↓ 12 callersMethodGetOAuthConnectionAccess
GetOAuthConnectionAccess is the hot-path projection used by the MCP introspection middleware. Runs at most two cheap indexed queries (one PK lookup, o
internal/store/oauth_connections.go:151
↓ 12 callersMethodPublish
Publish broadcasts an event to every subscriber whose itemID matches event.ItemID. Non-blocking: full subscriber channels drop the event with a warnin
internal/collab/bus.go:108
↓ 12 callersMethodPut
Put writes the blob from r into the backend, addressable by hash. The implementation MUST verify that the bytes streamed from r hash to the supplied h
internal/attachments/store.go:40
↓ 12 callersMethodSearch
(params SearchParams)
internal/store/search.go:89
↓ 12 callersMethodSetUserPlan
SetUserPlan updates a user's billing plan.
internal/store/limits.go:288
↓ 12 callersFunctionSetWorkspaceTool
SetWorkspaceTool returns the (Tool, Handler) pair for the built-in pad_set_workspace tool. The handler updates state in place. Exposed as a construct
internal/mcp/workspace.go:121
↓ 12 callersMethodSubscribe
Subscribe registers a new subscriber for the given workspace. Returns a buffered channel that will receive events for that workspace.
internal/events/bus.go:127
↓ 12 callersMethodSubscriberCount
SubscriberCount returns the number of active subscribers whose itemID matches. Used by the room manager to decide when the active peer count has dropp
internal/collab/memory_bus.go:154
↓ 12 callersFunctionValidateUpload
ValidateUpload combines the sniff result, the client-supplied MIME header, and the filename's extension to produce one of: - (entry, "", nil) — accep
internal/attachments/mime.go:200
↓ 12 callersFunctionWithTokenScopes
WithTokenScopes returns ctx decorated with the API token's JSON-encoded scopes string (e.g. `["read"]`, `["*"]`). Stashed by the MCP Bearer middleware
internal/server/context.go:89
↓ 12 callersFunctionbootstrapBody
(email string)
internal/server/handlers_auth_bootstrap_token_test.go:45
↓ 12 callersFunctionchildLinkTypeSQL
childLinkTypeSQL returns a SQL IN clause fragment like "'parent','implements'" for filtering item_links by child relationship types.
internal/store/items.go:23
↓ 12 callersFunctioncollectionSchemaJSONFromFlags
collectionSchemaJSONFromFlags resolves the --schema and --fields flags into a marshaled CollectionSchema JSON string. Exactly one of schemaInput or f
cmd/pad/cmd_collection.go:75
↓ 12 callersFunctiondoAuthedJSON
Mutation-endpoint tests for /api/v1/connected-apps/{id}/... routes (PLAN-1519 / TASK-1524 / IDEA-1517 §3). What's covered (per endpoint): - PATCH /n
internal/server/handlers_connected_apps_mutations_test.go:35
↓ 12 callersFunctiongetOnlyAttachmentID
getOnlyAttachmentID returns the ID of the single live attachment row in a workspace — the test infrastructure uploads at most one blob per call, so th
internal/server/handlers_storage_test.go:410
↓ 12 callersFunctionmcpEnabledTestServer
mcpEnabledTestServer builds a Server with cloud mode + a stub streamable-HTTP transport so tests targeting auth / discovery / routing don't need to dr
internal/server/handlers_mcp_test.go:380
↓ 12 callersFunctionnewMockStore
(hooks []models.Webhook)
internal/webhooks/dispatcher_test.go:25
↓ 12 callersFunctionnewRequestCapture
()
internal/mcp/dispatch_http_advanced_test.go:908
↓ 12 callersFunctionnewTestConfig
newTestConfig points DataDir at a fresh tmp dir and BrowserURL at the given test server. Most tests want both wired up together.
internal/cli/bootstrap_test.go:39
↓ 12 callersFunctionnewVerifiedEmailFixture
(t *testing.T, cloud bool)
internal/server/middleware_verified_email_test.go:46
↓ 12 callersFunctionrunHelp
runHelp invokes the help command with the given args and returns (stdout, stderr, error).
cmd/pad/help_cmdhelp_test.go:46
↓ 11 callersMethodAppendYjsUpdate
(itemID string, data []byte, schemaVersion string)
internal/collab/manager_test.go:61
↓ 11 callersMethodCreateActivity
(a models.Activity)
internal/store/activities.go:17
↓ 11 callersMethodCreateActivityDebounced
CreateActivityDebounced creates a new activity or updates an existing one if a matching activity (same document, same user, same action) was recorded
internal/store/activities.go:39
↓ 11 callersFunctionDeriveClaimCode
DeriveClaimCode produces the 6-digit code for the given (user, workspace) at the given wall-clock time. Exported so the Phase E "Connect project" moda
internal/server/claim_codes.go:78
↓ 11 callersFunctionEnsureServer
EnsureServer checks if the pad server is running; if not, starts it in the background.
internal/cli/server.go:16
↓ 11 callersMethodGetItemLinks
GetItemLinks returns links where the given item is either source or target. Links pointing to or from soft-deleted items are filtered out so callers (
internal/store/items.go:2792
↓ 11 callersMethodGetOAuthClient
GetOAuthClient looks up a registered client by ID. Returns ErrOAuthNotFound if no row matches.
internal/store/oauth.go:136
↓ 11 callersMethodGetUserWorkspaces
(userID string)
internal/mcp/dispatch_http_lister.go:51
↓ 11 callersMethodLoadYjsUpdatesSince
(itemID string, sinceID int64)
internal/collab/room.go:233
↓ 11 callersFunctionNewFetcher
NewFetcher returns a Fetcher with production defaults applied.
internal/urlimport/fetch.go:92
↓ 11 callersMethodSave
Save writes the persisted Pad config to disk.
internal/config/config.go:253
↓ 11 callersMethodSetEncryptionKey
SetEncryptionKey configures the store's AES-256 encryption key for encrypting sensitive fields (e.g., TOTP secrets) at rest. The key must be exactly 3
internal/store/encryption.go:19
↓ 11 callersMethodSetTOTPSecret
--- TOTP 2FA --- SetTOTPSecret stores the TOTP secret for a user (before 2FA is verified). The secret is encrypted at rest if an encryption key is con
internal/store/users.go:1183
↓ 11 callersMethodStarItem
StarItem stars an item for a user. Idempotent — re-starring is a no-op.
internal/store/item_stars.go:13
↓ 11 callersMethodSubscribe
Subscribe registers a subscriber for the given item and returns a buffered channel of OpEvents. Caller is responsible for calling Unsubscribe (typical
internal/collab/bus.go:98
↓ 11 callersMethodUnsubscribe
Unsubscribe removes a subscriber and closes its channel.
internal/events/bus.go:136
↓ 11 callersFunctionWithTokenAllowedWorkspaces
WithTokenAllowedWorkspaces returns ctx decorated with the OAuth token's workspace allow-list set at consent time (TASK-952). The list is either a set
internal/server/context.go:140
↓ 11 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:100
↓ 11 callersFunctioncallToolRequest
── test helpers ── callToolRequest builds an mcp.CallToolRequest with the given input arguments — the public constructor isn't exposed by mcp-go so we
internal/mcp/catalog_test.go:320
↓ 11 callersFunctioncontainsToolText
containsToolText looks for substr in any TextContent block of res. MCP results can carry multiple content blocks; checking all of them keeps the asser
internal/mcp/dispatch_http_test.go:977
↓ 11 callersFunctioncreateBlocksLink
helper: create a "blocks" link from source to target
internal/server/handlers_dashboard_test.go:37
↓ 11 callersFunctiondiffFields
(oldFields, newFields string)
internal/server/handlers_documents.go:414
↓ 11 callersFunctionequalStrings
(a, b []string)
internal/mcp/catalog_test.go:338
↓ 11 callersFunctionhydrateItemComputedMetadata
(item *models.Item)
internal/store/items.go:4749
↓ 11 callersFunctionmakeFanOutHandler
makeFanOutHandler returns the ToolHandlerFunc that mcp-go invokes when the tool is called. Reads `action` from the input, looks up the handler, and fo
internal/mcp/catalog.go:349
↓ 11 callersFunctionmakeTestImage
makeTestImage returns a freshly-allocated NRGBA image filled with a distinguishable pattern so transformation tests can assert on specific pixels. Wid
internal/attachments/processor_test.go:23
↓ 11 callersFunctionmustParseQueryFromPath
mustParseQueryFromPath extracts the query-string portion of path and parses it. Test-only — fails the test on malformed input.
internal/mcp/dispatch_http_routes_test.go:27
↓ 11 callersFunctionnewHTTPResourceFetcher
newHTTPResourceFetcher wires an HTTPResourceFetcher over a test mux with a fixed authenticated user, mirroring the dispatch_http_*_test.go setup. The
internal/mcp/resources_http_test.go:24
↓ 11 callersFunctionrequireRole
requireRole checks if the user's workspace role meets the minimum required level. Role hierarchy: owner > editor > viewer.
internal/server/middleware_auth.go:746
↓ 10 callersFunctionAddPadEntry
AddPadEntry reads (or creates) the JSON config at path, ensures mcpServers.pad points to `binary`, and writes the file back. Existing entries outside
internal/mcp/install.go:211
↓ 10 callersMethodCreateDocument
(workspaceID string, input models.DocumentCreate)
internal/store/documents.go:146
↓ 10 callersFunctionDecode
Decode parses an artifact's portable on-disk form back into an Artifact. It splits a leading "---\n ... \n---" frontmatter block from the body, unmar
internal/artifact/decode.go:21
↓ 10 callersMethodDelete
Delete removes the blob identified by key. Deleting a missing key is NOT an error — callers (e.g. the orphan GC) treat it as the success case.
internal/attachments/store.go:54
↓ 10 callersFunctionDetectWorkspace
DetectWorkspace walks up the directory tree from cwd looking for .pad.toml.
internal/cli/workspace.go:25
↓ 10 callersMethodDispatch
Dispatch sends the event payload to all matching active webhooks for the workspace. Each delivery runs in its own goroutine so the caller is never blo
internal/webhooks/dispatcher.go:180
↓ 10 callersMethodGetItemIncludeDeleted
GetItemIncludeDeleted finds an item by id including soft-deleted items. Used by code paths that need to act on records the user already owns even thou
internal/store/items.go:664
↓ 10 callersMethodHandle
(_ context.Context, r slog.Record)
internal/store/items_test.go:1805
↓ 10 callersMethodListUserOAuthConnections
ListUserOAuthConnections returns every OAuth connection the user has active. "Active" means at least one access OR refresh token in the chain still ha
internal/store/connected_apps.go:59
↓ 10 callersMethodRestoreItem
RestoreItem un-archives a soft-deleted item and bumps the workspace-scoped seq so delta-sync clients re-materialize the row. Same lock + subquery shap
internal/store/items.go:2454
↓ 10 callersFunctionRunBrowserBootstrap
RunBrowserBootstrap walks the operator through the browser-based first- admin bootstrap. Returns nil on success (server has flipped to setup_required:
internal/cli/bootstrap.go:92
↓ 10 callersMethodSetPlatformSetting
SetPlatformSetting upserts a platform setting.
internal/store/platform_settings.go:16
↓ 10 callersMethodUpdateCollection
(id string, input models.CollectionUpdate)
internal/store/collections.go:264
← previousnext →201–300 of 6,412, ranked by callers