MCPcopy Create free account

hub / github.com/PerpetualSoftware/pad / functions

Functions7,659 in github.com/PerpetualSoftware/pad

↓ 5 callersFunctionCapabilityLine
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 callersMethodConsumeEmailVerification
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 callersMethodConsumeTOTPStep
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 callersMethodCreatePasswordReset
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 callersMethodCrop
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 callersMethodDeleteItemLink
(id string)
internal/store/items.go:3058
↓ 5 callersFunctionDetect
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 callersMethodError
()
internal/server/handlers_items_bulk.go:84
↓ 5 callersMethodError
()
internal/billing/cloud_client.go:102
↓ 5 callersMethodExportWorkspace
ExportWorkspace exports all data for a workspace into a portable format.
internal/store/export.go:66
↓ 5 callersMethodFTSMatch
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 callersMethodGetAuthorizationCode
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 callersMethodGetDashboard
--- 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 callersMethodGetItemContentFlushedOpLogID
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 callersMethodGetItemProgress
--- 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:3595
↓ 5 callersMethodGetOAuthProviders
GetOAuthProviders parses the JSON oauth_providers field into a string slice.
internal/models/user.go:47
↓ 5 callersMethodGetShareLink
GetShareLink retrieves a share link by ID.
internal/store/share_links.go:98
↓ 5 callersMethodGetWorkspace
(slug string)
internal/cli/client.go:113
↓ 5 callersMethodGuestVisibleResources
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
↓ 5 callersMethodImportWorkspace
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
↓ 5 callersFunctionIsTerminalItem
IsTerminalItem reports whether an item's fields map indicates the item is in a terminal state for its collection. This is the canonical Go-side "is do
internal/models/terminal.go:120
↓ 5 callersFunctionIsTerminalStatusDefault
IsTerminalStatusDefault checks using the default fallback list (for cases where no collection schema is available).
internal/models/terminal.go:180
↓ 5 callersMethodListCollections
--- Collections ---
internal/cli/client.go:172
↓ 5 callersMethodListCommentsBeforeTime
ListCommentsBeforeTime returns comments for an item created before the given time, ordered newest-first, limited to `limit` results. Used for cursor-b
internal/store/comments.go:132
↓ 5 callersMethodListStarredItems
ListStarredItems returns all items starred by a user in a workspace, enriched with collection and assignment info. Only non-deleted items are returned
internal/store/item_stars.go:96
↓ 5 callersMethodListSystemCollectionIDs
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
↓ 5 callersFunctionListTemplates
ListTemplates returns all workspace templates that should be shown in pickers. Templates flagged Hidden are excluded.
internal/collections/templates.go:918
↓ 5 callersMethodListWorkspaceActivity
(workspaceID string, params models.ActivityListParams)
internal/store/activities.go:359
↓ 5 callersFunctionLookupMIME
LookupMIME returns the entry for a MIME type if it is on the allowlist, or (zero, false) if rejected.
internal/attachments/mime.go:135
↓ 5 callersFunctionNewCloudClient
NewCloudClient constructs a client pointed at the given pad-cloud base URL (e.g. "http://pad-cloud:7778") authenticated with cloudSecret. Both values
internal/billing/cloud_client.go:76
↓ 5 callersFunctionNewServer
NewServer constructs a pad MCP server. Call Run(ctx) to start it. The returned Server is wired with tool capabilities advertised but no tools registe
internal/mcp/server.go:45
↓ 5 callersFunctionNormalizeMIME
NormalizeMIME strips parameters and lowercases the type/subtype. We match strictly against the allowlist after normalization so callers can pass an ht
internal/attachments/mime.go:187
↓ 5 callersFunctionNormalizeWorkspaceSettings
(raw string)
internal/models/workspace_settings.go:82
↓ 5 callersMethodPIDFile
()
internal/config/config.go:415
↓ 5 callersFunctionPriorityColor
PriorityColor returns a *color.Color appropriate for the given priority string.
internal/cli/format.go:50
↓ 5 callersMethodPruneYjsUpdatesBefore
(itemID string, before time.Time)
internal/collab/room.go:242
↓ 5 callersFunctionRegisterResources
RegisterResources installs the read-only MCP resource templates on srv: - pad://workspace/{ws}/items/{ref} — single item markdown - pad://workspace/{
internal/mcp/resources.go:194
↓ 5 callersFunctionRenderAttachmentChip
RenderAttachmentChip builds a Notion-style file-chip anchor for a non-image attachment. `target=_blank` + `rel=noopener noreferrer` matches the existi
internal/server/render/attachments.go:140
↓ 5 callersFunctionRenderAttachmentImage
RenderAttachmentImage builds an inline `<img>` element for an image attachment. Width/height attributes are emitted when both are known and positive s
internal/server/render/attachments.go:112
↓ 5 callersFunctionRenderAttachmentMissing
RenderAttachmentMissing builds a placeholder span for a missing/deleted attachment. Keeps the document layout intact and tells the user *why* there's
internal/server/render/attachments.go:169
↓ 5 callersMethodRevokeRefreshTokenFamily
============================================================ Token revocation (handler/oauth2/revocation_storage.go) =================================
internal/store/oauth.go:428
↓ 5 callersMethodSetAllowedWorkspaces
SetAllowedWorkspaces is the symmetric writer used by oauth/authorize/decide (TASK-952). Centralizing the key string here keeps producers + consumers i
internal/oauth/session.go:137
↓ 5 callersMethodSetAuthToken
SetAuthToken sets the authorization token for API requests.
internal/cli/client.go:80
↓ 5 callersMethodSetBootstrapToken
SetBootstrapToken wires the in-memory token + on-disk path into the Server. Called once at startup from cmd/pad/main.go after EnsureBootstrapToken suc
internal/server/bootstrap.go:145
↓ 5 callersMethodSetEventBus
SetEventBus attaches an event bus for real-time SSE streaming.
internal/server/server.go:693
↓ 5 callersMethodSetUserRole
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
↓ 5 callersMethodSetUserStripeCustomerID
SetUserStripeCustomerID stores the Stripe customer ID for a user.
internal/store/limits.go:355
↓ 5 callersMethodSoftDeleteAttachment
SoftDeleteAttachment marks the given attachment row deleted (and every variant whose parent_id points at it) so the orphan GC will reclaim the bytes a
internal/store/attachments.go:866
↓ 5 callersMethodStatus
Status checks each tracked installation and returns its current state. embeddedContent is the raw embedded skill bytes, used for freshness comparison.
internal/cli/registry.go:137
↓ 5 callersFunctionTokenAllowedWorkspaceSet
TokenAllowedWorkspaceSet returns the token's allow-list as a slug-set for filtering a multi-workspace result, or nil when no per-slug gate applies. It
internal/server/context.go:227
↓ 5 callersFunctionTokenAllowedWorkspacesFromContext
TokenAllowedWorkspacesFromContext returns the token's workspace allow-list, or nil if none was attached. Three return shapes matter to callers: - nil
internal/server/context.go:201
↓ 5 callersFunctionToolInstalled
ToolInstalled checks if the skill file exists for the given tool.
internal/cli/agents.go:153
↓ 5 callersFunctionValidateFieldsDetailed
ValidateFieldsDetailed is ValidateFields with per-field attribution: it returns one FieldIssue per failure instead of a joined error, and applies sche
internal/items/validate.go:104
↓ 5 callersFunctionWithTokenWorkspaceID
WithTokenWorkspaceID returns ctx decorated with a workspace-scope hint, mirroring TokenAuth's behaviour for workspace-scoped API tokens. Pass an empty
internal/server/context.go:48
↓ 5 callersMethodWorkspaceStorageInfo
WorkspaceStorageInfo returns the consolidated quota summary for a workspace (used + limit + plan + override flag) in a single call. Used by the storag
internal/store/attachments.go:1119
↓ 5 callersMethodWriteHidden
WriteHidden writes the non-disclosing denial: an identical 404 for every failure mode, so absence and forbidden-ness are indistinguishable. This is th
internal/server/authz_cross_workspace.go:201
↓ 5 callersFunctionWritePlanLimitError
WritePlanLimitError formats a plan-limit rejection to w in the canonical two-track shape (TASK-788): 1. A single `pad-structured-error/v1: {json}\n`
internal/cli/client.go:1256
↓ 5 callersFunctionactionItemLink
actionItemLink dispatches pad_item.action=link to the appropriate CLI cmdPath based on link_type. Renames the schema's uniform `ref` and `target` to t
internal/mcp/catalog_item.go:412
↓ 5 callersFunctionactionItemList
actionItemList handles pad_item.action=list. It forwards to `item list` but first applies a default limit (when the agent didn't ask for one) and clam
internal/mcp/catalog_item.go:629
↓ 5 callersFunctionapplyConfigureValues
(cfg *config.Config, values *configureValues)
cmd/pad/configure.go:127
↓ 5 callersFunctionassertNotEmailBlocked
assertNotEmailBlocked asserts the response is NOT a verified-email 403 (it may legitimately be a 2xx, or a 4xx for an unrelated reason).
internal/server/middleware_verified_email_test.go:166
↓ 5 callersMethodattachIn
attachIn creates an original attachment in the given workspace.
internal/store/items_cross_workspace_copy_test.go:64
↓ 5 callersMethodattachTo
attachTo writes a real 2000x1500 PNG — big enough that BOTH specs must scale down, so a skip is unambiguous — and returns the new row's id. Width/Heig
internal/server/handlers_attachments_thumbnails_parent_test.go:62
↓ 5 callersMethodauthorizeCollabAccess
authorizeCollabAccess mirrors RequireWorkspaceAccess but keyed on the item's workspace ID (the WS URL path doesn't carry a workspace slug). It checks:
internal/server/handlers_collab.go:620
↓ 5 callersFunctionbackdateItem
(t *testing.T, s *Store, itemID string, hoursAgo float64)
internal/store/reports_test.go:274
↓ 5 callersFunctionclassifyHTTPStatusKind
classifyHTTPStatusKind turns an HTTP error response into a structured envelope, using the dispatcher's known resource context to emit the right error
internal/mcp/errors.go:753
↓ 5 callersFunctioncollectionAccessPath
This file pins BUG-1925: handleSetMemberCollectionAccess gated only on requireRole(r, "owner"), with zero validation of the CALLER's own visibility. A
internal/server/handlers_member_collection_access_escalation_test.go:20
↓ 5 callersFunctionconsentScopedRequest
These tests cover BUG-2102: the OAuth consent allow-list was enforced only by RequireWorkspaceAccess, which fires solely for /{slug} path-param routes
internal/server/token_workspace_consent_scope_test.go:29
↓ 5 callersFunctioncountAttachmentsIn
(t *testing.T, s *Store, workspaceID string)
internal/store/items_cross_workspace_copy_test.go:113
↓ 5 callersMethodcreateAuthSession
(w http.ResponseWriter, r *http.Request, user *models.User, ttl time.Duration)
internal/server/handlers_auth.go:331
↓ 5 callersFunctioncreateUnverifiedUser
createUnverifiedUser makes a user whose email starts UNVERIFIED, so a consume can be observed flipping it verified. CreateUser's safe default is verif
internal/store/email_verification_test.go:16
↓ 5 callersFunctiondecodeBillingStats
(t *testing.T, rr *httptest.ResponseRecorder)
internal/server/handlers_admin_billing_test.go:101
↓ 5 callersFunctiondecodeFields
decodeFields is a small test helper: parse an item's fields JSON into a map.
internal/store/items_fieldpatch_test.go:12
↓ 5 callersFunctiondetachLoadListeners
()
web/src/lib/components/editor/attachment-image.ts:535
↓ 5 callersFunctionextractPRFromItem
(item *models.Item)
cmd/pad/cmd_github.go:390
↓ 5 callersFunctionfakeYjsRow
fakeYjsRow constructs a single row for the fakeOpLog seeding helpers. The store assigns ids in production; tests don't depend on them.
internal/collab/manager_test.go:1759
↓ 5 callersMethodfetchAsResource
fetchAsResource is the shared shell-out + wrap path. padArgs is the leading argument list (without root flags); rootArgs are appended so --url etc. su
internal/mcp/resources.go:558
↓ 5 callersFunctionfixtureDoc
fixtureDoc returns a small cmdhelp.Document with the items the catalog tests need most often. Catalog actions only require their own cmdPath to be pre
internal/mcp/registry_test.go:51
↓ 5 callersFunctionformatItemAsMarkdown
formatItemAsMarkdown turns the JSON body returned by `pad item show --format json` into a self-contained markdown document: heading with ref + title,
internal/mcp/resources.go:348
↓ 5 callersFunctionfullVersion
()
cmd/pad/main.go:35
↓ 5 callersFunctiongaugeValueOrZero
gaugeValueOrZero pulls the gauge value or returns 0 when the underlying metric hasn't been touched yet.
internal/server/middleware_mcp_metrics_test.go:218
↓ 5 callersMethodgetLimiter
(key string)
internal/server/middleware_ratelimit.go:87
↓ 5 callersFunctiongoto
(_url: string | URL, _opts?: unknown)
web/src/test/mocks/app-navigation.ts:15
↓ 5 callersMethodgrantHiddenItemToOwner
grantHiddenItemToOwner gives the fixture's restricted owner an item-level grant on the hidden item, independent of their collection_access restriction
internal/server/handlers_grant_visibility_test.go:115
↓ 5 callersMethodhandleControlMessage
handleControlMessage dispatches a TextMessage frame received from a peer: applier_apply_start / applier_ack (the designated-applier bracket, TASK-1257
internal/collab/room.go:606
↓ 5 callersMethodhandleCopyItemPreflight
handleCopyItemPreflight answers "what would this cross-workspace copy do?" without doing any of it. See the file header for the full contract.
internal/server/handlers_items_copy_preflight.go:471
↓ 5 callersFunctionhideHandle
()
web/src/lib/components/editor/block-drag-handle.ts:426
↓ 5 callersFunctionhideMenu
()
web/src/lib/components/editor/block-drag-handle.ts:488
↓ 5 callersFunctionimageRect
(page: Page, selector = VIEWER_IMAGE)
web/e2e/lib/attachment-viewer.ts:267
↓ 5 callersFunctionintPtr
(n int)
internal/cli/item_summary_test.go:11
↓ 5 callersFunctionisItemDone
isItemDone reports whether an item is in a terminal state for its collection's configured done field. Falls back to the default-terminal list against
internal/server/handlers_dashboard.go:245
↓ 5 callersFunctionisPublicAPIPath
isPublicAPIPath reports whether the given request path is an API endpoint that bypasses authentication entirely. These handlers must work even when th
internal/server/middleware_auth.go:341
↓ 5 callersFunctionitemCopyLine
itemCopyLine makes a server-supplied string safe to drop into a table row. Schema keys, labels, option values, link types and validator messages are a
cmd/pad/cmd_item.go:2043
↓ 5 callersMethoditemLock
itemLock returns the lazily-allocated mutex guarding setup-phase operations on itemID. Locks live in the manager for the lifetime of the process — for
internal/collab/manager.go:233
↓ 5 callersFunctionitemOpenCmdWithOpener
(opener func(string) error)
cmd/pad/cmd_item.go:774
↓ 5 callersMethoditemsPath
()
internal/server/middleware_verified_email_test.go:115
↓ 5 callersFunctionmaskAPIKey
maskAPIKey returns the display form of a sensitive setting value. Keys longer than 8 chars show their first and last 4 chars (abcd...wxyz); shorter no
internal/server/handlers_admin.go:93
↓ 5 callersFunctionmintOAuthTokenForTest
mintOAuthTokenForTest drives the consent → token exchange and returns the access token. Lightly customizable via the form arg so callers can vary the
internal/server/handlers_mcp_test.go:1634
↓ 5 callersFunctionmkAdminBearerReq
BUG-1616 extended coverage — admin-via-bearer gate at the SSE and WebSocket-collab entry points that sit OUTSIDE RequireWorkspaceAccess. These endpoin
internal/server/handlers_admin_bearer_gate_test.go:37
↓ 5 callersFunctionmustCreateUser
(t *testing.T, srv *Server, email, name, role string)
internal/server/token_workspace_consent_scope_test.go:45
← previousnext →701–800 of 7,659, ranked by callers