MCPcopy Create free account

hub / github.com/PerpetualSoftware/pad / functions

Functions31,743 in github.com/PerpetualSoftware/pad

↓ 9 callersMethodCreateUnclaimedUser
CreateUnclaimedUser creates an unclaimed account. It is the ONLY door that writes an address in the unclaimed domain: agent+<id>@unclaimed.pad.invalid
internal/store/agent_signups.go:58
↓ 9 callersFunctionCurrentUserFromContext
CurrentUserFromContext returns the user attached by WithCurrentUser (or by the standard auth middleware), and a boolean signalling whether one was pre
internal/server/context.go:74
↓ 9 callersFunctionDecodeFieldsJSON
DecodeFieldsJSON decodes an item's fields blob with every number kept as the literal it was written as (a json.Number), for code that decodes a blob i
internal/models/fields_json.go:32
↓ 9 callersFunctionDefaultNotificationSettings
DefaultNotificationSettings is what a user with no settings row has: every kind on, agent activity off.
internal/models/notification_settings.go:18
↓ 9 callersMethodDeleteDocument
(id string)
internal/store/documents.go:1109
↓ 9 callersMethodDeleteReminder
DeleteReminder uses the checked commitment deletion under the same locks and expected alarm identity as rearm and acknowledgement.
internal/store/reminder_commitment.go:225
↓ 9 callersMethodDeliverAppEvent
DeliverAppEvent delivers one app event to one app hook, synchronously, with the owner path's retry schedule (maxDeliveryAttempts, linear backoff on co
internal/webhooks/app_delivery.go:133
↓ 9 callersMethodEffectivePlan
EffectivePlan is the plan entitlement is decided from: the stored plan, "free" when it is empty, and "free" once its expiry has passed (BUG-3356). The
internal/models/user.go:130
↓ 9 callersMethodEnsureEncryptionKey
EnsureEncryptionKey makes sure the server has a usable encryption key without requiring the operator to set one explicitly. Resolution order: 1. If c
internal/config/config.go:1141
↓ 9 callersMethodError
()
internal/billing/cloud_client.go:104
↓ 9 callersFunctionExtractItemConventionMetadata
(fieldsJSON string)
internal/models/item.go:857
↓ 9 callersMethodFetch
Fetch performs a GET against rawURL, re-validating every redirect hop and aborting if the response exceeds the size cap. Returns a wrapped error suita
internal/urlimport/fetch.go:118
↓ 9 callersMethodGetItemByRef
GetItemByRef looks up a live item by PREFIX-NUMBER. A prefix miss resolves through an immutable ref alias or a durable move-log entry naming a former
internal/store/items.go:957
↓ 9 callersMethodGetItemContentFlushedOpLogID
GetItemContentFlushedOpLogID returns the value of items.content_flushed_op_log_id for an item — the highest op-log id known to be reflected in items.c
internal/store/yjs_updates.go:487
↓ 9 callersMethodGetItemLease
GetItemLease returns the item's live lease, or nil — absent and expired are indistinguishable on purpose (expiry is absence on every read path).
internal/store/item_lease.go:193
↓ 9 callersMethodGetNeedsSnooze
GetNeedsSnooze returns userID's snooze on an item with Holds evaluated at now, or nil when there is none. A deferral holds until defer_until, whatever
internal/store/needs_snooze.go:267
↓ 9 callersMethodGetOAuthProviders
GetOAuthProviders parses the JSON oauth_providers field into a string slice.
internal/models/user.go:149
↓ 9 callersMethodGetPendingInstall
GetPendingInstall returns a LIVE pending install of this owner in this workspace, or ErrPendingNotFound (another owner's, another workspace's, an expi
internal/store/app_pending.go:258
↓ 9 callersMethodHydrateDerivedFields
()
internal/models/workspace_settings.go:141
↓ 9 callersMethodIsConnectionWorkspaceAllowed
IsConnectionWorkspaceAllowed reports whether workspace_id appears in the connection's allow-list. Used internally by GetOAuthConnectionAccess when cal
internal/store/oauth_connections.go:695
↓ 9 callersFunctionIsDBRetryable
IsDBRetryable is either class: the request failed for a reason a later attempt can get past. Callers that must word the two differently use the two pr
internal/store/busy_error.go:102
↓ 9 callersFunctionItemParked
ItemParked is the shared predicate reporting whether a queue item at roleSortOrder is parked under park. Now items are never parked; callers should on
internal/store/role_park.go:126
↓ 9 callersMethodLastRestoreSeq
LastRestoreSeq returns the item.seq of the most recent restore for itemID, or (0, false) when none has been recorded. Join consults it to force_refres
internal/collab/manager.go:272
↓ 9 callersFunctionListAllTemplates
ListAllTemplates returns every registered template, including ones flagged Hidden. Intended for internal tooling (e.g. tests, demo seeding) that needs
internal/collections/templates.go:738
↓ 9 callersMethodListWorkspaceInvitations
ListWorkspaceInvitations returns all invitations for a workspace.
internal/store/workspace_members.go:1622
↓ 9 callersMethodLivePushDevices
LivePushDevices returns userID's devices a push may go to at now, earliest created first (ties by id), so element 0 is the earliest-created live devic
internal/store/push_dispatch.go:377
↓ 9 callersMethodMaterializeFlush
MaterializeFlush writes a recovered body to items.content (TASK-2198 U4). CALLER CONTRACT: hold the collab per-item setup lock with no room open for
internal/store/materialize_flush.go:277
↓ 9 callersMethodMaxOpLogID
MaxOpLogID is consulted ONLY by ForceRefreshRoom (BUG-2264), which reads it under the per-item lock WITH appendMu held (inbound persistence frozen) to
internal/collab/room.go:351
↓ 9 callersMethodNeedsDueOccurrences
NeedsDueOccurrences returns the earliest and latest outstanding human-audience claims per open item received by userID. BootstrapAgenda applies visibi
internal/store/needs_due.go:29
↓ 9 callersFunctionNew
New builds a Fetcher. private is the admin list (self-host only; Cloud passes nil, so no private destination is ever reachable). tlsConfig is nil in p
internal/appfetch/appfetch.go:72
↓ 9 callersFunctionNewCloudClient
NewCloudClient constructs a client pointed at the given pad-cloud base URL (e.g. "http://pad-cloud:7778") authenticated with cloudSecret. Both values
internal/billing/cloud_client.go:78
↓ 9 callersFunctionNewGateway
NewGateway returns a Gateway with a client that does not follow redirects: the secret rides in a header, and a redirect would carry it to wherever the
internal/notify/gateway.go:76
↓ 9 callersFunctionNewRedisBusWithReplaySize
NewRedisBusWithReplaySize is NewRedisBus with a custom replay capacity (tests use a small one, exactly like NewWithReplaySize).
internal/watchevents/redis_bus.go:480
↓ 9 callersFunctionNewRemoteTransport
NewRemoteTransport builds the Streamable HTTP transport pad serves at /mcp. sessionIDs supplies legacy session ids for caller identity and session tra
internal/mcp/transport.go:25
↓ 9 callersFunctionNormalizeOrigin
NormalizeOrigin returns the canonical origin of an https base URL: lower-case host, no default port, and no path, query, fragment or userinfo. It is t
internal/appmanifest/manifest.go:357
↓ 9 callersMethodObserve
Observe records the count from a decoded bundle. Safe on a nil receiver so a door that does not care can pass nil.
internal/server/import_stale_bodies.go:37
↓ 9 callersMethodPeekOAuthPendingLink
PeekOAuthPendingLink reads a live pending link without spending it. Nil when the token is unknown, spent or expired.
internal/store/oauth_pending_links.go:73
↓ 9 callersMethodPost
Post sends body to rawURL with header and returns the status, having written the WHOLE request before reading any response. A server that stops readin
internal/appfetch/appfetch.go:313
↓ 9 callersMethodPruneAndApply
PruneAndApply runs applyFn under the per-item setup lock so it is strictly serialised with any in-flight Join's addConn+replayTo for the same itemID.
internal/collab/manager.go:1140
↓ 9 callersMethodRead
(p []byte)
internal/appfetch/poster_test.go:127
↓ 9 callersMethodRenameWorkspace
RenameWorkspace changes a workspace only if its canonical slug is still expectedSlug.
internal/store/workspaces.go:615
↓ 9 callersFunctionResolveAttachmentReferences
ResolveAttachmentReferences scans `markdown` for `pad-attachment:UUID` references in standard markdown image/link syntax and replaces each with render
internal/server/render/attachments.go:492
↓ 9 callersMethodRestoreBoundary
RestoreBoundary returns the restore boundary recorded for itemID, or (0, false) when none has been set. The collab-snapshot PATCH handler consults it
internal/collab/manager.go:244
↓ 9 callersFunctionReversePatch
ReversePatch is CreateReversePatch with UTF-8 and round-trip checks. If either text is invalid UTF-8 (BUG-3839), or applying the patch does not reprod
internal/diff/diff.go:129
↓ 9 callersMethodRevokeOAuthGrant
RevokeOAuthGrant ends a grant for good (BUG-3678): it records the request_id in oauth_revoked_grants and flips every token of the grant inactive, in o
internal/store/oauth.go:479
↓ 9 callersMethodSearchUsers
SearchUsers returns a filtered, paginated list of users for admin management. Each row carries the User model plus two cheap aggregations the admin t
internal/store/users.go:623
↓ 9 callersMethodSetActivity
SetActivity records activity for this credential user and worker, independently of any connection. Entries expire 30 minutes after the server receipt
internal/server/session_presence.go:316
↓ 9 callersMethodSetBypassSetupToken
SetBypassSetupToken wires the operator's PAD_BYPASS_SETUP_TOKEN choice into the Server. When true, handleBootstrap accepts a self-host first-admin POS
internal/server/bootstrap.go:193
↓ 9 callersMethodSetCORSOrigins
SetCORSOrigins configures allowed CORS origins (comma-separated).
internal/server/server.go:1372
↓ 9 callersMethodSetCollabRoomManager
SetCollabRoomManager attaches a Yjs collab RoomManager (PLAN-1248). When set, the /api/v1/collab/{itemID} WebSocket endpoint hands new connections to
internal/server/server.go:1326
↓ 9 callersMethodSetIPChangeEnforce
SetIPChangeEnforce controls how the auth middleware reacts when a session's binding (client IP OR User-Agent hash) changes mid-lifetime: - mode == "st
internal/server/server.go:1689
↓ 9 callersMethodString
()
internal/appstore/boundary_check_test.go:160
↓ 9 callersMethodSubscribe
Subscribe registers a subscriber for itemID and returns a buffered channel of size subscriberBufSize.
internal/collab/memory_bus.go:59
↓ 9 callersMethodTimeout
()
internal/server/handlers_collab_test.go:509
↓ 9 callersFunctionValidate
Validate loads name as an IANA zone. It refuses the empty string, "Local" (the server's own zone, not the user's), NUL, and names past MaxLen.
internal/usertz/usertz.go:25
↓ 9 callersMethodValidateSessionContext
ValidateSessionContext is ValidateSession under ctx: a cancelled or expired request context stops the query in flight (database/sql sends the cancel t
internal/store/sessions.go:399
↓ 9 callersMethodWorkspaceStorageUsage
WorkspaceStorageUsage returns the total bytes consumed by non-deleted attachments in the workspace. Includes derived blobs (thumbnails) — those are re
internal/store/attachments.go:1888
↓ 9 callersFunction_resetEscapeStackForTests
()
web/src/lib/stores/escapeStack.ts:97
↓ 9 callersFunctionackHTTPFixture
(t *testing.T)
internal/server/schedule_ack_test.go:17
↓ 9 callersFunctionackLossCloudServer
(t *testing.T, driver store.DriverType)
internal/server/handlers_cloud_member_ack_test.go:38
↓ 9 callersFunctionageAllSessions
ageAllSessions dates every session of the user d into the past.
internal/server/bug3336_account_delete_test.go:109
↓ 9 callersFunctionagendaCall
(t *testing.T, calls []recordedCall)
cmd/pad/task4105_agenda_test.go:18
↓ 9 callersFunctionagentNameFromRequest
agentNameFromRequest is the X-Pad-Agent header as stored for the caller's writes and presence. This is a self-description, never a verified identity.
internal/server/agent_name.go:11
↓ 9 callersFunctionapiError
(status int, code, msg, details string)
cmd/pad/task4105_remind_schedule_test.go:36
↓ 9 callersFunctionappendFrames
(t *testing.T, s *store.Store, itemID string, frames ...[]byte)
internal/store/materialize_flush_test.go:30
↓ 9 callersFunctionassertCounter
(t *testing.T, m *Metrics, name string, labels map[string]string, want float64)
internal/metrics/watchevents_observer_test.go:84
↓ 9 callersMethodassertEnds
(t *testing.T, done <-chan struct{}, why string)
internal/server/bug3837_mcp_credential_tick_test.go:153
↓ 9 callersFunctionassertPreflightMatchesCopy
--- 1. DR-6: the preview IS the copy ---------------------------------- assertPreflightMatchesCopy is the general form of this task's headline deliver
internal/server/handlers_items_copy_test.go:149
↓ 9 callersMethodattach
(page: Page)
web/e2e/lib/attachment-viewer.ts:374
↓ 9 callersMethodattachIn
attachIn creates an original attachment in the given workspace.
internal/store/items_cross_workspace_copy_test.go:66
↓ 9 callersMethodauthorizeParams
()
internal/server/task3399_delegated_flow_test.go:102
↓ 9 callersFunctionbug3331Setup
(t *testing.T)
internal/server/bug3331_search_scope_test.go:37
↓ 9 callersFunctionbug3407Fixture
(t *testing.T)
internal/store/bug3407_revalidate_test.go:21
↓ 9 callersFunctionbug3626Export
bug3626Export fetches the export over a real connection (an aborted response is only visible on the wire) and reports the body and the read error.
internal/server/bug3626_account_export_test.go:56
↓ 9 callersFunctionbug4954Read
(t *testing.T, s *Store, id string)
internal/store/bug4954_activity_scrub_test.go:42
↓ 9 callersFunctionbuildQuery
buildQuery returns the URL-encoded query string for the mapping (without the leading '?'). Empty mapping → empty string. Numbers from JSON arrive as
internal/mcp/dispatch_http_routes.go:166
↓ 9 callersFunctionbuildToolFromDef
buildToolFromDef compiles a ToolDef into the mcp.Tool shape mcp-go expects. The schema is flat: `action` is required, every other parameter is optiona
internal/mcp/catalog.go:355
↓ 9 callersFunctioncalItemTitles
(m map[string]any)
internal/server/handlers_calendar_test.go:52
↓ 9 callersMethodcanEditInCollection
canEditInCollection is requireEditPermission's decision without the response, for callers that report per row (bulk) rather than per request. An edit
internal/server/server.go:4163
↓ 9 callersFunctioncarriedValue
carriedValue returns the value the preflight says will land under key.
internal/server/handlers_items_copy_relation_test.go:129
↓ 9 callersFunctionchatActor
TASK-4039: membership identities come only from the admitted credential.
internal/server/handlers_chat.go:20
↓ 9 callersFunctioncheckDispatcherLine
checkDispatcherLine validates one dispatcher command line against the cobra tree and returns every problem found (empty means the line resolves cleanl
cmd/pad/agent_dispatcher_commands_test.go:362
↓ 9 callersFunctionclaimRows
claimRows and claimIDRows are the claim calls with the per-claim token dropped, for tests that only look at the rows.
internal/store/task3939_push_dispatch_test.go:40
↓ 9 callersMethodcount
(key string)
cmd/pad/task4507_token_edit_test.go:51
↓ 9 callersMethodcreateScheduleRolesAt
createScheduleRolesAt creates the schedule with the legacy roles derived from its kind, or with native roles when roles is given.
internal/store/schedules.go:488
↓ 9 callersMethodcreateWorkspace
(name, requestID string)
internal/server/handlers_workspace_create_consent_test.go:150
↓ 9 callersMethodcredentialLiveness
credentialLiveness re-checks the credential that opened this request. It switches on how the MIDDLEWARE said the principal was established (`ctxAuthK
internal/server/stream_credential_liveness.go:95
↓ 9 callersFunctiondecodeWrite
(t *testing.T, rr *httptest.ResponseRecorder)
internal/server/handlers_items_bug3133_pending_guard_test.go:80
↓ 9 callersFunctiondeleteAsUser
Delete-authorization tests for PLAN-2382 / TASK-2384. The item-detail attachment strip offers a delete affordance gated on the UI's grant-aware `canE
internal/server/handlers_storage_delete_authz_test.go:28
↓ 9 callersFunctiondialWSReadOnly
dialWSReadOnly joins as a read-only participant (canWrite=false) via the harness's `?readonly=1` switch — for TASK-265 tests.
internal/collab/manager_test.go:483
↓ 9 callersMethoddo
do issues a request with Bearer PAT auth. When requestID is non-empty the request context is decorated with an OAuth grant identity, which is what mak
internal/server/handlers_workspace_create_consent_test.go:124
↓ 9 callersFunctiondocWith
docWith constructs a minimal Document with two commands sharing a `collection` arg (caching test) and one `role` flag.
internal/cmdhelp/dynamic_test.go:49
↓ 9 callersFunctiondroppedReason
droppedReason returns the reason the preflight gave for key, and whether it reported the key dropped at all.
internal/server/handlers_items_copy_relation_test.go:119
↓ 9 callersMethoddueReminderCandidates
dueReminderCandidates returns the ids of armed reminders whose instant has arrived, oldest first. Split from FireDueReminders so a test can drive the
internal/store/reminders.go:399
↓ 9 callersMethoddump
()
internal/materialize/supervisor_test.go:266
↓ 9 callersFunctionendGuardHTTP
endGuardHTTP is a schedHTTP whose item has a one-shot in 2099 and a status field with two delivering closes and one abandoning one.
internal/server/schedule_end_guard_test.go:21
↓ 9 callersFunctionentriesByKind
(entries []models.TimelineEntry, kind string)
internal/server/handlers_timeline_id_collision_test.go:57
↓ 9 callersFunctionfakeSessionServer
fakeSessionServer returns an httptest.Server whose /api/v1/auth/session handler responds with the SessionResponse produced by `gen` (called once per r
internal/cli/bootstrap_test.go:23
↓ 9 callersFunctionfetchAttachmentMetadata
( workspaceSlug: string, uuid: string, getDownloadUrl: AttachmentUrlBuilder, options?: MetadataFetchOption
web/src/lib/components/editor/attachment-metadata.ts:202
↓ 9 callersFunctionfindFieldOptions
findFieldOptions returns the Options slice for the named field on a collection's schema, or nil if the field is missing.
internal/collections/templates_test.go:12
← previousnext →1,801–1,900 of 31,743, ranked by callers