Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/PerpetualSoftware/pad
/ functions
Functions
7,659 in github.com/PerpetualSoftware/pad
⨍
Functions
7,659
◇
Types & classes
942
↓ 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:1915
↓ 4 callers
Function
parseItemFields
(fieldsJSON string)
internal/models/item.go:492
↓ 4 callers
Function
parseMutableItemFields
(fieldsJSON string)
internal/models/item.go:503
↓ 4 callers
Function
parseWorkspaceSettingsMap
(raw string)
internal/models/workspace_settings.go:148
↓ 4 callers
Function
prStateColor
(state string)
cmd/pad/cmd_github.go:406
↓ 4 callers
Method
preflightAsAttacker
preflightAsAttacker runs the dry run as the restricted editor and returns both the parsed response and the RAW bytes, because one of the assertions be
internal/server/handlers_items_copy_attachment_authz_test.go:104
↓ 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
Function
read
()
web/src/lib/attachments/hostAddress.test.ts:26
↓ 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
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:317
↓ 4 callers
Function
refreshAccessibleName
()
web/src/lib/components/editor/attachment-chip.ts:295
↓ 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
renderItemCopyResult
renderItemCopyResult writes the outcome of a completed copy.
cmd/pad/cmd_item.go:1919
↓ 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
Method
resourceArgs
()
internal/mcp/resources_http_attachment_acl_test.go:119
↓ 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
restrictedWarnings
(t *testing.T, f *copyPreflightFixture, u *models.User)
internal/server/handlers_items_copy_preflight_test.go:1624
↓ 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
Function
run
(ctx)
web/src/lib/attachments/actions.ts:218
↓ 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
runTopEscape
(event?: KeyboardEvent)
web/src/lib/stores/escapeStack.ts:85
↓ 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:2480
↓ 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
Function
showMissing
()
web/src/lib/components/editor/attachment-image.ts:482
↓ 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
toIdle
()
web/src/lib/attachments/viewerImageLoader.svelte.ts:163
↓ 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
transformOf
The `transform` inline style on the viewer's image (empty before it mounts).
web/src/lib/components/common/Lightbox.svelte.test.ts:210
↓ 4 callers
Method
uniqueSlug
uniqueSlug generates a unique slug within a scope by appending -2, -3, etc.
internal/store/store.go:1127
↓ 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
uploadedAttachmentID
uploadedAttachmentID pulls the new attachment's id out of a 201 upload response body.
internal/server/handlers_attachments_test.go:334
↓ 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
variantUrl
* The URL for one variant. `original` is the CANONICAL, no-`?variant` download — * that is what "the original" IS on the server (it serves the origin
web/src/lib/attachments/viewerImageLoader.svelte.ts:139
↓ 4 callers
Function
viewerClose
(page: Page)
web/e2e/lib/attachment-viewer.ts:148
↓ 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
writeAttachmentNotFound
writeAttachmentNotFound is the single denial writer for the blob read path. Every authorization-dependent refusal — attachment missing, wrong workspac
internal/server/handlers_attachments.go:524
↓ 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:432
↓ 3 callers
Function
AppendImplementationNote
(fieldsJSON string, note ItemImplementationNote)
internal/models/item.go:420
↓ 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
ChildLinkTypes
ChildLinkTypes is the exported, read-only view of childLinkTypes (items.go) — the link types GetChildItems walks to find an item's children. It exist
internal/store/link_types.go:17
↓ 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
CreateWorkspace
(input models.WorkspaceCreate)
internal/cli/client.go:108
↓ 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
Error
()
internal/store/items_cross_workspace_copy.go:105
↓ 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
Function
FieldKeysForKind
FieldKeysForKind returns the frontmatter field keys for the given kind, or ErrUnknownKind if the kind is not recognized. A later phase's server code c
internal/artifact/artifact.go:64
↓ 3 callers
Method
Get
Get / Stat / Delete are convenience helpers that resolve the key first.
internal/attachments/registry.go:63
↓ 3 callers
Method
GetAccessTokenSession
GetAccessTokenSession hydrates an access token. Inactive rows surface as fosite.ErrInactiveToken so the introspection / authorization-bearer middlewar
internal/oauth/storage.go:247
↓ 3 callers
Method
GetAllItemProgress
GetAllItemProgress returns child item completion counts for every item in the given collection within a workspace. includeArchived controls whether s
internal/store/items.go:3831
↓ 3 callers
Method
GetAttachmentVariant
GetAttachmentVariant returns the derived attachment row for parentID with the given variant key (e.g. "thumb-sm"), or (nil, nil) if no such row exists
internal/store/attachments.go:245
↓ 3 callers
Method
GetBillingMetrics
GetBillingMetrics asks pad-cloud for an aggregated Stripe-derived snapshot (active subs, MRR, ARR, churn, cancellations). Auth is the same shared Clou
internal/billing/cloud_client.go:144
↓ 3 callers
Method
GetBlocksEdges
GetBlocksEdges returns every `blocks` link in the workspace whose source and target items are both live (non-deleted), newest link first. The created_
internal/store/items.go:4256
↓ 3 callers
Method
GetCLIAuthSession
GetCLIAuthSession retrieves a CLI auth session by code. Returns nil if not found. Expired sessions are returned with status updated to "expired".
internal/store/cli_auth_sessions.go:82
↓ 3 callers
Method
GetCollection
(wsSlug, collSlug string)
internal/cli/client.go:182
↓ 3 callers
Method
GetCollectionGrant
GetCollectionGrant retrieves a collection grant by ID.
internal/store/grants.go:29
↓ 3 callers
Method
GetCurrentUser
GetCurrentUser returns the authenticated user's profile.
internal/cli/client.go:1016
↓ 3 callers
Method
GetInvitation
GetInvitation retrieves an invitation by ID.
internal/store/workspace_members.go:660
↓ 3 callers
Method
GetItem
(wsSlug, itemSlug string)
internal/cli/client.go:238
← previous
next →
1,001–1,100 of 7,659, ranked by callers