Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/PerpetualSoftware/pad
/ functions
Functions
8,091 in github.com/PerpetualSoftware/pad
⨍
Functions
8,091
◇
Types & classes
983
↓ 7 callers
Function
playbooksCollection
playbooksCollection returns a Playbooks collection scoped to the caller's domain. Like conventionsCollection, the trigger and scope select options are
internal/collections/templates.go:484
↓ 7 callers
Method
publishItemEventWithName
publishItemEventWithName publishes a real-time event for item changes with actor name. `seq` is the item's workspace-scoped monotonic mutation cursor
internal/server/handlers_items.go:1994
↓ 7 callers
Method
readAttachment
readAttachment handles pad://workspace/{ws}/attachments/{id}. It requests the existing thumb-md path so authorization, workspace isolation, image proc
internal/mcp/resources.go:467
↓ 7 callers
Function
renderedScale
(page: Page, selector = VIEWER_IMAGE)
web/e2e/lib/attachment-viewer.ts:252
↓ 7 callers
Function
runApplierEcho
runApplierEcho spawns a goroutine that reads all incoming TextMessage frames on conn, looks for applier_request, and immediately responds with applier
internal/collab/applier_test.go:16
↓ 7 callers
Method
seedGrantee
seedGrantee creates a throwaway user to be the recipient of a grant, for tests that need a real grant/link ID on a hidden or visible resource (BUG-192
internal/server/handlers_grant_visibility_test.go:128
↓ 7 callers
Function
seqPtr
(v int64)
internal/store/item_workspace_moves_test.go:68
↓ 7 callers
Method
stopMCPSessionTracker
stopMCPSessionTracker signals the sweeper to exit. Called from Server.Stop. Idempotent.
internal/server/middleware_mcp_session.go:245
↓ 7 callers
Function
stripReservedUnparentedViewFilter
(config string)
internal/server/handlers_views.go:256
↓ 7 callers
Function
swapApplierTimeouts
(first, retry time.Duration)
internal/collab/applier_test.go:660
↓ 7 callers
Function
writeCredsFile
(t *testing.T, home, body string)
internal/cli/credentials_test.go:21
↓ 6 callers
Method
Addr
Addr returns the host:port listen address.
internal/config/config.go:342
↓ 6 callers
Method
AllowedAudience
AllowedAudience returns the canonical resource URL the server is configured to accept. Sub-PR C's /authorize handler reads this to reject mismatched `
internal/oauth/server.go:236
↓ 6 callers
Function
ApplyPatch
ApplyPatch applies a patch to baseText to produce the target text. Returns an error if the patch cannot be applied cleanly.
internal/diff/diff.go:24
↓ 6 callers
Method
Clone
Clone overrides DefaultSession.Clone so the returned value is a *Session, not a *DefaultSession. Without this override, fosite's internal Clone() call
internal/oauth/session.go:163
↓ 6 callers
Method
CloudMode
CloudMode reports whether the marketing footer is currently enabled. Templates read it through getCloudMode() so they pick up the same snapshot for th
internal/email/sender.go:87
↓ 6 callers
Method
ComputeRef
ComputeRef sets the Ref field from CollectionPrefix and ItemNumber. Call this after populating the item from a database query.
internal/models/item.go:137
↓ 6 callers
Function
ConvertGeneric
ConvertGeneric converts an HTML document into markdown by first running go-readability to strip chrome, navigation, and ads, then piping the cleaned H
internal/urlimport/generic.go:37
↓ 6 callers
Method
CreateCollection
(wsSlug string, input models.CollectionCreate)
internal/cli/client.go:180
↓ 6 callers
Method
DeleteUserSessions
DeleteUserSessions destroys all sessions for a user (logout everywhere).
internal/store/sessions.go:247
↓ 6 callers
Function
DetectTools
DetectTools returns the tools that appear to be in use, based on any of: a project-local directory, a home-directory install, or a binary on PATH.
internal/cli/agents.go:104
↓ 6 callers
Function
EmitJSON
EmitJSON walks the command tree below `target`, builds a cmdhelp v0.1 Document, and writes it to w as indented JSON terminated by a newline. `root` M
internal/cmdhelp/json.go:73
↓ 6 callers
Method
EnableTOTP
EnableTOTP atomically enables 2FA for a user and stores hashed recovery codes. The expectedSecret is the plaintext secret — it's compared against the
internal/store/users.go:1198
↓ 6 callers
Function
EnsureBootstrapToken
EnsureBootstrapToken generates a fresh first-run bootstrap token (or loads the existing one if a valid file is already present). Returns the token str
internal/server/bootstrap.go:66
↓ 6 callers
Method
Error
()
internal/attachments/mime.go:291
↓ 6 callers
Method
Error
()
internal/server/handlers_items.go:667
↓ 6 callers
Function
ExtractItemImplementationNotes
(fieldsJSON string)
internal/models/item.go:401
↓ 6 callers
Method
GetAccessToken
GetAccessToken hydrates an access token by its HMAC signature. Returns ErrOAuthInactiveToken if the row exists but has been revoked / rotated out, Err
internal/store/oauth.go:317
↓ 6 callers
Method
GetBillingMetrics
GetBillingMetrics fetches an aggregated Stripe-derived snapshot from pad-cloud's /admin/metrics/billing endpoint (active subs, MRR, ARR, churn, cancel
internal/server/server.go:536
↓ 6 callers
Method
GetClient
===================================================================== fosite.ClientManager ===========================================================
internal/oauth/storage.go:143
↓ 6 callers
Method
GetRefreshToken
GetRefreshToken hydrates a refresh token. Returns ErrOAuthInactiveToken when active=false, which fosite uses to trigger family revocation on the match
internal/store/oauth.go:357
↓ 6 callers
Method
GuestVisibleResources
GuestVisibleResources returns the two-level visibility for a guest: - fullCollectionIDs: collections where the user has a direct collection grant (ful
internal/store/grants.go:508
↓ 6 callers
Method
HasOAuthProvider
HasOAuthProvider returns true if the user has linked the given provider.
internal/models/user.go:59
↓ 6 callers
Function
InstallForTool
InstallForTool writes the skill content to the appropriate location for a tool.
internal/cli/agents.go:163
↓ 6 callers
Method
IsExpired
IsExpired reports whether an invitation is past its expiration window. Invitations created before the expires_at migration (nil ExpiresAt) are treated
internal/models/user.go:127
↓ 6 callers
Method
IsItemStarred
IsItemStarred checks whether a specific item is starred by a user.
internal/store/item_stars.go:43
↓ 6 callers
Method
ListArchivedItemWorkspaceMovesBySource
ListArchivedItemWorkspaceMovesBySource returns at most `limit` MOVE rows for one source — rows with archived_source true — newest first. It serves th
internal/store/item_workspace_moves.go:160
↓ 6 callers
Method
ListAuditLog
ListAuditLog returns activities matching the given audit log filters. Supports filtering by action, actor, workspace, and date range.
internal/store/activities.go:507
↓ 6 callers
Method
ListItemVersions
ListItemVersions returns all versions for an item.
internal/store/items.go:4728
↓ 6 callers
Method
ListItemVersionsResolved
ListItemVersionsResolved returns versions with full content (diffs resolved). Requires the current item content to reconstruct diff-based versions.
internal/store/items.go:4627
↓ 6 callers
Method
ListSystemCollectionIDs
ListSystemCollectionIDs returns the IDs of system collections in a workspace. System collections are always visible to members regardless of collectio
internal/store/workspace_members.go:333
↓ 6 callers
Method
ListWatchesForUser
ListWatchesForUser returns every watch a user holds, across ALL workspaces they're a member of, newest first — enriched with the watched item's ref/ti
internal/store/watches.go:70
↓ 6 callers
Function
NewMemorySessionPresence
NewMemorySessionPresence returns an empty in-process registry.
internal/server/session_presence.go:185
↓ 6 callers
Function
NewRoomManagerWithConfig
NewRoomManagerWithConfig is the explicit-config form. Empty config fields fall back to package defaults.
internal/collab/manager.go:254
↓ 6 callers
Function
NewSender
NewSender creates a new email sender.
internal/email/sender.go:35
↓ 6 callers
Function
NormalizeSlug
NormalizeSlug maps the common singular / shorthand collection-name forms users actually type ("task", "idea", "doc", etc.) to the canonical plural slu
internal/collections/prefix.go:15
↓ 6 callers
Method
PlanAttachmentCopy
PlanAttachmentCopy plans the attachment side of a cross-workspace item copy. It writes nothing. DR-11a, restated because it is the whole point of the
internal/store/attachments_copy_plan.go:356
↓ 6 callers
Function
PlaybookLibrary
PlaybookLibrary returns all pre-defined playbook categories with their playbooks. As of PLAN-1397's invokable-first overhaul (TASK-1403), the library
internal/collections/playbook_library.go:37
↓ 6 callers
Function
PromptBody
PromptBody returns the canonical body text for a registered prompt. Exported so tests can assert lockstep with SKILL.md without duplicating the litera
internal/mcp/prompts.go:85
↓ 6 callers
Function
RenderMarkdown
RenderMarkdown writes a Document as markdown matching cmdhelp v0.1 §6. Useful for tests that build a Document manually and want to render it without r
internal/cmdhelp/md.go:29
↓ 6 callers
Method
RenewSessionIfStale
RenewSessionIfStale implements sliding-window expiration. When a session is past its renewal threshold (less than half its renewal window remaining) i
internal/store/sessions.go:120
↓ 6 callers
Function
ResolveTool
ResolveTool finds an AgentTool by name or alias. Returns nil if not found.
internal/cli/agents.go:86
↓ 6 callers
Method
RevokeAccessTokenFamily
RevokeAccessTokenFamily mirrors RevokeRefreshTokenFamily for access tokens. fosite calls these in pairs when revoking by request_id (the unified Revok
internal/store/oauth.go:504
↓ 6 callers
Function
SanitizeMarkdownText
Markdown list rendering (#898). The `--format markdown` branch of the list commands writes a GitHub-flavored markdown table. Two rules separate it fr
internal/cli/format_markdown.go:32
↓ 6 callers
Method
ServeHTTP
(w http.ResponseWriter, r *http.Request)
internal/mcp/dispatch_http_advanced_test.go:910
↓ 6 callers
Method
SetEmailSender
SetEmailSender attaches a transactional email sender. The apiKey is stored separately for deriving the unsubscribe HMAC secret. If the server is alre
internal/server/server.go:791
↓ 6 callers
Method
SetOpLogGCConfig
SetOpLogGCConfig overrides the default sweep interval (1h) and minimum row age (24h). Pass 0 for either to keep the package default. Must be called be
internal/server/oplog_gc.go:44
↓ 6 callers
Method
SetSpawn
SetSpawn injects the goroutine spawner used for deliveries. Passing the server's tracked-goroutine helper (Server.goAsync) makes Server.Stop() wait fo
internal/webhooks/dispatcher.go:93
↓ 6 callers
Method
SetUserRole
SetUserRole updates a user's role (admin or member). When demoting an admin to member, the update is conditional: it only proceeds if at least one oth
internal/store/users.go:908
↓ 6 callers
Method
StartOpLogGC
StartOpLogGC kicks off the periodic prune-sweep loop. Idempotent — calling twice silently no-ops. Must be called AFTER SetCollabRoomManager; the loop
internal/server/oplog_gc.go:64
↓ 6 callers
Method
Subscribe
Subscribe returns a channel that receives every future Notification, with NO replay. There is exactly one logical stream (unlike internal/events.Event
internal/watchevents/watchevents.go:154
↓ 6 callers
Method
Subscribe
Subscribe registers a subscriber for itemID and returns a buffered channel of size subscriberBufSize.
internal/collab/memory_bus.go:50
↓ 6 callers
Method
TouchUserWrite
TouchUserWrite updates last_write_at for a user, throttled to avoid write amplification. Only writes if the stored value is older than 5 minutes. Best
internal/store/users.go:864
↓ 6 callers
Method
UnmarkStripeEventProcessed
UnmarkStripeEventProcessed deletes a row from stripe_processed_events, allowing Stripe retries of the same event ID to be handled again (TASK-736). Us
internal/store/stripe_events.go:86
↓ 6 callers
Method
UpdateDocument
(id string, input models.DocumentUpdate)
internal/store/documents.go:224
↓ 6 callers
Method
UpdateItemWithParentLink
UpdateItemWithParentLink is UpdateItemWithPreCheck plus an OPTIONAL parent-link mutation applied inside the same transaction (BUG-2013). When parentLi
internal/store/items.go:2081
↓ 6 callers
Method
UpdateUser
UpdateUser updates mutable user fields.
internal/store/users.go:162
↓ 6 callers
Method
UserHasGrantsInWorkspace
UserHasGrantsInWorkspace checks if a user has any active collection or item grants in a workspace (even though they are not a member). Used to detect
internal/store/grants.go:368
↓ 6 callers
Function
ValidatePartialFields
ValidatePartialFields validates ONLY the keys present in `patch` against the schema (TASK-2022, field-level PATCH / IDEA-1480). Unlike ValidateFields
internal/items/validate.go:153
↓ 6 callers
Method
ValidatePassword
ValidatePassword checks an email/password combination. Returns the user if valid, nil if the credentials are wrong (not an error).
internal/store/users.go:214
↓ 6 callers
Method
ValidateToken
ValidateToken hashes the provided plaintext token, looks it up in the database, checks expiry, and updates last_used_at. Returns nil if the token is i
internal/store/api_tokens.go:222
↓ 6 callers
Function
VerifyClaimCode
VerifyClaimCode returns true if code matches the derived code for (userID, workspaceID) at the current OR previous time bucket — the sliding 5–10 minu
internal/server/claim_codes.go:127
↓ 6 callers
Function
apiRequest
apiRequest makes a JSON API request to the test server.
internal/server/handlers_events_test.go:91
↓ 6 callers
Function
applyImageSemantics
()
web/src/lib/components/editor/attachment-image.ts:439
↓ 6 callers
Function
assertTransformDenied
assertTransformDenied pins the shared denial: 404 with the exact body every other attachment denial writes.
internal/server/handlers_attachments_transform_authz_test.go:120
↓ 6 callers
Method
attachWith
(t *testing.T, ws *models.Workspace, filename string, size int64, storageKey, hash string)
internal/store/attachments_copy_plan_test.go:42
↓ 6 callers
Function
authHeaders
(fixture: SuiteFixture)
web/e2e/pane-full-page-capstone.spec.ts:60
↓ 6 callers
Function
authJson
(fixture: SuiteFixture)
web/e2e/lib/attachment-viewer.ts:559
↓ 6 callers
Function
countIPChangeEvents
countIPChangeEvents returns the number of session_ip_changed rows in the audit log.
internal/server/middleware_session_ip_test.go:405
↓ 6 callers
Function
countLiveAttachments
(t *testing.T, s *Store, wsID string)
internal/store/attachments_live_item_test.go:35
↓ 6 callers
Function
decodeItemFields
(t *testing.T, fieldsJSON string)
internal/server/handlers_items_fieldpatch_test.go:27
↓ 6 callers
Method
decryptUserTOTP
decryptUserTOTP decrypts the TOTP secret on a User struct in place.
internal/store/users.go:72
↓ 6 callers
Function
distinctPNG
distinctPNG returns a valid PNG whose bytes differ per seed, so an assertion on served content can tell one blob from another. The download handler ne
internal/server/handlers_attachments_download_authz_test.go:149
↓ 6 callers
Function
doLoopbackRequest
(srv *Server, method, path string, body interface{})
internal/server/server_test.go:44
↓ 6 callers
Method
enrichItemForResponse
enrichItemForResponse populates derived closure and parent info on a single item. An optional visibleIDs slice filters related items so hidden-collect
internal/server/item_lineage.go:80
↓ 6 callers
Function
errStructured
errStructured wraps a Go error into the standard MCP tool-error envelope (TASK-1077) with a stable identifier prefix (e.g. "pad_item.link"). Local hel
internal/mcp/catalog_item.go:555
↓ 6 callers
Function
escapeTableCell
escapeTableCell escapes characters that would break a markdown table row: `|` becomes `\|`, and existing backslashes are doubled so the escape stays v
internal/urlimport/openapi.go:505
↓ 6 callers
Function
extractCommandBlock
extractCommandBlock returns the substring of `md` covering one command's section, identified by its full path (e.g. "item create"). Used to scope asse
internal/cmdhelp/md_test.go:356
↓ 6 callers
Function
extractFieldValue
extractFieldValue pulls a named string field out of an item's fields JSON blob. Returns "" when the blob is empty, unparseable, or carries no string v
internal/store/status_transitions_backfill.go:17
↓ 6 callers
Function
fakeUser
===================================================================== Helpers ===================================================================== fa
internal/mcp/dispatch_http_envelope_test.go:414
↓ 6 callers
Function
fileExists
(dir, name string)
internal/cli/detect.go:203
↓ 6 callers
Method
filterWatchesByCurrentAccess
filterWatchesByCurrentAccess re-checks each watch's CURRENT visibility (workspace membership / role / collection access / item grants) before it is us
internal/server/handlers_watch_access.go:33
↓ 6 callers
Function
flexJSONToString
flexJSONToString accepts a raw JSON value and returns it as a canonical JSON-encoded string. Acceptable inbound shapes: - absent / empty / null → nil
internal/models/item.go:856
↓ 6 callers
Function
getConfiguredConfig
()
cmd/pad/configure.go:68
↓ 6 callers
Method
getWorkspaceDocument
isUUID is defined in handlers_items.go getWorkspaceDocument resolves workspace slug and document ID from URL params.
internal/server/server.go:2558
↓ 6 callers
Method
hasBootstrapToken
hasBootstrapToken reports whether a bootstrap token is currently configured. Lock-aware — safe to call without holding s.bootstrapMu. Used by handleSe
internal/server/bootstrap.go:156
↓ 6 callers
Function
isAPITokenAuth
isAPITokenAuth returns true if the request was authenticated via an API token (not a session cookie or CLI session). Use this to gate sensitive operat
internal/server/middleware_auth.go:486
↓ 6 callers
Function
listTransitions
listTransitions returns all status_transitions rows for an item, oldest first.
internal/store/status_transitions_test.go:12
↓ 6 callers
Function
liveItemAttachmentFixture
Store-level tests for CreateAttachmentForLiveItem — PLAN-2391 DR-14 / TASK-2402. The handler-level coverage lives in internal/server; these pin the in
internal/store/attachments_live_item_test.go:18
↓ 6 callers
Method
markUploadInFlight
markUploadInFlight increments the in-flight counter for a content hash. Returns a release func the caller MUST defer; the release decrements and remov
internal/server/server.go:839
← previous
next →
601–700 of 8,091, ranked by callers