MCPcopy Create free account

hub / github.com/PerpetualSoftware/pad / functions

Functions9,998 in github.com/PerpetualSoftware/pad

↓ 24 callersMethodCreateCollectionGrant
--- Collection Grants --- CreateCollectionGrant creates a direct grant on a collection for a user.
internal/store/grants.go:13
↓ 24 callersFunctionDefaultConfig
()
internal/config/config.go:291
↓ 24 callersFunctionNew
New creates a Store backed by SQLite at the given path. The DSN is configured for safe concurrent use under Go's connection pool: - `_pragma=busy_ti
internal/store/store.go:216
↓ 24 callersMethodSubscribeAndReplaySince
SubscribeAndReplaySince atomically subscribes AND captures every buffered notification with ID > sinceID, under the SAME lock (codex round 1 finding 3
internal/watchevents/watchevents.go:270
↓ 24 callersMethodaddEventListener
(type: 'toolchange', listener: (ev: Event) => void)
web/src/lib/webmcp/types.d.ts:78
↓ 24 callersFunctionassertDenied
(t *testing.T, got CrossWorkspaceAccess, want CrossWorkspaceDenialReason, label string)
internal/server/authz_cross_workspace_test.go:176
↓ 24 callersFunctionbearerCall
(t *testing.T, srv *Server, method, path, token string, body []byte)
internal/server/handlers_watches_test.go:62
↓ 24 callersFunctionclassifyHTTPStatus
classifyHTTPStatus is the legacy entry point preserved for callers that don't know their resource kind. New callers should use classifyHTTPStatusKind
internal/mcp/errors.go:804
↓ 24 callersFunctionconnectWatchStream
connectWatchStream connects to GET /api/v1/events/stream with a Bearer token and returns a channel of parsed SSE events. UNARMED — the S1 legacy shape
internal/server/handlers_watch_events_test.go:37
↓ 24 callersFunctiondoAuthedRequest
doAuthedRequest is like doRequest but with a session cookie + the matching User-Agent attached (SessionAuth UA-binding, see middleware_auth.go:186).
internal/server/handlers_oauth_test.go:2473
↓ 24 callersFunctionemptyPreflight
emptyPreflight is the everything-is-zero case. Its whole job is to prove "nothing to report" renders as an explicit zero rather than as silence.
cmd/pad/item_copy_test.go:65
↓ 23 callersMethodCreateActivity
(a models.Activity)
internal/store/activities.go:65
↓ 23 callersMethodCreateActivityDebounced
A non-nil error is always paired with an EMPTY id (BUG-2779). Neither this function nor CreateActivity returns a usable-looking handle beside a failur
internal/store/activities.go:100
↓ 23 callersMethodCreateComment
CreateComment adds a new comment to an item. userID is the authenticated user authoring the comment (empty for agent/system comments); it's stored as
internal/store/comments.go:18
↓ 23 callersFunctionCrossWorkspaceItemScope
CrossWorkspaceItemScope scopes the check to one already-loaded item. Collection visibility is checked first and item-level grants second, in that orde
internal/server/authz_cross_workspace.go:338
↓ 23 callersFunctionNewErrorResult
NewErrorResult packages an ErrorPayload as an MCP CallToolResult with IsError=true. Both the JSON envelope and a human-readable summary are returned:
internal/mcp/errors.go:253
↓ 23 callersMethodServeHTTP
(w http.ResponseWriter, r *http.Request)
internal/mcp/dispatch_http_test.go:44
↓ 23 callersMethodclose
()
web/src/lib/services/sseFirstConnectSync.svelte.test.ts:42
↓ 23 callersFunctioncreateTestWorkspace
createTestWorkspace creates a workspace via API and returns its slug.
internal/server/handlers_events_test.go:113
↓ 23 callersFunctionmustSchemaCollection
(t *testing.T, srv *Server, wsID, name, schema string)
internal/server/handlers_items_copy_preflight_test.go:113
↓ 23 callersFunctionoutboxEventsFor
Tests for the transactional event outbox (SPEC-3 §choke point, TASK-2658). The load-bearing case here is the DISJOINT-DELTA RULE (SPEC-3 v1.3): canon
internal/store/event_outbox_test.go:25
↓ 22 callersMethodD
D returns the store's dialect for building backend-specific SQL.
internal/store/store.go:147
↓ 22 callersMethodGetCollection
(id string)
internal/store/collections.go:177
↓ 22 callersMethodIsEmailVerified
IsEmailVerified returns true if the user's email address has been verified. Mirrors IsDisabled: a non-empty EmailVerifiedAt timestamp means verified,
internal/models/user.go:42
↓ 22 callersMethodfanOutLocally
gen is the subscription this notification arrived on, or currentGen() for a caller that is not the receive loop. CHECKED HERE, under the lock that AP
internal/watchevents/redis_bus.go:1442
↓ 22 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:532
↓ 22 callersMethodmember
(email, username, wsRole string, ws *models.Workspace)
internal/server/authz_cross_workspace_test.go:123
↓ 22 callersFunctionseedDoc
( fixture: SuiteFixture, request: APIRequestContext, titlePrefix = 'Collab persistence', fields: Record<st
web/e2e/lib/collab-helpers.ts:47
↓ 21 callersMethodAuthorizeCrossWorkspaceRead
AuthorizeCrossWorkspaceRead decides whether the caller may READ the scoped resource in a workspace OTHER than the request's own. workspaceSlugOrID ma
internal/server/authz_cross_workspace.go:459
↓ 21 callersMethodBaseURL
BaseURL returns the configured base URL.
internal/email/sender.go:94
↓ 21 callersFunctionBuildCLIArgs
BuildCLIArgs translates an MCP tool call's JSON arguments into the CLI argument list that should be appended after the command path. Pure function — n
internal/mcp/dispatch.go:362
↓ 21 callersMethodCopyItemAcrossWorkspaces
CopyItemAcrossWorkspaces copies one item from its workspace into another, atomically. THE LOCK ORDER. Changed only deliberately, and stated here beca
internal/store/items_cross_workspace_copy.go:428
↓ 21 callersFunctionCrossWorkspaceCollectionScope
CrossWorkspaceCollectionScope scopes the check to one collection — creating into it, or disclosing its schema. Visibility here is FULL-collection-acc
internal/server/authz_cross_workspace.go:354
↓ 21 callersFunctionGetTemplate
GetTemplate returns the workspace template with the given name, or nil if no template with that name exists.
internal/collections/templates.go:1051
↓ 21 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
↓ 21 callersMethodQueryRow
(query string, args ...any)
internal/store/items.go:3549
↓ 21 callersFunctionbuildSyntheticTree
buildSyntheticTree returns a small cobra tree exercising the shapes the emitter has to handle: subgroups, leaf commands with positional args, flags of
internal/cmdhelp/json_test.go:26
↓ 21 callersMethodcycleIdleSubscriptions
cycleIdleSubscriptions ends coverage for every workspace whose subscription has received nothing for idleTimeout, and REPLACES that subscription. DRO
internal/events/redis_heartbeat.go:464
↓ 21 callersFunctionloginUser
(t *testing.T, srv *Server, email, password string)
internal/server/handlers_rbac_test.go:92
↓ 21 callersFunctionnewCopyFixture
(t *testing.T)
internal/store/items_cross_workspace_copy_test.go:34
↓ 21 callersFunctionnewHeartbeatBus
(t *testing.T, publishHeartbeat bool)
internal/watchevents/heartbeat_test.go:37
↓ 21 callersMethodpost
(path string, body interface{}, result interface{})
internal/cli/client.go:1929
↓ 21 callersMethodreq
()
internal/store/items_cross_workspace_copy_test.go:47
↓ 21 callersMethodrequireEditPermission
requireEditPermission checks if the user has edit access to the given item. For regular members (editor/owner), this uses the standard role check. For
internal/server/server.go:2761
↓ 21 callersFunctionvalidationFailedResult
───────────────────────────────────────────────────────────────────── Helpers for non-HTTP error paths (TASK-1077 — replace plain-string NewToolResult
internal/mcp/errors.go:1306
↓ 20 callersMethodCreateOAuthClient
============================================================ Clients (RFC 7591 — Dynamic Client Registration) ========================================
internal/store/oauth.go:79
↓ 20 callersMethodCreateOAuthConnection
CreateOAuthConnection inserts a new connection row. Idempotent in the sense that callers should INSERT once per /authorize/decide; if the same request
internal/store/oauth_connections.go:216
↓ 20 callersMethodGetDocument
(id string)
internal/store/documents.go:217
↓ 20 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:195
↓ 20 callersFunctionNewMemorySessionPresence
NewMemorySessionPresence returns an empty in-process registry.
internal/server/session_presence.go:343
↓ 20 callersFunctionNewSession
NewSession constructs a Session with the given subject (pad user ID). Returns a non-nil DefaultSession so the embedded methods don't panic on a zero-v
internal/oauth/session.go:49
↓ 20 callersMethodResolveItem
ResolveItem looks up an item by UUID, PREFIX-NUMBER ref (e.g. "IDEA-15"), or slug. UUID is tried first, then ref, then slug.
internal/store/items.go:714
↓ 20 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
↓ 20 callersFunctiondispatcherErrorResult
dispatcherErrorResult wraps an internal dispatcher failure (build request, encode body, parse response, marshal merged fields, etc.) into the structur
internal/mcp/errors.go:1324
↓ 20 callersMethodlogAuditEvent
logAuditEvent logs a non-workspace audit event (e.g. login, logout). Best-effort: errors are silently ignored.
internal/server/handlers_documents.go:438
↓ 20 callersFunctionwatchNotificationVisible
watchNotificationVisible decides whether a Notification should be delivered to a caller holding the given watch map. Extracted from the handler so the
internal/server/handlers_watch_events.go:608
↓ 19 callersFunctionLoadStore
LoadStore reads the credentials file and returns a usable CredentialStore. Returns an empty (but non-nil) store if the file doesn't exist — that's not
internal/cli/credentials.go:96
↓ 19 callersMethodResolveItemIncludeDeleted
ResolveItemIncludeDeleted is like ResolveItem but includes soft-deleted items.
internal/store/items.go:757
↓ 19 callersMethodUserCount
UserCount returns the total number of registered users.
internal/store/users.go:578
↓ 19 callersFunctionValidateFields
ValidateFields checks field values against the collection schema. It validates required fields are present, types are correct, and select values are w
internal/items/validate.go:78
↓ 19 callersFunctionequalSlice
equalSlice is a small helper for stable []string comparison; kept here so test files across the package can share it. catalog_test.go has equalString
internal/mcp/registry_test.go:188
↓ 19 callersFunctionerrCode
(t *testing.T, rr *httptest.ResponseRecorder)
internal/server/handlers_items_copy_preflight_test.go:216
↓ 19 callersFunctionnewGCClaimFixture
(t *testing.T)
internal/store/attachments_gc_claim_test.go:23
↓ 19 callersFunctionnewLocalOnlyBus
newLocalOnlyBus builds a RedisBus without starting its subscription, for the tests that exercise the local fan-out path directly. Constructing through
internal/watchevents/redis_bus_test.go:55
↓ 19 callersFunctionregistryEnv
registryEnv gives a test a fresh HOME (so ~/.pad/sessions is empty) and a clean session environment, returning the sessions dir.
internal/cli/session_registry_test.go:18
↓ 19 callersFunctionrender
()
web/src/lib/components/timeline/ItemTimeline.svelte.test.ts:218
↓ 19 callersMethodsnapshot
()
internal/events/observer_test.go:109
↓ 19 callersFunctionstrPtr
(s string)
internal/store/timeline_pagination_test.go:186
↓ 18 callersFunctionEncode
Encode serializes an Artifact to its portable on-disk form: --- <yaml frontmatter> --- <body> Output is deterministic: two Encode calls on the
internal/artifact/encode.go:23
↓ 18 callersMethodGetOAuthConnection
GetOAuthConnection fetches the connection row by request_id. Returns ErrOAuthConnectionNotFound if no row exists; any other error is a real I/O failur
internal/store/oauth_connections.go:106
↓ 18 callersMethodGetReport
GetReport computes the windowed project report for a workspace.
internal/store/reports.go:180
↓ 18 callersMethodListDocumentActivity
(documentID string, params models.ActivityListParams)
internal/store/activities.go:741
↓ 18 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:41
↓ 18 callersMethodSave
Save writes the persisted Pad config to disk.
internal/config/config.go:522
↓ 18 callersMethodSeedCollectionsFromTemplate
SeedCollectionsFromTemplate seeds the workspace with collections from the named template. An empty template name materializes the default collections
internal/store/collections.go:872
↓ 18 callersMethodUnsubscribe
Unsubscribe removes a local subscriber and closes its channel. Cancels the Redis subscription if this was the last local subscriber for the workspace.
internal/events/redis_bus.go:1251
↓ 18 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
↓ 18 callersFunctionassertAllowed
(t *testing.T, got CrossWorkspaceAccess, label string)
internal/server/authz_cross_workspace_test.go:186
↓ 18 callersMethodbearerHeaders
()
internal/server/handlers_items_test.go:2626
↓ 18 callersMethodbuildAuthedRequest
( ctx context.Context, method, urlPath string, body []byte, user *models.User, )
internal/mcp/dispatch_http.go:584
↓ 18 callersFunctionclientIP
clientIP extracts the client IP from RemoteAddr. This is safe because TrustedProxyRealIP runs earlier in the chain and — when a trusted proxy is confi
internal/server/middleware_ratelimit.go:532
↓ 18 callersFunctionconnectedAppsTestServer
Connected-apps handler tests (PLAN-943 TASK-954). What's covered: - GET /api/v1/connected-apps requires cloud mode (404 outside). - List returns onl
internal/server/handlers_connected_apps_test.go:50
↓ 18 callersFunctioncreateViaTx
Tests for createItemTx — the tx-taking counterpart of CreateItem (PLAN-2357 / DR-9a). Each test below pins one line of the DR-9a parity checklist: slu
internal/store/items_create_tx_test.go:22
↓ 18 callersMethodlogAuditEventForUser
logAuditEventForUser logs an audit event with an explicit user ID. Use this when the user isn't (yet) in the request context, e.g. after a successful
internal/server/handlers_documents.go:445
↓ 18 callersFunctionrequireAdmin
--- Helpers ---
internal/server/handlers_admin_users.go:844
↓ 18 callersMethodseedNeverAttached
seedNeverAttached inserts a never-attached attachment row aged past any grace cutoff a test will use.
internal/store/attachments_gc_claim_test.go:42
↓ 18 callersFunctionsessionCookieName
sessionCookieName returns the session cookie name. When running over TLS (secureCookies=true), the __Host- prefix is used to prevent subdomain cookie
internal/server/handlers_auth.go:45
↓ 18 callersFunctionsetupRBACEnv
(t *testing.T)
internal/server/handlers_rbac_test.go:24
↓ 17 callersMethodAppendYjsUpdate
(itemID string, data []byte, schemaVersion string)
internal/collab/room.go:232
↓ 17 callersMethodApplyExternalContent
ApplyExternalContent routes an external content update through a designated applier when an active room exists. Returns nil on success; one of the sen
internal/collab/applier.go:242
↓ 17 callersFunctionNew
(s *store.Store)
internal/server/server.go:482
↓ 17 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
↓ 17 callersMethodSetCloudSidecar
SetCloudSidecar installs the reverse pad → pad-cloud client. Called from cmd/pad/main.go when PAD_CLOUD_SIDECAR_URL + PAD_CLOUD_SECRET are set. When u
internal/server/server.go:609
↓ 17 callersFunction__resetViewerBackdropForTests
()
web/src/lib/a11y/viewerBackdrop.ts:496
↓ 17 callersFunctionactorNameFromRequest
actorNameFromRequest returns the authenticated user's display name, or empty string.
internal/server/handlers_documents.go:345
↓ 17 callersFunctionclassifyExecError
classifyExecError turns an exec.Cmd failure (err + stderr) into a structured envelope. lookup is optional — when supplied, no_workspace errors get ava
internal/mcp/errors.go:490
↓ 17 callersMethodcreateLink
createLink mints a share link for the fixture's item or collection.
internal/server/handlers_share_attachments_test.go:182
↓ 17 callersFunctioncreateTaskWithFields
createTaskWithFields is a small helper for the field-patch/OCC tests: POST a task with the given fields JSON and return the created item.
internal/server/handlers_items_fieldpatch_test.go:13
↓ 17 callersFunctionmustItem
(t *testing.T, srv *Server, wsID, collID, title string)
internal/server/authz_cross_workspace_test.go:114
↓ 17 callersMethodnewRequest
newRequest creates an http.Request with auth and agent headers set.
internal/cli/client.go:1902
← previousnext →201–300 of 9,998, ranked by callers