Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/PerpetualSoftware/pad
/ functions
Functions
7,856 in github.com/PerpetualSoftware/pad
⨍
Functions
7,856
◇
Types & classes
959
↓ 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:517
↓ 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:4711
↓ 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:4610
↓ 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
New
(s *store.Store)
internal/server/server.go:397
↓ 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
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:762
↓ 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 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
Unsubscribe
Unsubscribe removes a subscriber and closes its channel.
internal/watchevents/watchevents.go:118
↓ 6 callers
Method
UpdateDocument
(id string, input models.DocumentUpdate)
internal/store/documents.go:224
↓ 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:56
↓ 6 callers
Function
authJson
(fixture: SuiteFixture)
web/e2e/lib/attachment-viewer.ts:559
↓ 6 callers
Function
buildToolFromDef
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:266
↓ 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
displayWidth
displayWidth returns the visible column width of s: ANSI SGR escape sequences are stripped, then the remaining runes are counted. Every rune is approx
internal/cli/format.go:148
↓ 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:520
↓ 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:2515
↓ 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:460
↓ 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:810
↓ 6 callers
Method
matches
True when `key` names the live view. A null key never matches.
web/src/lib/attachments/viewFence.ts:92
↓ 6 callers
Function
membersHandler
membersHandler returns an http.Handler that responds to any path with the standard `{members:[...], invitations:[]}` shape using the supplied rows.
internal/mcp/dispatch_http_advanced_test.go:877
↓ 6 callers
Function
mimeDispoFixture
BUG-2413: the attachment read path must fail CLOSED on Content-Disposition — a stored MIME that is not explicitly inline-safe is served as an attachme
internal/server/handlers_attachments_download_mime_test.go:27
↓ 6 callers
Method
move
Move one finger; sends `touchMove` with the full active set.
web/e2e/lib/attachment-viewer.ts:355
↓ 6 callers
Function
mustSeedWorkspaceForMutation
(t *testing.T, srv *Server, ownerID, slug, role string)
internal/server/handlers_connected_apps_mutations_test.go:86
↓ 6 callers
Function
mustWorkspace
(t *testing.T, srv *Server, name, ownerID string)
internal/server/authz_cross_workspace_test.go:93
↓ 6 callers
Function
newClaimCodeEnv
(t *testing.T)
internal/server/handlers_claim_code_test.go:86
↓ 6 callers
Function
newConnectedTestStore
Connected-apps store tests (PLAN-943 TASK-954). What's covered: - ListUserOAuthConnections deduplicates a chain across multiple access-token rows (r
internal/store/connected_apps_test.go:29
↓ 6 callers
Function
newTestConfig
(t *testing.T)
internal/config/encryption_key_test.go:12
↓ 6 callers
Function
normalizeStringEncodedJSONFields
normalizeStringEncodedJSONFields recursively walks a parsed JSON value, finds string-typed `fields` and `tags` properties, parses them as embedded JSO
internal/mcp/dispatch.go:209
↓ 6 callers
Function
num
(n int)
internal/cli/format_markdown_test.go:22
↓ 6 callers
Function
packageHTTPResponse
packageHTTPResponse turns the recorded handler response into an MCP CallToolResult, mirroring ExecDispatcher's "JSON → structured + text fallback" beh
internal/mcp/dispatch_http.go:664
↓ 6 callers
Function
parseAttachmentFilename
parseAttachmentFilename extracts the filename from a Content-Disposition header. Mirrors the CLI's helper of the same name (cmd/pad/main.go parseAttac
internal/mcp/dispatch_http_attachments.go:199
↓ 6 callers
Function
recordInstallation
recordInstallation stores a skill install in the global registry (~/.pad/installations.json).
cmd/pad/cmd_agent.go:203
↓ 6 callers
Method
registerPendingAck
registerPendingAck creates an entry in the room's pending-acks map keyed on requestID, expecting acks/brackets from `applier`. It seeds the bracket ba
internal/collab/applier.go:527
↓ 6 callers
Function
renderItemTable
renderItemTable is the testable core of PrintItemTable: it lays the item list out into maxWidth columns and writes to w. Columns are REF/TITLE · STATU
internal/cli/format.go:221
↓ 6 callers
Function
requesterToOAuthRequest
===================================================================== Translation helpers ============================================================
internal/oauth/storage.go:444
↓ 6 callers
Method
reset
()
internal/server/handlers_watch_events.go:315
↓ 6 callers
Method
resolveWorkspace
resolveWorkspace resolves a workspace by slug or UUID, scoped to the authenticated user's accessible workspaces when a user context is present. Return
internal/server/server.go:2469
↓ 6 callers
Method
runWorkspacePurgeSweep
runWorkspacePurgeSweep purges every workspace whose deleted_at is older than cutoff. Blobs are reclaimed BEFORE the DB rows are removed so a failed re
internal/server/workspace_purge.go:215
↓ 6 callers
Function
sanitizeFTSQuery
sanitizeFTSQuery wraps each token in double quotes so FTS5 treats special characters (like hyphens) as literals rather than operators. Only used for S
internal/store/search.go:764
↓ 6 callers
Function
sanitizePGFTSQuery
sanitizePGFTSQuery returns a copy of q with hyphens replaced by spaces. Used as the second leg of the OR-combined PG FTS query: postgres' english pars
internal/store/search.go:790
↓ 6 callers
Function
scanAttachment
scanAttachment scans a single row into a models.Attachment, handling nullables via *string / *int.
internal/store/attachments.go:39
↓ 6 callers
Function
seedBackfillWorkspace
(t *testing.T, s *Store, name, ownerID string)
internal/store/oauth_connections_backfill_test.go:52
↓ 6 callers
Function
seedCollabFixture
seedCollabFixture creates the minimum fixture chain needed to test the collab WS endpoint: workspace + collection + item, all in the store, returning
internal/server/handlers_collab_test.go:62
← previous
next →
601–700 of 7,856, ranked by callers