MCPcopy Create free account

hub / github.com/PerpetualSoftware/pad / functions

Functions6,005 in github.com/PerpetualSoftware/pad

↓ 684 callersMethodString
()
internal/server/token_reaper_test.go:27
↓ 504 callersFunctiontestServer
(t *testing.T)
internal/server/server_test.go:19
↓ 399 callersMethodq
q rebinds a query to the store's dialect (converts "?" to "$1", "$2", etc. for PostgreSQL).
internal/store/store.go:838
↓ 375 callersFunctiontestStore
testStore creates a Store for testing. When PAD_TEST_POSTGRES_URL is set, it creates an isolated PostgreSQL database; otherwise it falls back to a fas
internal/store/store_test.go:21
↓ 323 callersMethodClose
Close shuts down the bus and closes every active subscriber channel. After Close, Subscribe / Publish are undefined; callers must not invoke them.
internal/collab/bus.go:118
↓ 288 callersFunctiondoRequest
(srv *Server, method, path string, body interface{})
internal/server/server_test.go:40
↓ 267 callersMethodScan
(dest ...interface{})
internal/store/api_tokens.go:300
↓ 259 callersMethodJoin
Join attaches a freshly-upgraded WebSocket connection to the room for itemID. Replays the op-log to the new peer, spins up an inbound reader and an ou
internal/collab/manager.go:167
↓ 240 callersFunctionparseJSON
(t *testing.T, rr *httptest.ResponseRecorder, v interface{})
internal/server/server_test.go:64
↓ 233 callersMethodExec
(query string, args ...any)
internal/store/store.go:469
↓ 231 callersMethodNow
Now returns the SQL expression for the current UTC timestamp. SQLite: datetime('now') PostgreSQL: NOW() AT TIME ZONE 'UTC'
internal/store/dialect.go:54
↓ 230 callersFunctioncreateTestWorkspace
(t *testing.T, s *Store, name string)
internal/store/store_test.go:248
↓ 229 callersMethodSet
Set replaces the session workspace. Pass an empty string to clear.
internal/mcp/workspace.go:79
↓ 202 callersFunctionwriteError
(w http.ResponseWriter, status int, code, message string)
internal/server/server.go:1802
↓ 190 callersMethodRun
Run starts the stdio transport on os.Stdin / os.Stdout. It blocks until ctx is cancelled, stdin reaches EOF, or SIGINT / SIGTERM is received. EOF and
internal/mcp/server.go:87
↓ 188 callersMethodGet
Get returns a ReadCloser positioned at the start of the blob. Callers MUST close the returned reader. If key is unknown to this store, the returned er
internal/attachments/store.go:45
↓ 188 callersMethodQuery
(query string, args ...any)
internal/store/items.go:3784
↓ 186 callersFunctionwriteJSON
(w http.ResponseWriter, status int, v interface{})
internal/server/server.go:1795
↓ 184 callersFunctionwriteInternalError
writeInternalError logs the real error server-side and sends a generic message to the client. This prevents leaking SQL errors, file paths, and other
internal/server/server.go:1814
↓ 178 callersMethodServeHTTP
(w http.ResponseWriter, r *http.Request)
internal/server/server.go:1730
↓ 176 callersFunctioncreateWSWithCollections
createWSWithCollections creates a workspace and returns its slug. The workspace will have default collections seeded automatically.
internal/server/handlers_items_test.go:40
↓ 172 callersMethodQueryRow
(query string, args ...any)
internal/store/items.go:2974
↓ 162 callersFunctioncreateTestCollection
--- Collection helpers ---
internal/store/items_test.go:14
↓ 157 callersMethodCreateUser
CreateUser creates a new user with a hashed password.
internal/store/users.go:85
↓ 156 callersMethodError
()
internal/server/handlers_collab.go:509
↓ 153 callersFunctioncreateTestItem
(t *testing.T, s *Store, workspaceID, collectionID, title, content string)
internal/store/items_test.go:26
↓ 146 callersMethodHeader
()
internal/server/handlers_events_test.go:474
↓ 135 callersFunctionbootstrapFirstUser
(t *testing.T, srv *Server, email, name string)
internal/server/handlers_auth_test.go:15
↓ 122 callersFunctiondoRequestWithCookie
doRequestWithCookie is like doRequest but adds a session cookie.
internal/server/handlers_auth_test.go:478
↓ 118 callersMethodCreateWorkspace
(input models.WorkspaceCreate)
internal/store/workspaces.go:68
↓ 114 callersFunctionfixedUserResolver
fixedUserResolver is a tiny helper for the unit tests that need a deterministic user without standing up the auth middleware.
internal/mcp/dispatch_http_test.go:23
↓ 107 callersMethodgetWorkspaceID
getWorkspaceID resolves workspace slug/ID from the request. If RequireWorkspaceAccess already resolved the workspace, reads from context. Otherwise fa
internal/server/server.go:1855
↓ 105 callersFunctionWithDispatchInput
WithDispatchInput returns ctx decorated with the original MCP tool- call JSON input map. Called from the registry's tool handler before invoking Dispa
internal/mcp/dispatch.go:55
↓ 103 callersMethodDispatch
Dispatch satisfies the Dispatcher interface. cliArgs are accepted for interface compatibility but ignored — HTTPHandlerDispatcher reads the structured
internal/mcp/dispatch_http.go:262
↓ 102 callersMethodWriteHeader
(_ int)
internal/server/handlers_events_test.go:481
↓ 100 callersMethodAddWorkspaceMember
AddWorkspaceMember adds a user to a workspace with the given role.
internal/store/workspace_members.go:22
↓ 95 callersFunctionnow
()
internal/store/store.go:846
↓ 93 callersMethodEncode
Encode writes img to w in the given format ("png" / "jpeg"). JPEG is encoded at quality 85 — small enough for thumbnails, high enough that pixel-level
internal/attachments/processor.go:62
↓ 93 callersMethodWrite
(p []byte)
internal/server/token_reaper_test.go:21
↓ 92 callersMethodCreateItem
(workspaceID, collectionID string, input models.ItemCreate)
internal/store/items.go:150
↓ 85 callersFunctiongetClient
()
cmd/pad/main.go:234
↓ 84 callersFunctionparseTime
(s string)
internal/store/store.go:850
↓ 79 callersMethodError
()
internal/store/items.go:1745
↓ 78 callersFunctioncreateTestUser
(t *testing.T, s *Store, email, name, password string)
internal/store/users_test.go:10
↓ 77 callersFunctiontestServerWithAttachments
testServerWithAttachments returns a fresh test server with the attachment registry wired against an FSStore rooted in t.TempDir(), and (on the pure-Go
internal/server/handlers_attachments_test.go:31
↓ 75 callersMethodError
()
internal/cli/client.go:1066
↓ 74 callersFunctioncurrentUser
currentUser returns the authenticated user from the request context, or nil if no user is authenticated.
internal/server/middleware_auth.go:444
↓ 73 callersFunctioncreateItem
helper: create an item in a collection and return the parsed Item
internal/server/handlers_dashboard_test.go:13
↓ 73 callersFunctiongetWorkspace
()
cmd/pad/main.go:243
↓ 67 callersMethodCreateCollection
(workspaceID string, input models.CollectionCreate)
internal/store/collections.go:13
↓ 66 callersMethodGetUser
GetUser retrieves a user by ID.
internal/store/users.go:121
↓ 65 callersMethodGetItem
(id string)
internal/store/items.go:341
↓ 63 callersFunctiondecodeJSON
2 MiB decodeJSON reads and unmarshals the JSON body into v. Wraps the body in http.MaxBytesReader so an attacker can't exhaust memory by POSTing a mul
internal/server/server.go:1831
↓ 62 callersFunctionPrintJSON
PrintJSON prints any value as indented (human-readable) JSON.
internal/cli/format.go:420
↓ 62 callersMethodStat
Stat returns the size in bytes of the blob identified by key. If key is unknown, the returned error wraps ErrNotFound.
internal/attachments/store.go:49
↓ 59 callersFunctionloginTestUser
loginTestUser creates a user + session, returns the user + the raw session token suitable for AddCookie.
internal/server/handlers_oauth_test.go:2359
↓ 58 callersMethodUpdateItem
(id string, input models.ItemUpdate)
internal/store/items.go:1728
↓ 56 callersMethodSetCloudMode
SetCloudMode enables cloud mode with the shared sidecar secret(s). Accepts a comma-separated list of secrets for rotation support: "new-key,old-key" —
internal/server/server.go:420
↓ 54 callersMethodCreateSession
CreateSession generates a random session token, stores its SHA-256 hash, and returns the plaintext token (prefixed with "padsess_"). The plaintext is
internal/store/sessions.go:26
↓ 53 callersMethodListItems
(workspaceID string, params models.ItemListParams)
internal/store/items.go:810
↓ 53 callersFunctionrequireMinRole
requireMinRole checks role and writes a 403 if insufficient. Returns true if the request should continue, false if it was rejected.
internal/server/middleware_auth.go:748
↓ 52 callersFunctionnewID
()
internal/store/store.go:842
↓ 49 callersMethodCreateAPIToken
CreateAPIToken generates a new API token owned by a user, optionally scoped to a workspace. The plaintext token is returned in the response and is nev
internal/store/api_tokens.go:20
↓ 47 callersFunctionNewWorkspaceState
NewWorkspaceState returns a state pre-seeded with `initial`. Pass an empty string to start with no default — the first tool call will then need an exp
internal/mcp/workspace.go:57
↓ 47 callersMethodStop
Stop waits for all background goroutines started via goAsync to finish AND drains the rate-limiter cleanup goroutines spawned at construction time (BU
internal/server/server.go:305
↓ 47 callersFunctionoauthEnabledTestServer
oauthEnabledTestServer builds a Server with cloud mode + a real internal/oauth.Server backed by the test store. Returns the Server so each test can dr
internal/server/handlers_oauth_test.go:54
↓ 47 callersFunctionregisterTestClient
===================================================================== Helpers ===================================================================== re
internal/server/handlers_oauth_test.go:2332
↓ 45 callersMethodError
()
internal/mcp/catalog.go:258
↓ 45 callersMethodGetBacklinks
GetBacklinks returns the items in `workspaceID` that contain a resolved `[[...]]` reference to `targetItemID`. Phase 1 only returns ref-kind backlinks
internal/store/wiki_links.go:902
↓ 45 callersMethodget
( url: string, options?: { headers?: Record<string, string> } )
web/e2e/workspace-bundle-roundtrip.spec.ts:67
↓ 44 callersFunctiondelete
* Soft-delete an attachment by ID. The blob on disk stays put * (content-addressed dedupe means the same hash may still be * referenced) — orpha
web/src/lib/api/client.ts:2129
↓ 42 callersFunctiondoRequestWithHeaders
doRequestWithHeaders is a thin variant of doRequest that lets a test set arbitrary request headers (e.g. Authorization) without spinning up a real aut
internal/server/handlers_items_test.go:19
↓ 41 callersFunctionNewMemoryOpBus
NewMemoryOpBus returns a ready-to-use in-process bus.
internal/collab/memory_bus.go:29
↓ 40 callersFunctionNewClientFromURL
NewClientFromURL creates a client from a full base URL (e.g., "https://app.getpad.dev").
internal/cli/client.go:40
↓ 40 callersMethodvisibleCollectionIDs
visibleCollectionIDs returns the set of collection IDs the current user can see in the given workspace. Returns nil if the user has "all" access (no f
internal/server/server.go:1917
↓ 39 callersMethodClose
Close shuts down the bus. All subscriber channels are closed under the same write-lock that gates Publish/Subscribe so a final inflight Publish can't
internal/collab/memory_bus.go:174
↓ 38 callersMethodGetUserByEmail
GetUserByEmail retrieves a user by email address (case-insensitive).
internal/store/users.go:133
↓ 38 callersFunctionclose
(result: CropResult | null)
web/src/lib/components/editor/attachment-crop-modal.ts:310
↓ 38 callersFunctiondoMultipartUpload
(srv *Server, slug, filename string, body []byte)
internal/server/handlers_attachments_test.go:47
↓ 38 callersFunctionrealPNG
realPNG returns a tiny but real PNG (1x1 transparent) so image.DecodeConfig succeeds.
internal/server/handlers_attachments_test.go:63
↓ 37 callersFunctioncurrentUserID
currentUserID returns the authenticated user's ID, or empty string.
internal/server/middleware_auth.go:506
↓ 36 callersFunctionauditMeta
auditMeta safely marshals a map to a JSON string for audit log metadata. Falls back to "{}" on marshal error so audit calls never break.
internal/server/handlers_documents.go:358
↓ 35 callersFunctiontextOf
textOf returns the text of the first content block, or empty string. Robust to mcp-go's content-type variations (TextContent, ErrorContent).
internal/mcp/catalog_test.go:328
↓ 34 callersMethodRead
(_ []byte)
cmd/pad/templates_picker_test.go:14
↓ 34 callersMethodrequireItemVisible
requireItemVisible checks that the item's collection is visible to the requesting user. For guests with item-level grants, also verifies that the spec
internal/server/server.go:1985
↓ 33 callersMethodGetWorkspaceBySlug
(slug string)
internal/store/workspaces.go:126
↓ 33 callersMethodget
(path string, result interface{})
internal/cli/client.go:1519
↓ 32 callersFunctionBuild
Build returns a cmdhelp Document without serializing it. Callers that need to inspect or further mutate the document (tests, dynamic enum resolvers in
internal/cmdhelp/json.go:83
↓ 32 callersFunctioncreateWSForTest
(t *testing.T, srv *Server)
internal/server/server_test.go:227
↓ 32 callersMethoddelete
(path string)
internal/cli/client.go:1572
↓ 32 callersMethodguestResourceFilter
guestResourceFilter returns the full-collection IDs and granted item IDs for the current user if they need item-level grant filtering. Returns nil/nil
internal/server/server.go:2187
↓ 32 callersFunctions256Challenge
s256Challenge computes the base64url(no-padding, SHA256(verifier)) per RFC 7636 §4.2. PKCE clients use this to derive code_challenge from code_verifie
internal/server/handlers_oauth_test.go:2454
↓ 31 callersMethodDecode
Decode reads bytes from r and returns the decoded image plus the detected format ("png", "jpeg", "gif", "bmp", "tiff", …). The returned format is the
internal/attachments/processor.go:35
↓ 31 callersMethodListCollections
(workspaceID string)
internal/store/collections.go:173
↓ 31 callersFunctiongetDashboard
helper: fetch the dashboard and return the parsed response
internal/server/handlers_dashboard_test.go:25
↓ 30 callersMethodGetCollectionBySlug
(workspaceID, slug string)
internal/store/collections.go:131
↓ 30 callersFunctionNewRoomManager
NewRoomManager wires the store + bus together with production defaults.
internal/collab/manager.go:119
↓ 30 callersFunctionparseTimePtr
(s *string)
internal/store/store.go:855
↓ 30 callersFunctionreadCSRFFromCookie
readCSRFFromCookie hits any consent-rendering endpoint that sets the CSRF cookie on first visit, returns the token. We use oauth/authorize because it'
internal/server/handlers_oauth_test.go:2421
↓ 29 callersFunctionItemRef
ItemRef returns the reference string (e.g. "TASK-5") for an item, or empty string.
internal/cli/format.go:95
next →1–100 of 6,005, ranked by callers