MCPcopy Create free account

hub / github.com/PerpetualSoftware/pad / functions

Functions6,005 in github.com/PerpetualSoftware/pad

↓ 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 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 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 callersMethodbuildAuthedRequest
( ctx context.Context, method, urlPath string, body []byte, user *models.User, )
internal/mcp/dispatch_http.go:543
↓ 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:256
↓ 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 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 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 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:100
↓ 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 callersFunctionWithCurrentUser
Exported context-key helpers for callers that need to synthesize an authenticated request without going through the auth middleware chain (e.g. the in
internal/server/context.go:25
↓ 12 callersFunctionactorNameFromRequest
actorNameFromRequest returns the authenticated user's display name, or empty string.
internal/server/handlers_documents.go:240
↓ 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 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:2695
↓ 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 callersFunctionNewFetcher
NewFetcher returns a Fetcher with production defaults applied.
internal/urlimport/fetch.go:92
↓ 11 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
↓ 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 callersMethodUnsubscribe
Unsubscribe removes a subscriber and closes its channel.
internal/events/bus.go:109
↓ 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:4578
↓ 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 callersFunctionrequireRole
requireRole checks if the user's workspace role meets the minimum required level. Role hierarchy: owner > editor > viewer.
internal/server/middleware_auth.go:738
↓ 11 callersFunctiontestServerWithCollab
testServerWithCollab wires a RoomManager onto a fresh test server so the collab handler answers 200/101 on the happy path. Tests that only assert on a
internal/server/handlers_collab_test.go:20
↓ 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 callersMethodDeleteWorkspace
(slug string)
internal/store/workspaces.go:255
↓ 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:655
↓ 10 callersMethodHandle
(_ context.Context, r slog.Record)
internal/store/items_test.go:1671
↓ 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:2372
↓ 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 callersMethodappend
append adds an event to the ring buffer, evicting the oldest if full.
internal/events/bus.go:147
↓ 10 callersFunctionappendToCatalog
appendToCatalog inserts def into Catalog. Called from catalog_<resource>.go init() functions. Keep this small + simple; validation happens at Register
internal/mcp/catalog.go:194
↓ 10 callersFunctionconfigureBootstrapToken
configureBootstrapToken seeds a known token on the server so tests don't depend on the random generator. The on-disk file is created in a temp dir so
internal/server/handlers_auth_bootstrap_token_test.go:34
↓ 10 callersFunctionconnectSSE
connectSSE connects to the SSE endpoint on a real test server and returns a channel of parsed events. Cancel the context to disconnect.
internal/server/handlers_events_test.go:35
↓ 10 callersFunctioncreateBulkTestItem
createBulkTestItem creates a task and returns it.
internal/server/handlers_items_bulk_test.go:15
↓ 10 callersFunctioncreateTestWorkspace
createTestWorkspace creates a workspace via API and returns its slug.
internal/server/handlers_events_test.go:113
↓ 10 callersFunctiondialCollab
dialCollab opens a WebSocket against the test server's collab endpoint with the given itemID. Returns the connection and the HTTP response. The respon
internal/server/handlers_collab_test.go:39
↓ 10 callersFunctiondoArtifactRequest
doArtifactRequest posts a raw (non-JSON) body to an artifact-import endpoint.
internal/server/handlers_artifact_test.go:17
↓ 10 callersFunctionfilterAttention
filterAttention returns attention items of a given type.
internal/server/handlers_dashboard_test.go:1275
↓ 10 callersFunctiongetGraph
helper: fetch the workspace graph and return the parsed response
internal/server/handlers_graph_test.go:12
↓ 10 callersFunctionmapItemCreate
mapItemCreate translates an `item create` MCP call into a POST to api/v1/workspaces/{ws}/collections/{coll}/items. The MCP tool schema (auto-generate
internal/mcp/dispatch_http.go:716
↓ 10 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
↓ 10 callersFunctionnewBackfillTestStore
BackfillOAuthConnections tests (PLAN-1519 / TASK-1522 / IDEA-1517 §2). What's covered: - Pre-TASK-952 session (no key) → all_current=1, no
internal/store/oauth_connections_backfill_test.go:29
↓ 10 callersFunctionnewOAuthConnTestStore
OAuth connection store tests (PLAN-1519 / TASK-1520 — Phase A foundation). What's covered: - CreateOAuthConnection + GetOAuthConnection round-trip w
internal/store/oauth_connections_test.go:35
↓ 10 callersFunctionnewPadServer
newPadServer stands up the same *server.Server that production uses, wired to a fast fixture SQLite store (storetest.NewSQLite, IDEA-1914). Mirrors te
internal/mcp/dispatch_http_test.go:948
↓ 10 callersFunctionnewTestFSStore
(t *testing.T)
internal/attachments/fs_store_test.go:22
↓ 10 callersFunctionnewTestRequest
newTestRequest builds an OAuthRequest with sensible defaults; tests override fields they care about. signature uniqueness is the caller's responsibili
internal/store/oauth_test.go:42
↓ 10 callersFunctionrenderMD
renderMD is a small test helper that builds + renders the synthetic tree with a fixed clock and returns the markdown output as a string.
internal/cmdhelp/md_test.go:18
↓ 10 callersMethodrunOrphanGCSweep
runOrphanGCSweep walks the orphaned-attachments query and reclaims rows past the grace period. Two reclamation paths: - DB row only. content_hash is
internal/server/orphan_gc.go:47
↓ 10 callersFunctionsha256Hex
(b []byte)
internal/attachments/fs_store_test.go:17
← previousnext →201–300 of 6,005, ranked by callers