MCPcopy Create free account

hub / github.com/PerpetualSoftware/pad / functions

Functions6,005 in github.com/PerpetualSoftware/pad

↓ 2 callersMethodNowRFC3339
NowRFC3339 returns the SQL expression for current UTC time in RFC3339 format. SQLite: strftime('%Y-%m-%dT%H:%M:%SZ', 'now') PostgreSQL: TO_CHAR(NOW()
internal/store/dialect.go:59
↓ 2 callersMethodOldestAccessTokenIssuedAtByRequestID
OldestAccessTokenIssuedAtByRequestID returns the requested_at of the earliest access token in the family identified by requestID. Used by the OAuth re
internal/store/oauth.go:477
↓ 2 callersFunctionOnboardPlaybook
OnboardPlaybook returns the library entry for the canonical `/pad onboard` playbook. PLAN-1496 / TASK-1499. Title is "Onboard a workspace" — verb-obj
internal/collections/playbook_library_onboard.go:319
↓ 2 callersFunctionParseFieldsDSL
ParseFieldsDSL parses the compact field DSL (key:type[:options];...) into a CollectionSchema. Empty input returns an empty schema with no error. Firs
internal/collections/dsl.go:31
↓ 2 callersFunctionParseWorkspaceSettings
(raw string)
internal/models/workspace_settings.go:58
↓ 2 callersMethodPostRawWithContentType
PostRawWithContentType is the explicit-content-type variant of PostRaw. Used by the bundle import path to send a tar.gz as application/gzip so the ser
internal/cli/client.go:846
↓ 2 callersFunctionPrintCommentTable
PrintCommentTable prints comments in a formatted table.
internal/cli/format.go:576
↓ 2 callersFunctionPrintItemTable
PrintItemTable prints items in a width-aware, ANSI-safe table. It probes the terminal width (falling back to 120 columns when stdout is piped or the s
internal/cli/format.go:204
↓ 2 callersMethodPrune
Prune removes entries whose skill files no longer exist on disk.
internal/cli/registry.go:114
↓ 2 callersMethodRawGet
RawGet fetches raw bytes from the API. Buffers the entire response in memory; do NOT use for endpoints that can return arbitrarily large bodies (e.g.
internal/cli/client.go:789
↓ 2 callersMethodRecordShareLinkView
RecordShareLinkView atomically increments the view counter (respecting max_views) and records a view entry inside a single transaction. Returns true i
internal/store/share_links.go:218
↓ 2 callersMethodRegisterDBCollector
RegisterDBCollector registers a callback-based collector that exposes database connection pool statistics on each Prometheus scrape. This is preferred
internal/metrics/metrics.go:233
↓ 2 callersFunctionRegisterPrompts
RegisterPrompts installs the four static MCP prompts on srv. Each prompt takes no arguments — `prompts/get` returns a single user-role message contain
internal/mcp/prompts.go:56
↓ 2 callersFunctionResolveAttachmentImage
ResolveAttachmentImage resolves a `![alt](pad-attachment:UUID)` image reference into rendered HTML. Falls back to a file chip when the attachment exis
internal/server/render/attachments.go:185
↓ 2 callersFunctionResolveAttachmentLink
ResolveAttachmentLink resolves a `[text](pad-attachment:UUID)` link reference into rendered HTML. Always renders as a file chip — link syntax indicate
internal/server/render/attachments.go:208
↓ 2 callersFunctionResolveOutboundSecret
ResolveOutboundSecret picks the secret to send on pad → pad-cloud calls given the inbound rotation list and an optional explicit override. Pulled out
internal/billing/cloud_client.go:50
↓ 2 callersMethodRestoreDocument
(id string)
internal/store/documents.go:413
↓ 2 callersMethodRotateRefreshToken
RotateRefreshToken matches fosite's reference MemoryStore (storage/memory.go:497-504): revoke the entire grant — both the refresh family AND the acces
internal/oauth/storage.go:341
↓ 2 callersMethodSendAs
SendAs sends an email with a custom from name (address stays the same since email providers require verified sender domains).
internal/email/sender.go:133
↓ 2 callersMethodSendPasswordReset
SendPasswordReset sends a password reset email with a token link. This is a placeholder — the password reset flow (IDEA-81) will call this once the re
internal/email/templates.go:109
↓ 2 callersMethodSendTest
SendTest sends a test email to verify the email configuration.
internal/email/templates.go:273
↓ 2 callersFunctionSerializeWorkspaceSettings
(settings *WorkspaceSettings)
internal/models/workspace_settings.go:70
↓ 2 callersMethodSetBaseURL
SetBaseURL sets the public base URL used for generating shareable links. If the supplied URL has an unspecified bind-all host ("0.0.0.0", "::", "[::]
internal/server/server.go:504
↓ 2 callersMethodSetCORSOrigins
SetCORSOrigins configures allowed CORS origins (comma-separated).
internal/server/server.go:717
↓ 2 callersMethodSetClaimSecret
SetClaimSecret wires the HMAC key used to derive + verify stateless 6-digit claim codes for the POST /api/v1/oauth/claim endpoint (PLAN-1519 / TASK-15
internal/server/handlers_oauth.go:100
↓ 2 callersMethodSetCollabRoomManager
SetCollabRoomManager attaches a Yjs collab RoomManager (PLAN-1248). When set, the /api/v1/collab/{itemID} WebSocket endpoint hands new connections to
internal/server/server.go:677
↓ 2 callersMethodSetEndpoint
SetEndpoint overrides the Maileroo API endpoint. Intended for tests that stand up an httptest server mimicking Maileroo's v2 API — production callers
internal/email/sender.go:68
↓ 2 callersMethodSetEventBus
SetEventBus attaches an event bus for real-time SSE streaming.
internal/server/server.go:667
↓ 2 callersMethodSetImportArtifactMaxBytes
SetImportArtifactMaxBytes overrides the default 1 MiB cap on a single playbook/convention artifact import. Set to 0 to fall back to the default. Wired
internal/server/server.go:790
↓ 2 callersMethodSetMetrics
SetMetrics attaches Prometheus metrics to the server. Must be called before the first request is served. Side effect (TASK-961): when both metrics AN
internal/server/server.go:807
↓ 2 callersMethodSetMetricsToken
SetMetricsToken configures the static bearer token required to scrape metrics. When empty (the default), /metrics is exposed only to loopback callers
internal/server/server.go:847
↓ 2 callersMethodSetOrphanGCConfig
SetOrphanGCConfig overrides the default sweep interval (24h) and grace period (30d). Pass 0 for either to keep the package default. Must be called bef
internal/server/orphan_gc.go:188
↓ 2 callersMethodSetUserEmailVerified
SetUserEmailVerified marks a user's email as verified (email_verified_at = now) WITHOUT a token — for paths that prove email control by other means, e
internal/store/email_verification.go:155
↓ 2 callersFunctionShipPlaybook
ShipPlaybook returns the seeded `ship` playbook for the startup template. PLAN-1377's headline deliverable: gives every fresh `startup` workspace a re
internal/collections/templates_startup_ship.go:330
↓ 2 callersFunctionSoftwareStarterConventions
SoftwareStarterConventions returns the curated convention seed pack for software workspaces. Titles are pulled from ConventionLibrary so the text stay
internal/collections/templates.go:253
↓ 2 callersFunctionSoftwareStarterPlaybooks
SoftwareStarterPlaybooks returns the curated playbook seed pack for software workspaces.
internal/collections/templates.go:265
↓ 2 callersMethodStartOrphanGC
StartOrphanGC kicks off the periodic sweep loop. Idempotent — calling twice is a no-op (existing loop continues, second call returns silently). Must b
internal/server/orphan_gc.go:207
↓ 2 callersMethodStatus
Status walks every global (per-user) agent and reports installation state. CWDBased agents (Claude Code) are omitted — their config is project-local,
internal/mcp/install.go:677
↓ 2 callersMethodStorage
Storage returns the storage adapter. Exposed for sub-PR C's oauth/register handler (which calls Storage.store directly to CreateOAuthClient) and for t
internal/oauth/server.go:228
↓ 2 callersFunctionStripFrontmatter
StripFrontmatter removes YAML frontmatter (between --- delimiters) from content.
internal/cli/agents.go:183
↓ 2 callersMethodSubscribeIfAllowed
SubscribeIfAllowed atomically checks the global and per-workspace subscriber limits and, only if both are satisfied, subscribes in the same critical s
internal/events/bus.go:106
↓ 2 callersMethodSubscriberCount
SubscriberCount returns the number of active local subscribers.
internal/events/bus.go:123
↓ 2 callersMethodSweepMCPAuditOlderThan
SweepMCPAuditOlderThan deletes audit rows older than cutoff and returns the number of rows removed. Called from a periodic goroutine in Server.Start (
internal/store/mcp_audit.go:279
↓ 2 callersFunctionTerminalStatusesFromSchema
── Back-compat wrappers ──────────────────────────────────────────────── The original API (status-only) stays in place so callers that don't yet have
internal/models/terminal.go:158
↓ 2 callersFunctionToItemSummaries
ToItemSummaries projects a slice of items into summary shape, preserving order. A nil input yields a non-nil empty slice so the JSON encodes as `[]`.
internal/cli/item_summary.go:120
↓ 2 callersFunctionToItemSummary
ToItemSummary projects a single models.Item into the summary shape.
internal/cli/item_summary.go:98
↓ 2 callersFunctionTokenScopeAllows
TokenScopeAllows is the exported wrapper around the package-private tokenScopeAllows: returns true iff the scopes JSON permits the given HTTP method a
internal/server/context.go:121
↓ 2 callersMethodUnstarItem
UnstarItem removes a star from an item for a user. Returns sql.ErrNoRows if not starred.
internal/store/item_stars.go:27
↓ 2 callersMethodUnsubscribe
Unsubscribe removes a subscriber and closes its channel. No-op when the channel is unknown — a double-Unsubscribe (e.g. handler defer firing after Clo
internal/collab/memory_bus.go:65
↓ 2 callersFunctionUnsubscribeURL
UnsubscribeURL generates an HMAC-signed unsubscribe link for the given email. The secret should be a stable server-side key (e.g. derived from the API
internal/email/unsubscribe.go:13
↓ 2 callersMethodUpdateWorkspace
(slug string, input models.WorkspaceUpdate)
internal/store/workspaces.go:209
↓ 2 callersMethodUpdateWorkspaceMemberRole
UpdateWorkspaceMemberRole changes a member's role in a workspace.
internal/store/workspace_members.go:606
↓ 2 callersFunctionValidMode
(mode string)
internal/config/config.go:287
↓ 2 callersMethodValidateCloudSecureCookies
ValidateCloudSecureCookies returns an error if this server process is opted into cloud-tenant mode (see IsCloudServer) without secure cookies enabled.
internal/config/config.go:334
↓ 2 callersMethodWorkspaceHasUserCreatedItems
WorkspaceHasUserCreatedItems reports whether ANY non-deleted item in the workspace was created by something other than template seeding. Used by the a
internal/store/items.go:4562
↓ 2 callersMethodWorkspaceStorageLimit
WorkspaceStorageLimit returns the effective storage limit (bytes) for the workspace owner's plan, or -1 if the plan is unlimited. Thin wrapper around
internal/store/attachments.go:929
↓ 2 callersFunctionWriteOpenChildrenError
WriteOpenChildrenError formats an open-children rejection to w in the canonical two-track shape the project guarantees (IDEA-1494 R2): 1. A single `p
internal/cli/client.go:1147
↓ 2 callersMethodacquireWorkspaceParentLinkLock
acquireWorkspaceParentLinkLock takes a Postgres advisory transaction lock that serializes ALL parent-edge-ADDING transactions within a workspace (BUG-
internal/store/items.go:140
↓ 2 callersFunctionactionMetaServerInfo
actionMetaServerInfo returns the minimal {name, version} pair. Roughly equivalent to what the MCP handshake exposes, but available post-handshake with
internal/mcp/catalog_meta.go:85
↓ 2 callersFunctionactionWorkspaceAuditLog
actionWorkspaceAuditLog reshapes the input for `pad workspace audit-log`'s `--action` filter flag. The CLI flag name `action` would normally be reacha
internal/mcp/catalog_workspace.go:112
↓ 2 callersFunctionadvanceQueue
()
web/src/lib/stores/openChildrenDialog.svelte.ts:25
↓ 2 callersFunctionagentValidArgs
()
cmd/pad/mcp.go:152
↓ 2 callersFunctionagingBuckets
agingBuckets distributes open-item ages (hours) into fixed bands. Always returns all four bands in order (zero counts included) for a stable shape.
internal/store/reports.go:987
↓ 2 callersMethodappendSearchFilters
appendSearchFilters adds workspace, collection, and field filter clauses to a query. Used to keep count and results queries in sync.
internal/store/search.go:623
↓ 2 callersFunctionappliedMigrations
appliedMigrations returns the set of migration version strings recorded in schema_migrations (the full filename, e.g. "073_workspace_deleted_at_idx.sq
internal/store/migration_guard.go:16
↓ 2 callersFunctionapplyPadTomlOverride
applyPadTomlOverride layers the per-directory .pad.toml `url` field on top of cfg when present and Mode is not already explicitly set by --url. The ov
cmd/pad/main.go:211
↓ 2 callersFunctionapplyPostgresMigration
applyPostgresMigration applies a single Postgres migration file atomically. IDEA-1485: even though Postgres wraps each DDL statement in an implicit t
internal/store/store.go:715
↓ 2 callersFunctionassertRowAffected
assertRowAffected returns notFound if the statement didn't touch any rows, the underlying RowsAffected error if the driver can't report, and nil other
internal/store/oauth_connections.go:603
↓ 2 callersFunctionatoiSafe
atoiSafe returns the decimal value of s, or 0 if s is not a positive decimal integer. Used by promptForMode where 0 (no match) is always an invalid mo
cmd/pad/configure.go:274
↓ 2 callersFunctionattachmentDownloadUrl
( workspaceSlug: string, attachmentId: string, variant?: 'thumb-sm' | 'thumb-md' | 'original' )
web/src/lib/markdown/attachments.ts:68
↓ 2 callersFunctionattachmentURL
attachmentURL returns the canonical download URL for an attachment. Uses the workspace slug from the request — the same shape every other API endpoint
internal/server/handlers_attachments.go:333
↓ 2 callersFunctionautoPopulateDates
autoPopulateDates auto-fills start_date/end_date when status changes to active/completed. Only sets dates if the schema defines those date fields and
internal/server/handlers_items.go:2471
↓ 2 callersMethodbackfillItemNumbers
backfillItemNumbers assigns prefixes to collections that lack them and sequential item_number values to items that don't have one yet. On first run a
internal/store/store.go:895
↓ 2 callersMethodbackfillUsernames
backfillUsernames generates usernames for existing users that don't have one. Idempotent: skips users who already have a non-empty username.
internal/store/users.go:1108
↓ 2 callersMethodbackfillWorkspaceOwners
backfillWorkspaceOwners ensures every workspace has at least one owner. For workspaces with no members, the first admin user is added as owner. This h
internal/store/workspace_members.go:799
↓ 2 callersFunctionbenchSeedConnection
Hot-path benchmark for GetOAuthConnectionAccess (PLAN-1519 Phase A acceptance: "Hot-path benchmark: dual-read overhead measured and documented"). The
internal/store/bench_oauth_connections_test.go:45
↓ 2 callersFunctionbestEffortWorkspaceHints
bestEffortWorkspaceHints calls lookup.ListWorkspaces and swallows errors. The error envelope is more valuable than nothing even when the listing faile
internal/mcp/errors.go:303
↓ 2 callersFunctionblobPresent
(t *testing.T, srv *Server, storageKey string)
internal/server/workspace_purge_test.go:46
↓ 2 callersFunctionblockAtPos
(view: EditorView, pos: number)
web/src/lib/components/editor/block-drag-handle.ts:97
↓ 2 callersFunctionboolToString
boolToString converts a Go bool to the string representation used in audit metadata. Kept local to this file because audit metadata is string-typed (J
internal/server/handlers_cloud.go:1014
↓ 2 callersFunctionbroadcast
(env: BCEnvelope)
web/src/lib/services/sse.svelte.ts:98
↓ 2 callersFunctionbrowserLogin
* Editor / collab persistence e2e (TASK-2058 under TASK-733). * * The editor path is the subsystem with the strictest cross-component * invariants
web/e2e/collab-persistence.spec.ts:41
↓ 2 callersMethodbuildCollectionDoneContextMap
buildCollectionDoneContextMap loads schema + settings for every collection in a workspace. Used to evaluate "is terminal?" for a batch of items from p
internal/store/item_stars.go:173
↓ 2 callersFunctionbuildDescriptor
( tool: ToolSurfaceTool, execute: (args: Record<string, unknown>) => Promise<ModelContextToolResult>, )
web/src/lib/webmcp/descriptors.ts:127
↓ 2 callersFunctionbuildDescriptors
( surface: ToolSurfaceResponse, executeFor: ( toolName: string, ) => (args: Record<string, unknown>) => P
web/src/lib/webmcp/descriptors.ts:177
↓ 2 callersFunctionbuildDoc
(row: ItemIndexRow)
web/src/lib/stores/localSearch.svelte.ts:301
↓ 2 callersFunctionbuildHTTPRequest
buildHTTPRequest constructs the in-process request, attaching the user via the exported server.WithCurrentUser helper so the handler chain treats the
internal/mcp/dispatch_http.go:583
↓ 2 callersFunctionbuildRelatedGroups
(item *models.Item, links []models.ItemLink)
cmd/pad/query.go:265
↓ 2 callersFunctionbuildTestRoot
buildTestRoot returns a minimal cobra tree that mirrors `pad`'s structure closely enough to exercise the help routing layer: root ├── item (group)
cmd/pad/help_cmdhelp_test.go:26
↓ 2 callersFunctionbuildToolSurfacePayload
buildToolSurfacePayload assembles the full tool-surface document (version + rollout status + tools) from a catalog slice. The payload shape is identic
internal/mcp/tool_surface.go:200
↓ 2 callersFunctioncancel
()
web/src/lib/collab/collabFlush.svelte.ts:150
↓ 2 callersFunctioncanonicalIP
canonicalIP returns the semantic (canonical text) form of an IP address string. For IPv6 this collapses different valid spellings (compressed vs expan
internal/server/middleware_auth.go:806
↓ 2 callersFunctioncanonicalMediaType
canonicalMediaType returns the lower-cased media type stripped of parameters (charset, boundary, etc.).
internal/urlimport/detect.go:70
↓ 2 callersFunctioncanonicalizeRef
canonicalizeRef uppercases the prefix portion of a "PREFIX-N" ref so the index has a single canonical shape per (workspace, prefix, number) regardless
internal/links/extract.go:663
↓ 2 callersMethodcheckMCPRateLimit
checkMCPRateLimit applies the per-token bucket on /mcp requests (PLAN-943 TASK-959). Returns true if the request is allowed through; false if rate-lim
internal/server/middleware_ratelimit.go:561
↓ 2 callersFunctionclassifyCapabilityTier
classifyCapabilityTier maps a fosite-style space-separated scope string into a coarse user-readable bucket. Currently three tiers: - read_only: on
internal/store/connected_apps.go:351
↓ 2 callersFunctionclassifyMCPResult
classifyMCPResult maps an HTTP status to (audit_status, error_kind). JSON-RPC quirk: tool errors come back as 200 OK with an `error` field in the res
internal/server/middleware_mcp_audit.go:440
↓ 2 callersMethodclearParentLinkTx
clearParentLinkTx removes the item's parent link within the caller's transaction. Shared by the public ClearParentLink (own tx) and UpdateItemWithPare
internal/store/items.go:3054
↓ 2 callersFunctionclearSessionCookie
(w http.ResponseWriter, secure bool)
internal/server/middleware_auth.go:1067
↓ 2 callersFunctionclearStoredCursor
(itemID: string)
web/src/lib/collab/wsProvider.svelte.ts:150
← previousnext →1,201–1,300 of 6,005, ranked by callers