MCPcopy Create free account

hub / github.com/PerpetualSoftware/pad / functions

Functions7,856 in github.com/PerpetualSoftware/pad

↓ 6 callersMethodError
()
internal/server/handlers_items.go:667
↓ 6 callersFunctionExtractItemImplementationNotes
(fieldsJSON string)
internal/models/item.go:401
↓ 6 callersMethodGetAccessToken
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 callersMethodGetBillingMetrics
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:517
↓ 6 callersMethodGetClient
===================================================================== fosite.ClientManager ===========================================================
internal/oauth/storage.go:143
↓ 6 callersMethodGetRefreshToken
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 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
↓ 6 callersMethodHasOAuthProvider
HasOAuthProvider returns true if the user has linked the given provider.
internal/models/user.go:59
↓ 6 callersFunctionInstallForTool
InstallForTool writes the skill content to the appropriate location for a tool.
internal/cli/agents.go:163
↓ 6 callersMethodIsExpired
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 callersMethodIsItemStarred
IsItemStarred checks whether a specific item is starred by a user.
internal/store/item_stars.go:43
↓ 6 callersMethodListArchivedItemWorkspaceMovesBySource
ListArchivedItemWorkspaceMovesBySource returns at most `limit` MOVE rows for one source — rows with archived_source true — newest first. It serves th
internal/store/item_workspace_moves.go:160
↓ 6 callersMethodListAuditLog
ListAuditLog returns activities matching the given audit log filters. Supports filtering by action, actor, workspace, and date range.
internal/store/activities.go:507
↓ 6 callersMethodListItemVersions
ListItemVersions returns all versions for an item.
internal/store/items.go:4711
↓ 6 callersMethodListItemVersionsResolved
ListItemVersionsResolved returns versions with full content (diffs resolved). Requires the current item content to reconstruct diff-based versions.
internal/store/items.go:4610
↓ 6 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
↓ 6 callersMethodListWatchesForUser
ListWatchesForUser returns every watch a user holds, across ALL workspaces they're a member of, newest first — enriched with the watched item's ref/ti
internal/store/watches.go:70
↓ 6 callersFunctionNew
(s *store.Store)
internal/server/server.go:397
↓ 6 callersFunctionNewRoomManagerWithConfig
NewRoomManagerWithConfig is the explicit-config form. Empty config fields fall back to package defaults.
internal/collab/manager.go:254
↓ 6 callersFunctionNewSender
NewSender creates a new email sender.
internal/email/sender.go:35
↓ 6 callersFunctionNormalizeSlug
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 callersMethodPlanAttachmentCopy
PlanAttachmentCopy plans the attachment side of a cross-workspace item copy. It writes nothing. DR-11a, restated because it is the whole point of the
internal/store/attachments_copy_plan.go:356
↓ 6 callersFunctionPlaybookLibrary
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 callersFunctionPromptBody
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 callersFunctionRenderMarkdown
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
↓ 6 callersMethodRenewSessionIfStale
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 callersFunctionResolveTool
ResolveTool finds an AgentTool by name or alias. Returns nil if not found.
internal/cli/agents.go:86
↓ 6 callersMethodRevokeAccessTokenFamily
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 callersMethodServeHTTP
(w http.ResponseWriter, r *http.Request)
internal/mcp/dispatch_http_advanced_test.go:910
↓ 6 callersMethodSetEmailSender
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:762
↓ 6 callersMethodSetOpLogGCConfig
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 callersMethodSetSpawn
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 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
↓ 6 callersMethodStartOpLogGC
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 callersMethodSubscribe
Subscribe registers a subscriber for itemID and returns a buffered channel of size subscriberBufSize.
internal/collab/memory_bus.go:50
↓ 6 callersMethodTouchUserWrite
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 callersMethodUnmarkStripeEventProcessed
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 callersMethodUnsubscribe
Unsubscribe removes a subscriber and closes its channel.
internal/watchevents/watchevents.go:118
↓ 6 callersMethodUpdateDocument
(id string, input models.DocumentUpdate)
internal/store/documents.go:224
↓ 6 callersMethodUpdateUser
UpdateUser updates mutable user fields.
internal/store/users.go:162
↓ 6 callersMethodUserHasGrantsInWorkspace
UserHasGrantsInWorkspace checks if a user has any active collection or item grants in a workspace (even though they are not a member). Used to detect
internal/store/grants.go:368
↓ 6 callersFunctionValidatePartialFields
ValidatePartialFields validates ONLY the keys present in `patch` against the schema (TASK-2022, field-level PATCH / IDEA-1480). Unlike ValidateFields
internal/items/validate.go:153
↓ 6 callersMethodValidatePassword
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 callersMethodValidateToken
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 callersFunctionVerifyClaimCode
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 callersFunctionapiRequest
apiRequest makes a JSON API request to the test server.
internal/server/handlers_events_test.go:91
↓ 6 callersFunctionapplyImageSemantics
()
web/src/lib/components/editor/attachment-image.ts:439
↓ 6 callersFunctionassertTransformDenied
assertTransformDenied pins the shared denial: 404 with the exact body every other attachment denial writes.
internal/server/handlers_attachments_transform_authz_test.go:120
↓ 6 callersMethodattachWith
(t *testing.T, ws *models.Workspace, filename string, size int64, storageKey, hash string)
internal/store/attachments_copy_plan_test.go:42
↓ 6 callersFunctionauthHeaders
(fixture: SuiteFixture)
web/e2e/pane-full-page-capstone.spec.ts:56
↓ 6 callersFunctionauthJson
(fixture: SuiteFixture)
web/e2e/lib/attachment-viewer.ts:559
↓ 6 callersFunctionbuildToolFromDef
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 callersFunctioncountIPChangeEvents
countIPChangeEvents returns the number of session_ip_changed rows in the audit log.
internal/server/middleware_session_ip_test.go:405
↓ 6 callersFunctioncountLiveAttachments
(t *testing.T, s *Store, wsID string)
internal/store/attachments_live_item_test.go:35
↓ 6 callersFunctiondecodeItemFields
(t *testing.T, fieldsJSON string)
internal/server/handlers_items_fieldpatch_test.go:27
↓ 6 callersMethoddecryptUserTOTP
decryptUserTOTP decrypts the TOTP secret on a User struct in place.
internal/store/users.go:72
↓ 6 callersFunctiondisplayWidth
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 callersFunctiondistinctPNG
distinctPNG returns a valid PNG whose bytes differ per seed, so an assertion on served content can tell one blob from another. The download handler ne
internal/server/handlers_attachments_download_authz_test.go:149
↓ 6 callersFunctiondoLoopbackRequest
(srv *Server, method, path string, body interface{})
internal/server/server_test.go:44
↓ 6 callersMethodenrichItemForResponse
enrichItemForResponse populates derived closure and parent info on a single item. An optional visibleIDs slice filters related items so hidden-collect
internal/server/item_lineage.go:80
↓ 6 callersFunctionerrStructured
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 callersFunctionescapeTableCell
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 callersFunctionextractCommandBlock
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 callersFunctionextractFieldValue
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 callersFunctionfakeUser
===================================================================== Helpers ===================================================================== fa
internal/mcp/dispatch_http_envelope_test.go:414
↓ 6 callersFunctionfileExists
(dir, name string)
internal/cli/detect.go:203
↓ 6 callersMethodfilterWatchesByCurrentAccess
filterWatchesByCurrentAccess re-checks each watch's CURRENT visibility (workspace membership / role / collection access / item grants) before it is us
internal/server/handlers_watch_access.go:33
↓ 6 callersFunctionflexJSONToString
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:856
↓ 6 callersFunctiongetConfiguredConfig
()
cmd/pad/configure.go:68
↓ 6 callersMethodgetWorkspaceDocument
isUUID is defined in handlers_items.go getWorkspaceDocument resolves workspace slug and document ID from URL params.
internal/server/server.go:2515
↓ 6 callersMethodhasBootstrapToken
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 callersFunctionisAPITokenAuth
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 callersFunctionlistTransitions
listTransitions returns all status_transitions rows for an item, oldest first.
internal/store/status_transitions_test.go:12
↓ 6 callersFunctionliveItemAttachmentFixture
Store-level tests for CreateAttachmentForLiveItem — PLAN-2391 DR-14 / TASK-2402. The handler-level coverage lives in internal/server; these pin the in
internal/store/attachments_live_item_test.go:18
↓ 6 callersMethodmarkUploadInFlight
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:810
↓ 6 callersMethodmatches
True when `key` names the live view. A null key never matches.
web/src/lib/attachments/viewFence.ts:92
↓ 6 callersFunctionmembersHandler
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 callersFunctionmimeDispoFixture
BUG-2413: the attachment read path must fail CLOSED on Content-Disposition — a stored MIME that is not explicitly inline-safe is served as an attachme
internal/server/handlers_attachments_download_mime_test.go:27
↓ 6 callersMethodmove
Move one finger; sends `touchMove` with the full active set.
web/e2e/lib/attachment-viewer.ts:355
↓ 6 callersFunctionmustSeedWorkspaceForMutation
(t *testing.T, srv *Server, ownerID, slug, role string)
internal/server/handlers_connected_apps_mutations_test.go:86
↓ 6 callersFunctionmustWorkspace
(t *testing.T, srv *Server, name, ownerID string)
internal/server/authz_cross_workspace_test.go:93
↓ 6 callersFunctionnewClaimCodeEnv
(t *testing.T)
internal/server/handlers_claim_code_test.go:86
↓ 6 callersFunctionnewConnectedTestStore
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 callersFunctionnewTestConfig
(t *testing.T)
internal/config/encryption_key_test.go:12
↓ 6 callersFunctionnormalizeStringEncodedJSONFields
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 callersFunctionnum
(n int)
internal/cli/format_markdown_test.go:22
↓ 6 callersFunctionpackageHTTPResponse
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 callersFunctionparseAttachmentFilename
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 callersFunctionrecordInstallation
recordInstallation stores a skill install in the global registry (~/.pad/installations.json).
cmd/pad/cmd_agent.go:203
↓ 6 callersMethodregisterPendingAck
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 callersFunctionrenderItemTable
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 callersFunctionrequesterToOAuthRequest
===================================================================== Translation helpers ============================================================
internal/oauth/storage.go:444
↓ 6 callersMethodreset
()
internal/server/handlers_watch_events.go:315
↓ 6 callersMethodresolveWorkspace
resolveWorkspace resolves a workspace by slug or UUID, scoped to the authenticated user's accessible workspaces when a user context is present. Return
internal/server/server.go:2469
↓ 6 callersMethodrunWorkspacePurgeSweep
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 callersFunctionsanitizeFTSQuery
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 callersFunctionsanitizePGFTSQuery
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 callersFunctionscanAttachment
scanAttachment scans a single row into a models.Attachment, handling nullables via *string / *int.
internal/store/attachments.go:39
↓ 6 callersFunctionseedBackfillWorkspace
(t *testing.T, s *Store, name, ownerID string)
internal/store/oauth_connections_backfill_test.go:52
↓ 6 callersFunctionseedCollabFixture
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
← previousnext →601–700 of 7,856, ranked by callers