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
↓ 4 callers
Function
forcePlainColor
forcePlainColor disables ANSI so width/content assertions are deterministic regardless of whether the test binary's stdout happens to be a TTY.
internal/cli/format_test.go:15
↓ 4 callers
Function
getCSRFToken
()
web/src/lib/api/client.ts:399
↓ 4 callers
Function
getNaturalBoundsPx
()
web/src/lib/components/editor/attachment-crop-modal.ts:297
↓ 4 callers
Function
guardSchemaAhead
guardSchemaAhead refuses to start when the database contains migrations this binary doesn't ship — i.e. the DB is AHEAD of the binary, the tell-tale o
internal/store/migration_guard.go:62
↓ 4 callers
Function
handleCmdhelpCapabilitiesFallback
handleCmdhelpCapabilitiesFallback scans args for the --cmdhelp-capabilities flag (cmdhelp v0.1 §8 fallback form). If found, it writes the capability b
cmd/pad/main.go:70
↓ 4 callers
Function
head
(s string, lines int)
internal/cmdhelp/md_test.go:371
↓ 4 callers
Function
headlessTestServer
headlessTestServer builds an httptest.Server that speaks the minimal subset of the Pad API that the headless bootstrap path touches: - GET /api/v1/a
cmd/pad/setup_headless_test.go:31
↓ 4 callers
Method
insertOAuthRequestRow
============================================================ Helpers — shared by the three "request-row" tables ======================================
internal/store/oauth.go:575
↓ 4 callers
Function
isSupportedOAuthProvider
isSupportedOAuthProvider reports whether provider is one pad accepts.
internal/server/handlers_cloud.go:34
↓ 4 callers
Function
isUUID
(s string)
internal/server/handlers_items.go:2548
↓ 4 callers
Function
itemDisplayLabel
(item *models.Item)
cmd/pad/lineage.go:205
↓ 4 callers
Function
itemRefOrSlug
itemRefOrSlug formats an item's issue ref (e.g. "TASK-5") when its collection prefix + item number are populated, falling back to its slug. Avoids pul
internal/server/handlers_items_open_children_guard.go:99
↓ 4 callers
Function
itoa
itoa is strconv.Itoa renamed to keep test bodies readable when they're already heavy on ref-formatting.
internal/store/wiki_links_test.go:1698
↓ 4 callers
Function
mapRoleUpdate
mapRoleUpdate dispatches `pad role update <slug> [--name ...] [--slug ...] [--description ...] [--icon ...] [--tools ...] [--sort-order ...]`. PATCH
internal/mcp/dispatch_http_routes.go:797
↓ 4 callers
Function
marshalItemFields
(fieldsMap map[string]any)
internal/models/item.go:467
↓ 4 callers
Function
mkAdminCookieReq
mkAdminCookieReq is the same shape minus the Authorization header. Simulates the cookie-session path where isBearerAuth must return false and the admi
internal/server/handlers_admin_bearer_gate_test.go:47
↓ 4 callers
Function
mustCreateOwnedWorkspace
(t *testing.T, srv *Server, name string, owner *models.User)
internal/server/token_workspace_consent_scope_test.go:56
↓ 4 callers
Function
mustCreatePATForTest
mustCreatePATForTest creates a real PAT against a fresh user + workspace. Returns the raw token string suitable for the Authorization: Bearer header.
internal/server/handlers_mcp_test.go:1724
↓ 4 callers
Function
mustWorkspaceID
mustWorkspaceID resolves a workspace slug to its internal ID via the store. Tests use it because they don't have access to the request context that ge
internal/server/handlers_attachments_test.go:353
↓ 4 callers
Function
newRestoreCollabFixture
(t *testing.T, name string)
internal/server/handlers_items_collab_versions_test.go:566
↓ 4 callers
Function
normalizeCollectionSlug
normalizeCollectionSlug maps common singular/short forms to actual collection slugs. Thin wrapper around the shared collections.NormalizeSlug so the C
cmd/pad/cmd_collection.go:493
↓ 4 callers
Function
normalizeServerURL
normalizeServerURL canonicalizes a server URL for use as a credential key. Trailing slash and surrounding whitespace are stripped; nothing else is tou
internal/cli/credentials.go:256
↓ 4 callers
Function
normalizeWebhookEvents
normalizeWebhookEvents canonicalizes a webhook's event filter to the JSON-array string the store + dispatcher expect. Returns (value, true) when a no
internal/mcp/dispatch_http_routes.go:926
↓ 4 callers
Function
nthPositional
nthPositional returns pos[n] or "" when absent.
internal/mcp/resources_http.go:319
↓ 4 callers
Function
numericInput
numericInput pulls an int64 out of a JSON-typed input value. JSON decoders deliver numbers as float64 (or json.Number when UseNumber()); we accept bot
internal/mcp/dispatch_http_routes.go:1257
↓ 4 callers
Method
oauthRequestToFositeRequest
oauthRequestToFositeRequest hydrates a stored row into a fresh fosite.Request, fetching the client by ID and unmarshalling the session bytes into the
internal/oauth/storage.go:495
↓ 4 callers
Method
onError
Surface an upload failure to the user.
web/src/lib/utils/commentAttachments.ts:99
↓ 4 callers
Method
openBootstrapEnabled
openBootstrapEnabled reports whether open-bootstrap is active for this server: bypass flag is set AND we're not in cloud mode. Cloud mode always wins
internal/server/bootstrap.go:199
↓ 4 callers
Function
paneNavInFlight
()
web/src/lib/collections/paneHostController.ts:147
↓ 4 callers
Function
parseCollectionFieldsDSL
parseCollectionFieldsDSL parses the CLI's --fields DSL into a {fields: [...]} map ready for json.Marshal. Empty input returns an empty Fields slice (t
internal/mcp/dispatch_http_routes.go:569
↓ 4 callers
Function
parseFields
(item: Item)
web/src/lib/types/index.ts:1599
↓ 4 callers
Function
parseItemFields
(fieldsJSON string)
internal/models/item.go:445
↓ 4 callers
Function
parseMutableItemFields
(fieldsJSON string)
internal/models/item.go:456
↓ 4 callers
Function
parseWorkspaceSettingsMap
(raw string)
internal/models/workspace_settings.go:148
↓ 4 callers
Method
patch
(path string, body interface{}, result interface{})
internal/cli/client.go:1554
↓ 4 callers
Function
prStateColor
(state string)
cmd/pad/cmd_github.go:406
↓ 4 callers
Method
publishCommentEvent
publishCommentEvent publishes a real-time event for comment changes.
internal/server/handlers_comments.go:443
↓ 4 callers
Method
queryOAuthRequestRow
queryOAuthRequestRow reads a row by signature from the named table and returns (request, active, err). - For oauth_pkce_requests, active is always tr
internal/store/oauth.go:671
↓ 4 callers
Function
rawPeerAddr
rawPeerAddr returns the untampered TCP peer address captured by CapturePeerAddr, falling back to the current r.RemoteAddr if the middleware wasn't ins
internal/server/middleware_realip.go:32
↓ 4 callers
Method
readItem
readItem handles pad://workspace/{ws}/items/{ref}. Why JSON-then-format instead of `--format markdown`: pad's CLI `--format markdown` for `item show`
internal/mcp/resources.go:315
↓ 4 callers
Function
readMigrationNames
readMigrationNames returns sorted .sql filenames from an embedded FS directory.
internal/store/store.go:275
↓ 4 callers
Function
readTOML
Helpers ------------------------------------------------------------------
internal/mcp/install_test.go:792
↓ 4 callers
Function
reconcileNewItem
(t *testing.T, srv *Server, slug, content string)
internal/server/handlers_item_versions_test.go:28
↓ 4 callers
Method
recordMCPAuthzDenial
recordMCPAuthzDenial bumps the pad_mcp_authz_denials_total counter when the request originated from the MCP surface. The discriminator is the presence
internal/server/middleware_auth.go:734
↓ 4 callers
Method
recordMCPCallMetrics
recordMCPCallMetrics fans the audit-row data out to Prometheus. No-op when metrics aren't wired (selfhost / tests). Kept separate from MCPAuditLog so
internal/server/middleware_mcp_audit.go:349
↓ 4 callers
Method
recoverSweeper
recoverSweeper is the panic firewall for the long-running background sweeper loops (orphan GC, op-log GC, token reaper, workspace purge). Each of thos
internal/server/server.go:299
↓ 4 callers
Function
registerNonAdmin
--- helpers --- registerNonAdmin inserts a member-role user directly into the store and mints a session token for them. Bypasses the admin-registratio
internal/server/handlers_admin_billing_test.go:334
↓ 4 callers
Function
renderRect
()
web/src/lib/components/editor/attachment-crop-modal.ts:301
↓ 4 callers
Method
replaceWikiLinks
replaceWikiLinks deletes prior wiki-link rows for `sourceItemID` and inserts fresh ones extracted from `content`. Resolution against the workspace's i
internal/store/wiki_links.go:31
↓ 4 callers
Function
requestIsLoopback
(r *http.Request)
internal/server/handlers_auth.go:236
↓ 4 callers
Method
requireConnectionOwner
requireConnectionOwner is the per-mutation prologue. Returns the (currentUser, requestID, ok) triple. On `ok=false` the response has already been writ
internal/server/handlers_connected_apps.go:267
↓ 4 callers
Function
requirePostgresForConcurrency
requirePostgresForConcurrency skips a test unless a real PostgreSQL backend is configured. The parent-link TOCTOU races (BUG-2073) are Postgres-only:
internal/store/parent_link_concurrency_test.go:19
↓ 4 callers
Method
respondWithConnection
respondWithConnection re-fetches + writes the connection DTO post- mutation so the page can re-render without a separate list refresh. Stats lookup is
internal/server/handlers_connected_apps.go:293
↓ 4 callers
Function
rootFlagsToArgs
rootFlagsToArgs converts a startup root-flags map into the pre-formatted CLI token list every fetch should append. Empty values are skipped (matching
internal/mcp/resources.go:613
↓ 4 callers
Method
runOpenChildrenGuard
runOpenChildrenGuard executes the guard logic inside the store-layer transaction. Returns: - (nil, nil) when the guard doesn't apply (no transition,
internal/server/handlers_items_open_children_guard.go:155
↓ 4 callers
Function
samplePlaybook
()
internal/artifact/encode_test.go:13
↓ 4 callers
Function
saveCredentials
(cfg *config.Config, resp *cli.LoginResponse)
cmd/pad/cmd_auth.go:676
↓ 4 callers
Function
schemaHasField
schemaHasField returns true if the collection schema defines a field with the given key.
internal/server/handlers_items.go:2440
↓ 4 callers
Function
schemaTypeBrief
schemaTypeBrief returns a one-line type description for a schema proxy: the declared type, format if present, item type for arrays, or the ref name fo
internal/urlimport/openapi.go:450
↓ 4 callers
Method
seedItem
seedItem creates a collection (idempotent on slug) + an item with the given title, returning the resolved item record.
internal/server/handlers_ref_resolver_test.go:99
↓ 4 callers
Function
sendSync
(t *testing.T, c *websocket.Conn, payload byte)
internal/collab/manager_test.go:386
↓ 4 callers
Function
setCSRFCookie
setCSRFCookie writes a new CSRF token cookie. The cookie is NOT HttpOnly so that JavaScript can read it and send it back as a header.
internal/server/middleware_csrf.go:299
↓ 4 callers
Function
setupItemOpenTest
(t *testing.T, handler http.Handler)
cmd/pad/item_open_test.go:15
↓ 4 callers
Function
setupOwnedDeletedWorkspace
setupOwnedDeletedWorkspace registers Alice + Bob, has Alice create and then soft-delete a workspace, and returns their tokens plus the workspace. Shar
internal/server/handlers_workspaces_test.go:154
↓ 4 callers
Method
since
since returns all buffered events with ID > sinceID, in chronological order. Returns nil if sinceID is older than the oldest buffered event AND the bu
internal/events/bus.go:187
↓ 4 callers
Function
singleLine
singleLine collapses internal whitespace and newlines for safe inclusion in a markdown table cell.
internal/urlimport/openapi.go:488
↓ 4 callers
Method
snapshotBeforeMigrate
snapshotBeforeMigrate copies the live SQLite database file to <db>.pre-<VERSION> before any pending migrations run, so a botched upgrade can be rolled
internal/store/migration_guard.go:107
↓ 4 callers
Function
sortedActionNames
sortedActionNames returns def.Actions' keys in lexical order. Used for both the schema's action enum (so the ordering is stable across builds and repr
internal/mcp/catalog.go:381
↓ 4 callers
Function
ssrSafe
()
web/src/lib/stores/localSearch.svelte.ts:354
↓ 4 callers
Function
tightenPerms
tightenPerms sets path to 0600 if it exists. Best-effort: errors only emit a warning to stderr (the user's primary intent — install / no-op — already
internal/mcp/install.go:250
↓ 4 callers
Function
toSkinny
* Strip a row down to the skinny shape. Defensive: discard `content` * if a caller passed a full `Item` rather than an `ItemIndexRow`. The * destruc
web/src/lib/stores/localIndex.svelte.ts:158
↓ 4 callers
Function
unwrapItems
unwrapItems extracts the array from a `{items: [...]}` envelope — the post-BUG-985 shape ExecDispatcher and packageHTTPResponse use for top-level arra
internal/mcp/dispatch_http_links_test.go:460
↓ 4 callers
Function
upstreamHTTPErrorResult
upstreamHTTPErrorResult is the canonical wrapper for "the dispatcher made an HTTP call that returned a non-2xx" cases outside the main executeRequest/
internal/mcp/errors.go:1264
↓ 4 callers
Function
wrapItemNotFound
wrapItemNotFound rewrites a bare "not_found" APIError from the item-by-ref endpoints into a message that echoes the failing ref and workspace, so `pad
internal/cli/client.go:266
↓ 4 callers
Method
write
write performs a single insert with a per-call timeout. DB errors log + drop the row — there's no retry path because the audit log is best-effort by d
internal/server/middleware_mcp_audit.go:159
↓ 4 callers
Function
writeConfig
(t *testing.T, path string, data map[string]any)
internal/mcp/install_test.go:805
↓ 4 callers
Function
writeRateLimitResponse
writeRateLimitResponse sends a 429 response with Retry-After and X-RateLimit-* headers.
internal/server/middleware_ratelimit.go:621
↓ 3 callers
Function
AllToolNames
AllToolNames returns all valid names and aliases that can be passed to `pad agent install`.
internal/cli/agents.go:236
↓ 3 callers
Function
AppendDecisionLogEntry
(fieldsJSON string, entry ItemDecisionLogEntry)
internal/models/item.go:385
↓ 3 callers
Function
AppendImplementationNote
(fieldsJSON string, note ItemImplementationNote)
internal/models/item.go:373
↓ 3 callers
Method
AsOpenChildren
AsOpenChildren returns the parsed open-children details when this APIError carries them, or nil otherwise. Returns nil for any error other than "open_
internal/cli/client.go:1093
↓ 3 callers
Function
AttachmentDownloadURL
AttachmentDownloadURL builds the canonical attachment download URL. Pass an empty variant for the original; otherwise "thumb-sm" / "thumb-md" (the ser
internal/server/render/attachments.go:63
↓ 3 callers
Method
BackfillStatusTransitions
BackfillStatusTransitions populates status_transitions from history in two passes, designed to be called once from server startup after migrations run
internal/store/status_transitions_backfill.go:149
↓ 3 callers
Method
CancelCustomer
CancelCustomer asks pad-cloud to cancel every active Stripe subscription for customerID and then delete the Stripe customer object. Idempotent at the
internal/billing/cloud_client.go:195
↓ 3 callers
Method
Capabilities
Capabilities reports what this backend can do. The editor reads these flags via GET /api/v1/server/capabilities and gates rotate/crop UI on per-format
internal/attachments/processor.go:71
↓ 3 callers
Function
CategoryLabel
CategoryLabel returns the human-readable label for a category slug. Unknown categories are returned unchanged so the picker can still render a reasona
internal/collections/templates.go:49
↓ 3 callers
Function
ColorizedStatus
ColorizedStatus returns a status icon + status text with appropriate color.
internal/cli/format.go:66
↓ 3 callers
Method
CreateAccessTokenSession
===================================================================== AccessTokenStorage =============================================================
internal/oauth/storage.go:229
↓ 3 callers
Method
CreateOAuthUser
CreateOAuthUser creates a user from an OAuth provider with a random unusable password. OAuth users can later set a password via the password reset flo
internal/store/users.go:646
↓ 3 callers
Method
CreatePKCERequest
============================================================ PKCE request sessions (handler/pkce/storage.go PKCERequestStorage) ======================
internal/store/oauth.go:522
↓ 3 callers
Method
DateBucket
DateBucket returns a SQL expression that truncates an RFC3339 UTC timestamp TEXT column to the start of its bucket, as a sortable TEXT label, for GROU
internal/store/dialect.go:127
↓ 3 callers
Method
Delete
(ctx context.Context, key string)
internal/attachments/registry.go:79
↓ 3 callers
Method
DeleteAccountAtomic
DeleteAccountAtomic deletes a user and all their owned workspaces in a single transaction. If any step fails, the entire operation is rolled back and
internal/store/users.go:965
↓ 3 callers
Method
DeleteDocument
(id string)
internal/store/documents.go:397
↓ 3 callers
Method
DisableTOTP
DisableTOTP disables 2FA and clears the secret and recovery codes. It also clears the totp_last_step single-use watermark (BUG-2054) so it doesn't out
internal/store/users.go:1234
↓ 3 callers
Method
Dispatch
Dispatch runs `<Binary> <cmdPath...> <cliArgs...>` and packages the output for an MCP client.
internal/mcp/dispatch.go:127
↓ 3 callers
Method
EnsureUniqueUsername
EnsureUniqueUsername takes a candidate username and returns a unique variant by appending -2, -3, etc. if the candidate already exists in the database
internal/store/users.go:1090
↓ 3 callers
Method
ExportItemArtifact
ExportItemArtifact GETs the single-item artifact export endpoint (GET /workspaces/{ws}/items/{ref}/export) and returns the artifact bytes (Markdown +
internal/cli/client.go:704
↓ 3 callers
Method
Fetch
Fetch runs `<Binary> <args...>` and returns stdout on success.
internal/mcp/resources.go:66
↓ 3 callers
Method
FetchBytes
(ctx context.Context, args []string)
internal/mcp/resources.go:54
← previous
next →
801–900 of 6,412, ranked by callers