MCPcopy Create free account

hub / github.com/PerpetualSoftware/pad / functions

Functions6,005 in github.com/PerpetualSoftware/pad

↓ 29 callersMethodSetMemberCollectionAccess
SetMemberCollectionAccess updates a member's collection_access mode and replaces their specific collection grants atomically.
internal/store/workspace_members.go:252
↓ 29 callersFunctionisCollectionVisible
isCollectionVisible checks if a collection ID is in the visible set. If visibleIDs is nil, all collections are visible.
internal/server/server.go:2246
↓ 29 callersFunctionnewRestrictedOwnerVisibilityFixture
(t *testing.T)
internal/server/handlers_grant_visibility_test.go:33
↓ 29 callersFunctionrefOf
refOf builds a PREFIX-NUMBER string from a fresh item — used by the integration tests since the canonical ref isn't on the model directly. ItemNumber
internal/store/wiki_links_test.go:543
↓ 28 callersMethodDriver
Driver returns the driver type.
internal/store/dialect.go:20
↓ 28 callersFunctionerrorHandler
errorHandler fails the test if invoked. Used to assert that a code path doesn't hit the handler at all.
internal/mcp/dispatch_http_advanced_test.go:891
↓ 27 callersMethodDB
DB returns the underlying *sql.DB (for use in migrations/testing).
internal/store/store.go:75
↓ 27 callersMethodSet
Set adds or replaces the credential for the given server URL. The canonical URL is mirrored into the value's ServerURL field so a caller reading the c
internal/cli/credentials.go:185
↓ 27 callersFunctioncancel
()
web/src/lib/items/contentSaver.svelte.ts:68
↓ 27 callersFunctionliveCmdhelpDoc
liveCmdhelpDoc returns a minimal cmdhelp.Document with every command path the read-only catalog references. Lighter than re-running pad's full cobra e
internal/mcp/catalog_readonly_test.go:430
↓ 26 callersFunctionNew
New creates a new Metrics instance with a custom registry and registers all application metrics plus Go runtime and process collectors.
internal/metrics/metrics.go:60
↓ 26 callersFunctionnewTransitionTestWorkspace
(t *testing.T, s *Store)
internal/store/status_transitions_test.go:48
↓ 25 callersFunctioncloudAdminReq
cloudAdminReq is a small helper that builds a request with optional JSON body and the caller-chosen headers.
internal/server/cloud_admin_gate_test.go:19
↓ 25 callersFunctionnewCollabTestServer
newCollabTestServer wires up an httptest server whose only handler upgrades the inbound WS, registers it with the manager, and waits for the session t
internal/collab/manager_test.go:240
↓ 24 callersMethodGetWorkspaceMember
GetWorkspaceMember retrieves a single membership record.
internal/store/workspace_members.go:82
↓ 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:141
↓ 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:2379
↓ 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 callersFunctionNew
New creates a new in-memory EventBus with default replay buffer settings.
internal/events/bus.go:224
↓ 22 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:728
↓ 22 callersFunctiondialWS
(t *testing.T, server *httptest.Server, itemID string)
internal/collab/manager_test.go:265
↓ 21 callersMethodBoolToInt
BoolToInt converts a Go bool to a query parameter value. SQLite: 0/1 (integers) PostgreSQL: true/false (native booleans)
internal/store/dialect.go:69
↓ 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 callersMethodDeleteItem
DeleteItem soft-deletes the item by stamping deleted_at and bumping the workspace-scoped seq so delta-sync clients see the tombstone. The seq bump use
internal/store/items.go:2331
↓ 21 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:228
↓ 21 callersFunctionactorFromRequest
actorFromRequest derives actor and source from the request's auth context. Actor is "user" or "agent" (determined by X-Pad-Agent header). Source is "w
internal/server/handlers_documents.go:250
↓ 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 callersMethodset
(workspaceID string, info *store.WorkspaceStorageInfo)
internal/server/handlers_storage.go:77
↓ 20 callersMethodCreateCollectionGrant
--- Collection Grants --- CreateCollectionGrant creates a direct grant on a collection for a user.
internal/store/grants.go:13
↓ 20 callersMethodCreateItemLink
--- Item Links ---
internal/store/items.go:2551
↓ 20 callersMethodCreateOAuthClient
============================================================ Clients (RFC 7591 — Dynamic Client Registration) ========================================
internal/store/oauth.go:79
↓ 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 callersMethodResolve
Resolve returns the store responsible for key, or an error if no matching backend is registered. The key format is "<prefix>:<rest>".
internal/attachments/registry.go:48
↓ 20 callersMethodlogAuditEvent
logAuditEvent logs a non-workspace audit event (e.g. login, logout). Best-effort: errors are silently ignored.
internal/server/handlers_documents.go:333
↓ 20 callersFunctionloginUser
(t *testing.T, srv *Server, email, password string)
internal/server/handlers_rbac_test.go:92
↓ 20 callersFunctionworkspaceIDForSlug
workspaceIDForSlug looks up the internal UUID for a slug — used by tests that synthesize attachment rows directly via the store (bypassing the upload
internal/server/handlers_storage_test.go:425
↓ 19 callersMethodBaseURL
BaseURL returns the configured base URL.
internal/email/sender.go:94
↓ 19 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
↓ 19 callersMethodGetAttachment
GetAttachment returns the attachment with the given id, or (nil, nil) if no such row exists. Soft-deleted rows ARE returned (so download handlers can
internal/store/attachments.go:98
↓ 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 callersMethodpost
(path string, body interface{}, result interface{})
internal/cli/client.go:1532
↓ 19 callersFunctionvalidationFailedResult
───────────────────────────────────────────────────────────────────── Helpers for non-HTTP error paths (TASK-1077 — replace plain-string NewToolResult
internal/mcp/errors.go:1230
↓ 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 callersMethodRebind
Rebind converts a query with "?" placeholders to the dialect's format. For SQLite this is a no-op. For PostgreSQL, "?" becomes "$1", "$2", etc.
internal/store/dialect.go:28
↓ 18 callersMethodServeHTTP
(w http.ResponseWriter, r *http.Request)
internal/mcp/dispatch_http_test.go:44
↓ 18 callersMethodaddEventListener
(type: 'toolchange', listener: (ev: Event) => void)
web/src/lib/webmcp/types.d.ts:78
↓ 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 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
↓ 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:340
↓ 18 callersFunctionrequireAdmin
--- Helpers ---
internal/server/handlers_admin_users.go:844
↓ 18 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:2343
↓ 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 callersMethodGetPlatformSetting
GetPlatformSetting returns a single platform setting value, or empty string if not set.
internal/store/platform_settings.go:6
↓ 17 callersMethodGetReport
GetReport computes the windowed project report for a workspace.
internal/store/reports.go:197
↓ 17 callersMethodResolveItemIncludeDeleted
ResolveItemIncludeDeleted is like ResolveItem but includes soft-deleted items.
internal/store/items.go:531
↓ 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:472
↓ 17 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:41
↓ 17 callersFunctiondispatcherErrorResult
dispatcherErrorResult wraps an internal dispatcher failure (build request, encode body, parse response, marshal merged fields, etc.) into the structur
internal/mcp/errors.go:1248
↓ 17 callersFunctionstrPtr
(s string)
internal/store/timeline_pagination_test.go:186
↓ 17 callersFunctiontestStoreOAuth
Tests for the OAuth server constructor + audience strategy + storage adapter (PLAN-943 TASK-951 sub-PR B). Each layer is covered: - NewServer: requir
internal/oauth/server_test.go:40
↓ 16 callersMethodCreateAccessToken
============================================================ Access tokens (handler/oauth2/storage.go AccessTokenStorage) ============================
internal/store/oauth.go:310
↓ 16 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
↓ 16 callersMethodPublish
Publish sends an event to all subscribers for the event's workspace.
internal/events/bus.go:112
↓ 16 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:488
↓ 16 callersMethodSetParentLink
--- Phase Links --- SetParentLink sets the parent for an item. Since an item can belong to at most one parent, this deletes any existing parent link f
internal/store/items.go:2832
↓ 16 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:435
↓ 16 callersFunctioncreateTestDoc
(t *testing.T, s *Store, workspaceID, title, content string)
internal/store/store_test.go:257
↓ 15 callersMethodClose
Close stops every active room AND blocks until every in-flight Join goroutine has returned. After Close, Join is undefined — callers must coordinate s
internal/collab/manager.go:792
↓ 15 callersMethodCreateAttachment
CreateAttachment inserts an attachment row. id and created_at are generated by the store. The caller is expected to have already written the blob via
internal/store/attachments.go:68
↓ 15 callersMethodCreateItemGrant
--- Item Grants --- CreateItemGrant creates a direct grant on an item for a user.
internal/store/grants.go:101
↓ 15 callersFunctionDefaultConfig
()
internal/config/config.go:89
↓ 15 callersMethodGetCollection
(id string)
internal/store/collections.go:63
↓ 15 callersFunctionGetTemplate
GetTemplate returns the workspace template with the given name, or nil if no template with that name exists.
internal/collections/templates.go:907
↓ 15 callersMethodJSONExtractText
JSONExtractText returns SQL to extract a text value from a JSON column. SQLite: json_extract(col, '$.key') PostgreSQL: col->>'key'
internal/store/dialect.go:33
↓ 15 callersFunctionNewProcessor
NewProcessor returns the Processor compiled into this binary. Pure-Go build → pureGoProcessor. libvips build → vipsProcessor (Phase 2). Constructed o
internal/attachments/processor_purego.go:43
↓ 15 callersMethodSeedDefaultCollections
SeedDefaultCollections rescues a workspace that ended up with zero collections by seeding it with the standard Software-shape Defaults(). It is intent
internal/store/collections.go:467
↓ 15 callersMethodUserCount
UserCount returns the total number of registered users.
internal/store/users.go:573
↓ 15 callersMethodbearerHeaders
()
internal/server/handlers_grant_visibility_test.go:104
↓ 15 callersMethodbearerHeaders
()
internal/server/handlers_items_test.go:2624
↓ 15 callersFunctionpostOAuthForm
postOAuthForm POSTs an x-www-form-urlencoded body without any auth (used for /oauth/revoke + /oauth/token, where client_id rides in the form for publi
internal/server/handlers_oauth_test.go:2537
↓ 15 callersFunctionrunAuthCodeFlow
runAuthCodeFlow drives a full /oauth/authorize/decide → /oauth/token exchange and returns the parsed token JSON. Each invocation needs a unique verifi
internal/server/handlers_oauth_test.go:2473
↓ 15 callersFunctionseedParentAndChildren
seedParentAndChildren creates a plan + N child tasks with the given statuses (one per child), returning the parent and the slice of child refs in crea
internal/server/handlers_items_open_children_guard_test.go:24
↓ 14 callersMethodApply
Apply walks doc and stamps EnumSource + resolved Enum values on matching args and flags. Resolution failures are silent: the document continues to adv
internal/cmdhelp/dynamic.go:113
↓ 14 callersFunctionNewStorage
NewStorage wraps a *store.Store as a fosite-compatible adapter. The store must be a fully-initialized pad store (migrations applied); no validation he
internal/oauth/storage.go:129
↓ 14 callersMethodSeedCollectionsFromTemplate
SeedCollectionsFromTemplate seeds the workspace with collections from the named template. An empty template name materializes the default collections
internal/store/collections.go:503
↓ 14 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
↓ 14 callersFunctiondoRequestWithBearer
doRequestWithBearer dispatches a request with an Authorization: Bearer header set. The existing test helpers in server_test.go don't take a token para
internal/server/middleware_auth_public_paths_test.go:25
↓ 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:498
↓ 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
↓ 14 callersFunctiontestServerWithEvents
(t *testing.T)
internal/server/handlers_events_test.go:20
↓ 13 callersMethodAppendYjsUpdate
(itemID string, data []byte, schemaVersion string)
internal/collab/room.go:134
↓ 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:120
↓ 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
← previousnext →101–200 of 6,005, ranked by callers