MCPcopy Create free account

hub / github.com/PerpetualSoftware/pad / functions

Functions11,926 in github.com/PerpetualSoftware/pad

↓ 28 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:63
↓ 28 callersMethodSubscribeIfAllowed
SubscribeIfAllowed atomically checks the per-workspace subscriber limit and, only if it is satisfied, subscribes in the same critical section. Return
internal/events/bus.go:235
↓ 28 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
↓ 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
↓ 28 callersFunctionmkUser
(t *testing.T, srv *Server, email string)
internal/server/handlers_storage_delete_authz_test.go:107
↓ 28 callersFunctionparseTimePtr
(s *string)
internal/store/store.go:1201
↓ 28 callersFunctionresolve
(id: string)
web/src/lib/collections/relationGroups.test.ts:57
↓ 27 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
↓ 27 callersMethodaddEventListener
(type: 'toolchange', listener: (ev: Event) => void)
web/src/lib/webmcp/types.d.ts:78
↓ 27 callersMethodattach
attach creates an original attachment in ws and returns it.
internal/store/attachments_copy_plan_test.go:37
↓ 27 callersFunctionnewCrossWSFixture
(t *testing.T)
internal/server/authz_cross_workspace_test.go:50
↓ 27 callersFunctionnewMiniredisBus
(t *testing.T, size int)
internal/watchevents/redis_bus_integration_test.go:28
↓ 27 callersFunctionseedDoc
( fixture: SuiteFixture, request: APIRequestContext, titlePrefix = 'Collab persistence', fields: Record<st
web/e2e/lib/collab-helpers.ts:47
↓ 26 callersMethodDispatch
(ctx context.Context, cmdPath []string, cliArgs []string)
internal/mcp/dispatch.go:40
↓ 26 callersMethodQuery
(query string, args ...any)
internal/store/items.go:4737
↓ 26 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:355
↓ 26 callersFunctionarmReminder
(t *testing.T, s *Store, wsID, itemID, at string)
internal/store/reminders_test.go:26
↓ 26 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
↓ 26 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:568
↓ 26 callersFunctionnewHeartbeatBus
newHeartbeatBus builds a phase-1 bus (recognises heartbeats, publishes none) on a hand-driven clock, with an observer attached.
internal/events/redis_heartbeat_test.go:43
↓ 25 callersMethodAuthorizeCrossWorkspaceEdit
AuthorizeCrossWorkspaceEdit decides whether the caller may WRITE the scoped resource in a workspace OTHER than the request's own. It runs every step
internal/server/authz_cross_workspace.go:509
↓ 25 callersMethodD
D returns the store's dialect for building backend-specific SQL.
internal/store/store.go:229
↓ 25 callersFunctionNewRedisBus
NewRedisBus creates a new Redis-backed EventBus. The provided redis.Client should already be configured and connected.
internal/events/redis_bus.go:803
↓ 25 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. ResolveItem maps a caller
internal/store/items.go:827
↓ 25 callersMethodServeHTTP
(w http.ResponseWriter, r *http.Request)
internal/mcp/dispatch_http_test.go:44
↓ 25 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
↓ 25 callersMethodcurrentGen
NOTE: callerIsGone already exists in this package, added by BUG-2751 for the resume settle path, and is reused here rather than duplicated. Its reason
internal/watchevents/heartbeat.go:515
↓ 25 callersFunctionfetchTimeline
(t *testing.T, srv *Server, wsSlug, itemSlug, query string)
internal/server/handlers_timeline_structured_test.go:49
↓ 25 callersFunctionnewTestRedisBus
(t *testing.T)
internal/events/redis_resume_coverage_test.go:11
↓ 25 callersMethodpost
(path string, body interface{}, result interface{})
internal/cli/client.go:1974
↓ 25 callersMethodrecord
* Claim what is now on screen. Recording a token whose key is null (an * un-addressable view) correctly claims nothing.
web/src/lib/attachments/viewFence.ts:183
↓ 25 callersMethodseed
seed creates an item in `tasks` with the given fields blob, writing it through the STORE so a value the doors would refuse can still be planted. That
internal/server/relation_referents_doors_test.go:96
↓ 25 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
↓ 25 callersFunctionstrPtr
(s string)
internal/store/timeline_pagination_test.go:191
↓ 24 callersMethodBoolToInt
BoolToInt converts a Go bool to a query parameter value. SQLite: 0/1 (integers) PostgreSQL: true/false (native booleans)
internal/store/dialect.go:85
↓ 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 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 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 callersMethodclose
()
web/src/lib/services/sseFirstConnectSync.svelte.test.ts:42
↓ 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
↓ 24 callersFunctionerrCode
(t *testing.T, rr *httptest.ResponseRecorder)
internal/server/handlers_items_copy_preflight_test.go:216
↓ 24 callersFunctionnowTS
nowTS is the instant a tick would pass in. Taken well after `past` and well before `future`, so the two fixtures sit on opposite sides of it with no d
internal/store/reminders_test.go:44
↓ 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 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 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
↓ 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 callersMethodValue
()
internal/store/nulguard_test.go:628
↓ 23 callersFunctioncreateTestWorkspace
createTestWorkspace creates a workspace via API and returns its slug.
internal/server/handlers_events_test.go:118
↓ 23 callersFunctionhandler
(e: Event)
web/src/lib/components/items/ItemPicker.svelte.test.ts:855
↓ 23 callersFunctionnewCopyRelationFixtureWith
newCopyRelationFixtureWith builds the relation fixture with two knobs the default constructor does not need: a `default` on the DESTINATION's relation
internal/server/handlers_items_copy_relation_test.go:308
↓ 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
↓ 23 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:3185
↓ 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 callersMethodResolveItemIncludeDeleted
ResolveItemIncludeDeleted is like ResolveItem but includes soft-deleted items.
internal/store/items.go:870
↓ 22 callersMethodcall
call issues the preflight exactly as the router would, with the caller's auth surface described by o. The workspace-A role and resolved ID are stashed
internal/server/handlers_items_copy_preflight_test.go:126
↓ 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 callersFunctionisolatedTestClient
isolatedTestClient returns an HTTP client with a transport of its own. Outbound requests in this package's tests go through it — or through the httpte
internal/server/isolated_client_test.go:55
↓ 22 callersMethodmember
(email, username, wsRole string, ws *models.Workspace)
internal/server/authz_cross_workspace_test.go:123
↓ 22 callersFunctionwaitElectable
waitElectable polls until the room for itemID has at least n conns that pickApplier would actually elect — writable, anchored (replayDone), not frozen
internal/collab/manager_test.go:306
↓ 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
( cmdInfo cmdhelp.Command, input map[string]any, sessionWorkspace string, rootFlags map[string]string, )
internal/mcp/dispatch.go:406
↓ 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:451
↓ 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 callersFunctionNew
(s *store.Store)
internal/server/server.go:518
↓ 21 callersFunctionNewMemorySessionPresence
NewMemorySessionPresence returns an empty in-process registry.
internal/server/session_presence.go:343
↓ 21 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
↓ 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:3859
↓ 21 callersMethodStart
Start begins probing in the background. It runs one probe SYNCHRONOUSLY before returning, so a server that has finished starting has a real answer rat
internal/server/redis_health.go:142
↓ 21 callersFunctionargsContainPair
(args []string, flag, value string)
internal/mcp/catalog_item_fields_test.go:73
↓ 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 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 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
↓ 21 callersMethodreq
()
internal/store/items_cross_workspace_copy_test.go:47
↓ 21 callersFunctionvalidationFailedResult
───────────────────────────────────────────────────────────────────── Helpers for non-HTTP error paths (TASK-1077 — replace plain-string NewToolResult
internal/mcp/errors.go:1306
↓ 21 callersFunctionworkspaceRole
workspaceRole returns the user's role in the current workspace, as set by RequireWorkspaceAccess. Returns empty string if not set.
internal/server/middleware_auth.go:752
↓ 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 callersMethodMigrateRelationReferents
MigrateRelationReferents is the ONE decision the four migrate doors share (PLAN-2857 U1 / TASK-2878). Same-workspace move, bulk move, cross-workspace
internal/store/relation_referents.go:1252
↓ 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 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 callersFunctionParseCollectionTraits
ParseCollectionTraits decodes a stored traits JSON blob. An empty or "null" blob yields the zero value with no error — a collection that declares no t
internal/models/collection_traits.go:176
↓ 20 callersMethodResolveRelationReferents
ResolveRelationReferents canonicalises every `relation` value in fieldMap to the target item's ID and reports the ones that cannot be resolved. It MU
internal/store/relation_referents.go:202
↓ 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 callersMethodcallCopy
Tests for the mutating cross-workspace copy (PLAN-2357 / TASK-2365). The fixture is the PREFLIGHT's, deliberately and not for convenience: the headli
internal/server/handlers_items_copy_test.go:50
↓ 20 callersFunctioncontextWithResolvedWorkspaceIDForTest
(ctx context.Context, wsID string)
internal/server/authz_cross_workspace_test.go:23
↓ 20 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:40
↓ 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 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
↓ 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
← previousnext →201–300 of 11,926, ranked by callers