Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/PerpetualSoftware/pad
/ functions
Functions
6,005 in github.com/PerpetualSoftware/pad
⨍
Functions
6,005
◇
Types & classes
763
↓ 2 callers
Method
NowRFC3339
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 callers
Method
OldestAccessTokenIssuedAtByRequestID
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 callers
Function
OnboardPlaybook
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 callers
Function
ParseFieldsDSL
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 callers
Function
ParseWorkspaceSettings
(raw string)
internal/models/workspace_settings.go:58
↓ 2 callers
Method
PostRawWithContentType
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 callers
Function
PrintCommentTable
PrintCommentTable prints comments in a formatted table.
internal/cli/format.go:576
↓ 2 callers
Function
PrintItemTable
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 callers
Method
Prune
Prune removes entries whose skill files no longer exist on disk.
internal/cli/registry.go:114
↓ 2 callers
Method
RawGet
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 callers
Method
RecordShareLinkView
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 callers
Method
RegisterDBCollector
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 callers
Function
RegisterPrompts
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 callers
Function
ResolveAttachmentImage
ResolveAttachmentImage resolves a `` image reference into rendered HTML. Falls back to a file chip when the attachment exis
internal/server/render/attachments.go:185
↓ 2 callers
Function
ResolveAttachmentLink
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 callers
Function
ResolveOutboundSecret
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 callers
Method
RestoreDocument
(id string)
internal/store/documents.go:413
↓ 2 callers
Method
RotateRefreshToken
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 callers
Method
SendAs
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 callers
Method
SendPasswordReset
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 callers
Method
SendTest
SendTest sends a test email to verify the email configuration.
internal/email/templates.go:273
↓ 2 callers
Function
SerializeWorkspaceSettings
(settings *WorkspaceSettings)
internal/models/workspace_settings.go:70
↓ 2 callers
Method
SetBaseURL
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 callers
Method
SetCORSOrigins
SetCORSOrigins configures allowed CORS origins (comma-separated).
internal/server/server.go:717
↓ 2 callers
Method
SetClaimSecret
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 callers
Method
SetCollabRoomManager
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 callers
Method
SetEndpoint
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 callers
Method
SetEventBus
SetEventBus attaches an event bus for real-time SSE streaming.
internal/server/server.go:667
↓ 2 callers
Method
SetImportArtifactMaxBytes
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 callers
Method
SetMetrics
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 callers
Method
SetMetricsToken
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 callers
Method
SetOrphanGCConfig
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 callers
Method
SetUserEmailVerified
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 callers
Function
ShipPlaybook
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 callers
Function
SoftwareStarterConventions
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 callers
Function
SoftwareStarterPlaybooks
SoftwareStarterPlaybooks returns the curated playbook seed pack for software workspaces.
internal/collections/templates.go:265
↓ 2 callers
Method
StartOrphanGC
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 callers
Method
Status
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 callers
Method
Storage
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 callers
Function
StripFrontmatter
StripFrontmatter removes YAML frontmatter (between --- delimiters) from content.
internal/cli/agents.go:183
↓ 2 callers
Method
SubscribeIfAllowed
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 callers
Method
SubscriberCount
SubscriberCount returns the number of active local subscribers.
internal/events/bus.go:123
↓ 2 callers
Method
SweepMCPAuditOlderThan
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 callers
Function
TerminalStatusesFromSchema
── Back-compat wrappers ──────────────────────────────────────────────── The original API (status-only) stays in place so callers that don't yet have
internal/models/terminal.go:158
↓ 2 callers
Function
ToItemSummaries
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 callers
Function
ToItemSummary
ToItemSummary projects a single models.Item into the summary shape.
internal/cli/item_summary.go:98
↓ 2 callers
Function
TokenScopeAllows
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 callers
Method
UnstarItem
UnstarItem removes a star from an item for a user. Returns sql.ErrNoRows if not starred.
internal/store/item_stars.go:27
↓ 2 callers
Method
Unsubscribe
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 callers
Function
UnsubscribeURL
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 callers
Method
UpdateWorkspace
(slug string, input models.WorkspaceUpdate)
internal/store/workspaces.go:209
↓ 2 callers
Method
UpdateWorkspaceMemberRole
UpdateWorkspaceMemberRole changes a member's role in a workspace.
internal/store/workspace_members.go:606
↓ 2 callers
Function
ValidMode
(mode string)
internal/config/config.go:287
↓ 2 callers
Method
ValidateCloudSecureCookies
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 callers
Method
WorkspaceHasUserCreatedItems
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 callers
Method
WorkspaceStorageLimit
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 callers
Function
WriteOpenChildrenError
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 callers
Method
acquireWorkspaceParentLinkLock
acquireWorkspaceParentLinkLock takes a Postgres advisory transaction lock that serializes ALL parent-edge-ADDING transactions within a workspace (BUG-
internal/store/items.go:140
↓ 2 callers
Function
actionMetaServerInfo
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 callers
Function
actionWorkspaceAuditLog
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 callers
Function
advanceQueue
()
web/src/lib/stores/openChildrenDialog.svelte.ts:25
↓ 2 callers
Function
agentValidArgs
()
cmd/pad/mcp.go:152
↓ 2 callers
Function
agingBuckets
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 callers
Method
appendSearchFilters
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 callers
Function
appliedMigrations
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 callers
Function
applyPadTomlOverride
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 callers
Function
applyPostgresMigration
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 callers
Function
assertRowAffected
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 callers
Function
atoiSafe
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 callers
Function
attachmentDownloadUrl
( workspaceSlug: string, attachmentId: string, variant?: 'thumb-sm' | 'thumb-md' | 'original' )
web/src/lib/markdown/attachments.ts:68
↓ 2 callers
Function
attachmentURL
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 callers
Function
autoPopulateDates
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 callers
Method
backfillItemNumbers
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 callers
Method
backfillUsernames
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 callers
Method
backfillWorkspaceOwners
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 callers
Function
benchSeedConnection
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 callers
Function
bestEffortWorkspaceHints
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 callers
Function
blobPresent
(t *testing.T, srv *Server, storageKey string)
internal/server/workspace_purge_test.go:46
↓ 2 callers
Function
blockAtPos
(view: EditorView, pos: number)
web/src/lib/components/editor/block-drag-handle.ts:97
↓ 2 callers
Function
boolToString
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 callers
Function
broadcast
(env: BCEnvelope)
web/src/lib/services/sse.svelte.ts:98
↓ 2 callers
Function
browserLogin
* 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 callers
Method
buildCollectionDoneContextMap
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 callers
Function
buildDescriptor
( tool: ToolSurfaceTool, execute: (args: Record<string, unknown>) => Promise<ModelContextToolResult>, )
web/src/lib/webmcp/descriptors.ts:127
↓ 2 callers
Function
buildDescriptors
( surface: ToolSurfaceResponse, executeFor: ( toolName: string, ) => (args: Record<string, unknown>) => P
web/src/lib/webmcp/descriptors.ts:177
↓ 2 callers
Function
buildDoc
(row: ItemIndexRow)
web/src/lib/stores/localSearch.svelte.ts:301
↓ 2 callers
Function
buildHTTPRequest
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 callers
Function
buildRelatedGroups
(item *models.Item, links []models.ItemLink)
cmd/pad/query.go:265
↓ 2 callers
Function
buildTestRoot
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 callers
Function
buildToolSurfacePayload
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 callers
Function
cancel
()
web/src/lib/collab/collabFlush.svelte.ts:150
↓ 2 callers
Function
canonicalIP
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 callers
Function
canonicalMediaType
canonicalMediaType returns the lower-cased media type stripped of parameters (charset, boundary, etc.).
internal/urlimport/detect.go:70
↓ 2 callers
Function
canonicalizeRef
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 callers
Method
checkMCPRateLimit
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 callers
Function
classifyCapabilityTier
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 callers
Function
classifyMCPResult
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 callers
Method
clearParentLinkTx
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 callers
Function
clearSessionCookie
(w http.ResponseWriter, secure bool)
internal/server/middleware_auth.go:1067
↓ 2 callers
Function
clearStoredCursor
(itemID: string)
web/src/lib/collab/wsProvider.svelte.ts:150
← previous
next →
1,201–1,300 of 6,005, ranked by callers