Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/PerpetualSoftware/pad
/ functions
Functions
6,412 in github.com/PerpetualSoftware/pad
⨍
Functions
6,412
◇
Types & classes
799
↓ 8 callers
Function
newEmptyStore
()
internal/cli/credentials.go:163
↓ 8 callers
Function
packageJSONResult
packageJSONResult converts a CLI stdout string into an MCP tool result. JSON bodies surface as structuredContent; non-JSON falls back to text. Top-lev
internal/mcp/dispatch.go:166
↓ 8 callers
Function
packageStructuredResponse
packageStructuredResponse encodes payload to JSON, then decodes it back to a generic any so the StructuredContent surface matches the shape MCP client
internal/mcp/dispatch_http_links.go:475
↓ 8 callers
Function
parseExamplesFromLong
parseExamplesFromLong extracts the indented invocation lines that follow an "Examples:" header in a cobra Long string. Returns nil when no such sectio
internal/cmdhelp/json.go:200
↓ 8 callers
Function
pickTemplateInteractive
pickTemplateInteractive presents a numbered list of visible templates grouped by category and returns the chosen template's Name. Returns the default
cmd/pad/templates_picker.go:72
↓ 8 callers
Function
postOAuthFormBearer
postOAuthFormBearer POSTs an x-www-form-urlencoded body with a Bearer Authorization header (used for /oauth/introspect, where fosite v0.49 requires ei
internal/server/handlers_oauth_test.go:2550
↓ 8 callers
Method
requireCollectionFullyVisible
requireCollectionFullyVisible checks that the collection is visible to the requesting user under FULL-collection-access semantics (BUG-1920 — codex R2
internal/server/server.go:1955
↓ 8 callers
Method
resolveAssignName
resolveAssignName rewrites a `--assign <name|email>` input into `assigned_user_id <uuid>` by hitting the workspace-members endpoint and finding a matc
internal/mcp/dispatch_http_advanced.go:33
↓ 8 callers
Method
rowCount
()
internal/collab/manager_test.go:251
↓ 8 callers
Function
seedBackfillAccess
(t *testing.T, s *Store, requestID, clientID, subject string, ts time.Time, sessionData string)
internal/store/oauth_connections_backfill_test.go:81
↓ 8 callers
Method
size
size returns the current entry count. Used by tests and by startMCPSessionTracker's initial gauge prime.
internal/server/middleware_mcp_session.go:165
↓ 8 callers
Method
touch
touch inserts or refreshes an entry. No-op on empty id (defensive: callers pre-filter, but a missing header should never bump anything). Fires onChang
internal/server/middleware_mcp_session.go:112
↓ 8 callers
Method
validateCloudSecret
validateCloudSecret checks the cloud_secret field in a JSON request body against the server's configured cloud secret. Returns true if the secret matc
internal/server/handlers_cloud.go:45
↓ 7 callers
Method
BrowserURL
BrowserURL returns a URL suitable for displaying to humans in CLI prompts (e.g. "Or open the web UI at X"). It behaves like BaseURL except that when t
internal/config/config.go:403
↓ 7 callers
Function
BuildMetaPayload
BuildMetaPayload returns the meta payload for the given pad runtime version. An empty padVersion falls back to FallbackVersion for the same reason ser
internal/mcp/meta.go:54
↓ 7 callers
Method
CheckSession
CheckSession returns the current auth status.
internal/cli/client.go:1022
↓ 7 callers
Function
ConvertOpenAPI
ConvertOpenAPI converts an OpenAPI 3.x specification into a human-readable markdown document. The output is organized as: - H1 with the API title - I
internal/urlimport/openapi.go:30
↓ 7 callers
Method
CountBacklinks
CountBacklinks returns the total number of same-workspace backlinks the requester would see for a given target, applying the same visibility filter as
internal/store/wiki_links.go:1071
↓ 7 callers
Method
CreateEmailVerification
CreateEmailVerification generates an email-verification token for the given user. Returns the plaintext token (to embed in the verification URL). The
internal/store/email_verification.go:28
↓ 7 callers
Function
CurrentUserFromContext
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:63
↓ 7 callers
Method
Get
Get returns the current session workspace, or empty string when none has been set.
internal/mcp/workspace.go:72
↓ 7 callers
Method
GetDocument
(id string)
internal/store/documents.go:193
↓ 7 callers
Method
IsConnectionWorkspaceAllowed
IsConnectionWorkspaceAllowed reports whether workspace_id appears in the connection's allow-list. Used internally by GetOAuthConnectionAccess when cal
internal/store/oauth_connections.go:428
↓ 7 callers
Method
IsDisabled
IsDisabled returns true if the user account has been disabled.
internal/models/user.go:35
↓ 7 callers
Method
LastRestoreSeq
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:196
↓ 7 callers
Method
ListMCPAuditByUser
ListMCPAuditByUser returns the user's most recent audit rows in reverse-chronological order. limit caps the page; offset paginates. Caller must enforc
internal/store/mcp_audit.go:104
↓ 7 callers
Function
NewSQLite
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
↓ 7 callers
Method
Provider
Provider returns the fosite.OAuth2Provider that sub-PR C's HTTP handlers will call (NewAuthorizeRequest, NewAccessRequest, WriteAuthorizeResponse, etc
internal/oauth/server.go:220
↓ 7 callers
Method
PruneSweep
PruneSweep finds every item whose ENTIRE op-log is older than `minAge` and prunes the whole op-log for those items under the per-item lock. Returns a
internal/collab/manager.go:636
↓ 7 callers
Function
RelativeTime
RelativeTime returns a human-readable relative time string.
internal/cli/format.go:108
↓ 7 callers
Method
SearchItems
(workspaceID, query string)
internal/store/items.go:2518
↓ 7 callers
Function
adminBillingReq
adminBillingReq fires GET /api/v1/admin/billing-stats with the cookie from a logged-in user. Returns the recorder so callers can inspect status + body
internal/server/handlers_admin_billing_test.go:43
↓ 7 callers
Function
buildPlainShell
buildPlainShell builds the plain-text body for transactional emails. Self-hosted output is byte-equivalent to the prior templates. Cloud output adds a
internal/email/shell.go:93
↓ 7 callers
Function
buildQuery
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:125
↓ 7 callers
Method
callCount
()
internal/server/handlers_account_test.go:50
↓ 7 callers
Function
cancelInit
cancelInit is the canonical exit path for both Ctrl+C and explicit "Cancel" actions during pad init / pad workspace init. It prints a brief message to
cmd/pad/cancel.go:25
↓ 7 callers
Method
checkItemVisible
checkItemVisible is the context-free visibility decision. Returns (true, nil) when the (user, role) pair can see `item` under the same rules `requireI
internal/server/server.go:2054
↓ 7 callers
Function
decodeEnvelope
decodeEnvelope helper extracts the ErrorEnvelope from an MCP error result. Uses textOf (the shared helper in catalog_test.go) to retrieve the JSON bod
internal/mcp/errors_test.go:306
↓ 7 callers
Method
dispatchWebhook
dispatchWebhook fires a webhook event if a dispatcher is configured.
internal/server/handlers_webhooks.go:25
↓ 7 callers
Method
doClaim
doClaim issues a POST /api/v1/oauth/claim with Bearer PAT auth. extraReqID, if non-empty, attaches a WithMCPTokenIdentity context override to simulate
internal/server/handlers_oauth_claim_test.go:103
↓ 7 callers
Function
doRequestFromRemoteAddr
(srv *Server, method, path string, body interface{}, remoteAddr string)
internal/server/server_test.go:48
↓ 7 callers
Method
encrypt
encrypt encrypts plaintext using AES-256-GCM and returns a base64-encoded ciphertext prefixed with "enc:" to distinguish from plaintext values.
internal/store/encryption.go:30
↓ 7 callers
Method
enrichItemsWithParent
enrichItemsWithParent batch-populates parent link info on a slice of items. Used by list endpoints where calling enrichItemForResponse per-item is too
internal/server/item_lineage.go:13
↓ 7 callers
Function
ensureWorkspace
── Shared helpers ──────────────────────────────────────────────────────────── ensureWorkspace checks if the current directory is linked to a workspac
cmd/pad/init.go:373
↓ 7 callers
Function
findFieldOptions
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:11
↓ 7 callers
Function
getConfig
--- helpers ---
cmd/pad/main.go:176
↓ 7 callers
Method
getWorkspace
getWorkspace returns the full workspace object resolved by middleware. Falls back to direct resolution for routes without RequireWorkspaceAccess.
internal/server/server.go:1886
↓ 7 callers
Function
graphNode
(resp GraphResponse, ref string)
internal/server/handlers_graph_test.go:23
↓ 7 callers
Method
handleResponse
(resp *http.Response, result interface{})
internal/cli/client.go:1591
↓ 7 callers
Function
hopTransitions
hopTransitions returns only the "real" status hops — excluding the create-time "entered initial status" seed row (id prefix "create_") that every crea
internal/store/status_transitions_test.go:37
↓ 7 callers
Function
isCancellation
isCancellation reports whether err represents a user-initiated abort from any interactive init prompt. Init RunEs use this to convert the sentinel int
cmd/pad/cancel.go:84
↓ 7 callers
Function
isSupported
()
web/src/lib/stores/localIndexPersistence.ts:69
↓ 7 callers
Function
isolateHome
isolateHome redirects HOME to a temp dir and chdirs to a fresh temp project dir so credential writes and .pad.toml detection don't leak into the real
cmd/pad/setup_headless_test.go:89
↓ 7 callers
Function
itemPrefetchHandler
itemPrefetchHandler routes /api/v1/workspaces/{ws}/items/{ref} GETs to a static map keyed by ref so each link-test can declare just the items it needs
internal/mcp/dispatch_http_links_test.go:18
↓ 7 callers
Method
parseError
(resp *http.Response)
internal/cli/client.go:1601
↓ 7 callers
Function
parsePadURI
parsePadURI extracts (workspace, kind, arg) from a pad:// URI. arg is empty for list-style resources (no trailing segment). Forms accepted: pad://w
internal/mcp/resources.go:590
↓ 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
Method
removeEventListener
(type: 'toolchange', listener: (ev: Event) => void)
web/src/lib/webmcp/types.d.ts:79
↓ 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
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
tokenWorkspaceID
tokenWorkspaceID returns the workspace ID set by the TokenAuth middleware, or an empty string if no token was used.
internal/server/middleware_auth.go:445
↓ 7 callers
Function
writeCredsFile
(t *testing.T, home, body string)
internal/cli/credentials_test.go:21
↓ 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
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:93
↓ 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
D
D returns the store's dialect for building backend-specific SQL.
internal/store/store.go:72
↓ 6 callers
Method
DeleteCollection
DeleteCollection soft-deletes a collection by id. When expectedUpdatedAt is non-empty it opts into optimistic-concurrency control (BUG-2265): the row'
internal/store/collections.go:455
↓ 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:249
↓ 6 callers
Method
Error
()
internal/server/handlers_items.go:666
↓ 6 callers
Function
ExtractItemImplementationNotes
(fieldsJSON string)
internal/models/item.go:323
↓ 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:473
↓ 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
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
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:4459
↓ 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:4358
↓ 6 callers
Function
New
(s *store.Store)
internal/server/server.go:353
↓ 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
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
Method
Register
Register installs store under prefix (e.g. "fs", "s3"). The prefix MUST NOT contain a colon — Resolve splits keys on the first colon, so a prefix with
internal/attachments/registry.go:37
↓ 6 callers
Method
RemoveWorkspaceMember
RemoveWorkspaceMember removes a user from a workspace.
internal/store/workspace_members.go:35
↓ 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
← previous
next →
401–500 of 6,412, ranked by callers