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
↓ 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:710
↓ 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
SetUserPlanOverrides
SetUserPlanOverrides updates per-user limit overrides (JSON string).
internal/store/limits.go:298
↓ 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
UpdateDocument
(id string, input models.DocumentUpdate)
internal/store/documents.go:224
↓ 6 callers
Method
UpdateItemWithPreCheck
UpdateItemWithPreCheck is UpdateItem with an optional pre-mutation hook that runs inside the same transaction (and, on Postgres, holds the same worksp
internal/store/items.go:1856
↓ 6 callers
Method
UpdateUser
UpdateUser updates mutable user fields.
internal/store/users.go:162
↓ 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:85
↓ 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
Method
WorkspaceStorageUsage
WorkspaceStorageUsage returns the total bytes consumed by non-deleted attachments in the workspace. Includes derived blobs (thumbnails) — those are re
internal/store/attachments.go:903
↓ 6 callers
Function
WriteWorkspaceLink
WriteWorkspaceLink writes a .pad.toml in the given directory. serverURL is the base URL of the Pad server hosting this workspace. Pass the empty stri
internal/cli/workspace.go:94
↓ 6 callers
Function
apiRequest
apiRequest makes a JSON API request to the test server.
internal/server/handlers_events_test.go:91
↓ 6 callers
Function
authHeaders
(fixture: SuiteFixture)
web/e2e/pane-full-page-capstone.spec.ts:56
↓ 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
conventionsCollection
conventionsCollection returns a Conventions collection scoped to the caller's domain. The trigger and scope select options are supplied by the caller
internal/collections/templates.go:304
↓ 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
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
doLoopbackRequest
(srv *Server, method, path string, body interface{})
internal/server/server_test.go:44
↓ 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
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:778
↓ 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:2428
↓ 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
Method
invalidate
invalidate clears the cached entry for a workspace. Call after any mutation that changes used_bytes (uploads, deletes, transforms) so the next GET see
internal/server/handlers_storage.go:93
↓ 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
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:758
↓ 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
mustSeedWorkspaceForMutation
(t *testing.T, srv *Server, ownerID, slug, role string)
internal/server/handlers_connected_apps_mutations_test.go:86
↓ 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
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
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:360
↓ 6 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:1887
↓ 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
run
run executes fn on the injected spawner, or a plain goroutine if none is set.
internal/webhooks/dispatcher.go:98
↓ 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
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
↓ 6 callers
Function
seedUser
seedUser creates a user that subsequent oauth tokens can use as their `subject`.
internal/store/connected_apps_test.go:61
↓ 6 callers
Method
startMCPSessionTracker
startMCPSessionTracker constructs the tracker + spawns the sweep goroutine. Called once at startup from SetMCPTransport (alongside startMCPAuditWriter
internal/server/middleware_mcp_session.go:225
↓ 6 callers
Method
trackMCPSession
(reqHeader, respHeader func(string) string, method string, httpStatus int)
internal/server/middleware_mcp_session.go:274
↓ 6 callers
Method
validateSessionCookie
validateSessionCookie validates a session cookie and returns the user if valid, nil otherwise. A User-Agent change is logged but NOT rejected — this m
internal/server/handlers_auth.go:259
↓ 6 callers
Function
veErrorCode
veErrorCode extracts the JSON error.code from a response, or "" if the body isn't an error envelope.
internal/server/middleware_verified_email_test.go:143
↓ 6 callers
Function
writeBootstrapToken
writeBootstrapToken drops a token file at <dataDir>/.bootstrap-token in the same shape EnsureBootstrapToken would produce — token + trailing newline,
internal/cli/bootstrap_test.go:52
↓ 5 callers
Method
AcquireParentChildrenLocks
AcquireParentChildrenLocks is the CANONICAL helper for taking `pad:parent-children:<id>` advisory locks. Every call site that needs to serialize again
internal/store/items.go:3902
↓ 5 callers
Method
Addr
Addr returns the host:port listen address.
internal/config/config.go:342
↓ 5 callers
Function
ApplyWorkspaceContext
(raw string, context *WorkspaceContext)
internal/models/workspace_settings.go:99
↓ 5 callers
Method
AsPlanLimit
AsPlanLimit returns the parsed plan-limit details when this APIError carries them, or nil otherwise. Returns nil for any error other than "plan_limit_
internal/cli/client.go:1235
↓ 5 callers
Method
BaseURL
BaseURL returns the base URL for the API. If URL is set (via config, --url flag, or PAD_URL), it takes precedence. Otherwise, constructs from host and
internal/config/config.go:355
↓ 5 callers
Method
CancelCustomer
CancelCustomer asks pad-cloud to cancel every active Stripe subscription for customerID and then delete the Stripe customer object. Used by handleDele
internal/server/server.go:462
↓ 5 callers
Function
CapabilityLine
CapabilityLine returns the single-line capability bit a conforming CLI emits in response to `<cmd> help --capabilities` (or the `--cmdhelp-capabilitie
internal/cmdhelp/json.go:27
↓ 5 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
↓ 5 callers
Method
ConsumeEmailVerification
ConsumeEmailVerification atomically validates and marks a verification token as used, then sets users.email_verified_at to now. Returns the (now-verif
internal/store/email_verification.go:93
↓ 5 callers
Method
ConsumeTOTPStep
ConsumeTOTPStep atomically records a TOTP time-step as consumed, enforcing single-use semantics for login codes (BUG-2054). It succeeds only if step i
internal/store/users.go:1263
↓ 5 callers
Method
CreatePasswordReset
CreatePasswordReset generates a reset token for the given user. Returns the plaintext token (to embed in the reset URL). The token is stored as a SHA-
internal/store/password_resets.go:19
↓ 5 callers
Method
CreateWebhook
CreateWebhook registers a new webhook for a workspace.
internal/store/webhooks.go:11
↓ 5 callers
Method
Crop
Crop returns the rectangular sub-image bounded by `rect`. The rectangle is interpreted in the image's coordinate space (origin top-left) and intersect
internal/attachments/processor.go:55
↓ 5 callers
Method
DeleteItemLink
(id string)
internal/store/items.go:2869
↓ 5 callers
Function
Detect
Detect classifies a fetched document by inspecting its Content-Type header and the leading bytes of its body. It returns TypeOpenAPI when the document
internal/urlimport/detect.go:33
↓ 5 callers
Method
Error
()
internal/server/handlers_items_bulk.go:84
↓ 5 callers
Method
Error
()
internal/billing/cloud_client.go:102
↓ 5 callers
Method
FTSMatch
FTSMatch returns the full-text search WHERE clause fragment. SQLite: "table MATCH ?" — consumes ONE arg. PostgreSQL: an OR-combined plainto_tsquery ma
internal/store/dialect.go:86
↓ 5 callers
Method
GetAgentRole
(workspaceID, idOrSlug string)
internal/store/agent_roles.go:39
↓ 5 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:117
↓ 5 callers
Method
GetAuthorizationCode
GetAuthorizationCode hydrates the code's session. Returns ErrOAuthInvalidatedCode if the row exists but active=false (fosite triggers grant-family rev
internal/store/oauth.go:269
↓ 5 callers
Method
GetChildItems
GetChildItems returns all non-deleted child items linked to the given parent via item_links. Returns children from any collection.
internal/store/items.go:3685
↓ 5 callers
Method
GetDashboard
--- Dashboard --- GetDashboard returns the workspace dashboard as raw JSON. The DashboardResponse type lives in the server package, so we use json.Raw
internal/cli/client.go:398
↓ 5 callers
Method
GetItemContentFlushedOpLogID
GetItemContentFlushedOpLogID returns the per-item flush watermark (TASK-1309). Returns (0, false) for items with NULL watermark or no row.
internal/collab/room.go:246
↓ 5 callers
Method
GetItemProgress
--- Child Item Progress --- GetItemProgress counts total and done child items linked to a parent via item_links. "Done" means the child item's done fi
internal/store/items.go:3406
↓ 5 callers
Method
GetOAuthProviders
GetOAuthProviders parses the JSON oauth_providers field into a string slice.
internal/models/user.go:47
↓ 5 callers
Method
GetShareLink
GetShareLink retrieves a share link by ID.
internal/store/share_links.go:98
↓ 5 callers
Method
GetWorkspace
(slug string)
internal/cli/client.go:113
↓ 5 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:492
↓ 5 callers
Method
ImportWorkspace
ImportWorkspace imports a workspace from an exported data structure. It creates a new workspace with regenerated IDs, remapping all references. If new
internal/store/export.go:210
← previous
next →
501–600 of 6,412, ranked by callers