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
Function
clearTimerFor
(id: string)
web/src/lib/stores/toast.svelte.ts:77
↓ 2 callers
Function
cliAuthBrowserURL
cliAuthBrowserURL builds the auth-approval URL we print to the user during `pad auth login`. We construct it on the CLI side rather than trusting the
cmd/pad/cmd_auth.go:396
↓ 2 callers
Function
cliAuthScheme
cliAuthScheme picks the URL scheme for the CLI auth link. Precedence: 1. If the request hit this server over TLS (r.TLS != nil) → "https". 2. If a tr
internal/server/handlers_cli_auth.go:169
↓ 2 callers
Method
clock
()
internal/server/handlers_storage.go:51
↓ 2 callers
Function
cmdhelpOptions
cmdhelpOptions builds the Options struct shared by JSON and markdown emitters. Centralized so both formats see the same dynamic resolver, version meta
cmd/pad/help_cmdhelp.go:129
↓ 2 callers
Function
coercePlaybookValue
coercePlaybookValue converts a raw CLI token into the typed Go value the spec describes. ref/string pass through; number is parsed as float64; enum is
internal/server/handlers_playbooks.go:493
↓ 2 callers
Function
collapseAutosaveBursts
collapseAutosaveBursts walks the newest-first entries and drops a collab-snapshot version when the previous kept entry is also a collab-snapshot versi
internal/server/handlers_timeline.go:263
↓ 2 callers
Function
collapseChanges
collapseChanges takes a "; "-delimited list of "field: old → new" entries and collapses runs of consecutive same-field entries into a single "field: f
internal/store/activities.go:142
↓ 2 callers
Function
collectFlags
(fs *pflag.FlagSet)
internal/cmdhelp/json.go:385
↓ 2 callers
Method
collectPlaybookMetadata
collectPlaybookMetadata returns every playbook in the workspace projected down to the metadata shape. Bodies are NOT included. collIDs / itemIDs scop
internal/server/handlers_bootstrap.go:765
↓ 2 callers
Method
collectionChildrenProgress
collectionChildrenProgress is the shared implementation for child-item completion progress across any collection. It enforces the same visibility/gues
internal/server/handlers_items.go:1921
↓ 2 callers
Function
configureEmailForTest
configureEmailForTest attaches an email.Sender wired to the given mock endpoint plus a base URL so s.baseURL != "" (the configured check looks at both
internal/server/cloud_admin_gate_test.go:771
↓ 2 callers
Function
connectionToDTO
(c models.OAuthConnection, stats *models.MCPConnectionStats)
internal/server/handlers_connected_apps.go:77
↓ 2 callers
Method
consumeBootstrapToken
consumeBootstrapToken clears the in-memory token and deletes the on-disk file. Called after the first admin is successfully created. Caller MUST hold
internal/server/bootstrap.go:214
↓ 2 callers
Function
contains
contains is a small test helper.
internal/server/handlers_playbooks_test.go:393
↓ 2 callers
Function
containsAction
containsAction reports whether a tool's documentation line references the given action. Actions are rendered backtick-quoted in the README table (`cre
internal/mcp/tool_surface_drift_test.go:125
↓ 2 callers
Function
contentPreview
contentPreview returns the first non-empty line of the body (markdown stripped of a leading heading marker), truncated to contentPreviewLimit runes wi
internal/cli/item_summary.go:50
↓ 2 callers
Function
copyStrings
copyStrings returns a defensive copy of a string slice so the helper's returned schema cannot mutate the caller's option list.
internal/collections/templates.go:295
↓ 2 callers
Function
corsAllowCredentials
corsAllowCredentials reports whether the CORS middleware should set Access-Control-Allow-Credentials: true. The current CLI tooling uses Bearer tokens
internal/server/middleware_security.go:102
↓ 2 callers
Function
create
(data: { name: string; description?: string; template?: string })
web/src/lib/stores/workspace.svelte.ts:126
↓ 2 callers
Method
createCLIAuthSession
(ttl time.Duration)
internal/store/cli_auth_sessions.go:48
↓ 2 callers
Method
createItemChecked
createItemChecked is the shared item-create core: schema-field validation → workspace-unique-field precheck → persist → optional parent link → activit
internal/server/handlers_items.go:663
↓ 2 callers
Function
createMiniSearch
()
web/src/lib/stores/localSearch.svelte.ts:214
↓ 2 callers
Function
createWSWithDeletedAt
createWSWithDeletedAt creates a workspace and stamps its deleted_at to a specific time so the boundary test can inject a deterministic age.
internal/store/workspace_purge_test.go:327
↓ 2 callers
Function
dashboardArrayField
dashboardArrayField pulls a named array out of a decoded dashboard payload, returning a typed []map[string]any so the callers can filter / sort by str
internal/mcp/dispatch_http_project.go:219
↓ 2 callers
Function
dateBucketSubstr
dateBucketSubstr truncates a UTC RFC3339 TEXT timestamp to its day ("hour" → chars 1-13 "YYYY-MM-DDTHH"; otherwise → chars 1-10 "YYYY-MM-DD"). The SUB
internal/store/dialect.go:317
↓ 2 callers
Function
decodeToolSurface
(t *testing.T)
internal/mcp/tool_surface_test.go:28
↓ 2 callers
Function
defaultIfEmpty
(v, fallback string)
cmd/pad/cmd_bootstrap.go:174
↓ 2 callers
Method
deliver
deliver sends a webhook, retrying transient failures up to maxDeliveryAttempts with linear backoff, and records the final outcome once via the store.
internal/webhooks/dispatcher.go:215
↓ 2 callers
Function
deriveClaimCodeForBucket
deriveClaimCodeForBucket is the inner derive — split out so VerifyClaimCode can derive both the current and previous bucket without re-computing the b
internal/server/claim_codes.go:86
↓ 2 callers
Function
deriveTOTPStep
deriveTOTPStep returns the TOTP time-step whose generated code equals passcode, searching the same ±1 skew window totp.Validate accepts (in the librar
internal/server/handlers_2fa.go:40
↓ 2 callers
Method
deriveThumbnails
deriveThumbnails generates thumb-sm and thumb-md variants for the uploaded image identified by parentID. Idempotent and tolerant of every failure mode
internal/server/handlers_attachments_thumbnails.go:52
↓ 2 callers
Method
destroy
Cleanly close the WS, unbind doc/awareness handlers, and * prevent further reconnect attempts. Safe to call more than * once; idempotent.
web/src/lib/collab/wsProvider.svelte.ts:590
↓ 2 callers
Function
disconnect
()
web/src/lib/services/sse.svelte.ts:383
↓ 2 callers
Method
dispatchItemBulkUpdate
--- item bulk-update --- dispatchItemBulkUpdate iterates the input's `ref` array and applies --status / --priority via the same read-modify-write sema
internal/mcp/dispatch_http_project.go:291
↓ 2 callers
Function
dispatchItemEvent
(data: ItemEvent)
web/src/lib/services/sse.svelte.ts:84
↓ 2 callers
Function
dispatchSyncRequired
()
web/src/lib/services/sse.svelte.ts:91
↓ 2 callers
Function
doGetWithCookieUA
doGetWithCookieUA issues a GET with the session cookie, a fixed client IP matching the session binding, and a caller-chosen User-Agent. GET needs no C
internal/server/middleware_session_ua_test.go:35
↓ 2 callers
Function
doIncrementalOrFull
(absenceMs: number)
web/src/lib/services/sync.svelte.ts:153
↓ 2 callers
Function
doneFieldKeyFromSchemaJSON
doneFieldKeyFromSchemaJSON resolves the done-field key from the raw schema + settings JSON strings (as stored on the collections row). Falls back to "
internal/store/status_transitions_backfill.go:84
↓ 2 callers
Method
doneFiltersForWorkspace
doneFiltersForWorkspace returns a done-filter per collection in the workspace. Used by cross-collection queries (e.g. agent-role breakdowns) that need
internal/store/items.go:3307
↓ 2 callers
Function
downloadAttachmentToPath
downloadAttachmentToPath streams the attachment into a sibling temp file and atomically renames it onto outPath on success. Shared by `attachment down
cmd/pad/cmd_attachment.go:184
↓ 2 callers
Function
downloadTextFile
(filename: string, text: string, mime = 'text/markdown')
web/src/lib/utils/artifacts.ts:14
↓ 2 callers
Function
drain
drain reads up to n events from ch with a short timeout so a missing/slow event doesn't hang the test.
internal/collab/bus_test.go:258
↓ 2 callers
Function
dropPosAtY
(view: EditorView, y: number, dragPos: number)
web/src/lib/components/editor/block-drag-handle.ts:156
↓ 2 callers
Function
durationHours
--- cycle-time / WIP helpers (PLAN-1628 / TASK-1631) --- durationHours returns hours between two RFC3339 timestamps (end-start), clamped at 0. ok is f
internal/store/reports.go:915
↓ 2 callers
Method
effectivePurgeRetention
effectivePurgeRetention returns the retention window the purge sweeper actually enforces: the SetWorkspacePurgeConfig override when set (PAD_WORKSPACE
internal/server/workspace_purge.go:87
↓ 2 callers
Function
effectiveWorkspaceUpdatedAt
effectiveWorkspaceUpdatedAt returns the later of the workspace's own updated_at and the most recent item activity inside it. See BUG-1481 for why item
internal/store/workspaces.go:56
↓ 2 callers
Method
emitMCPAuditDenied
emitMCPAuditDenied records an audit row for a request that MCPBearerAuth resolved (so we know the user + token identity) but then rejected — currently
internal/server/middleware_mcp_audit.go:547
↓ 2 callers
Function
encodePNG
(t *testing.T, img image.Image)
internal/attachments/processor_test.go:38
↓ 2 callers
Function
encodeSchemaForBody
encodeSchemaForBody converts a `schema` MCP input value into a JSON-encoded CollectionSchema string suitable for the create-collection HTTP body's `sc
internal/mcp/dispatch_http_routes.go:623
↓ 2 callers
Method
enforceUserPlanLimit
enforceUserPlanLimit checks a user-scoped plan limit and writes a 403 error if the limit is exceeded. Returns true if the operation is allowed. In non
internal/server/handlers_cloud.go:1113
↓ 2 callers
Method
enrichActivities
enrichActivities populates ItemTitle, ItemSlug, and CollectionSlug on each activity by looking up the referenced item.
internal/server/handlers_activity.go:159
↓ 2 callers
Function
errorServer
errorServer returns an httptest.Server that answers every request with the given status + API error envelope ({"error":{"code","message"}}), matching
internal/cli/item_notfound_test.go:18
↓ 2 callers
Function
escapeHtml
* Escape HTML-significant characters so a user-controlled string can be * safely interpolated into attribute values / text nodes.
web/src/lib/utils/markdown.ts:274
↓ 2 callers
Function
expectNoMessage
expectNoMessage checks that no NON-cursor frame arrives within d. Cursor TextMessage frames (TASK-1319) are drained without failing the assertion — th
internal/collab/manager_test.go:333
↓ 2 callers
Function
extractAllowedWorkspacesFromSessionExtra
extractAllowedWorkspacesFromSessionExtra parses session_data JSON and returns the extracted shape. Defensive: malformed JSON, non-object .extra, non-s
internal/store/oauth_connections_backfill.go:394
↓ 2 callers
Function
extractItemStatus
(fieldsJSON string)
cmd/pad/reconcile.go:356
↓ 2 callers
Function
extractPragmas
extractPragmas scans the migration text line-by-line and lifts any top-level `PRAGMA ...;` statement out of the body. It returns the lifted pragma sta
internal/store/store.go:534
↓ 2 callers
Function
extractUpstreamMessage
extractUpstreamMessage pulls a human-readable message out of an upstream error body. Three return shapes: - Pad's structured envelope ({error:{messag
internal/mcp/errors.go:956
↓ 2 callers
Function
extractVerifyToken
extractVerifyToken pulls the padver_ token out of a verification email body.
internal/server/handlers_verify_email_test.go:80
↓ 2 callers
Method
fetchDashboardJSON
fetchDashboardJSON hits the workspace dashboard endpoint and decodes the response into a generic map[string]any so the dispatcher preserves every fiel
internal/mcp/dispatch_http_project.go:184
↓ 2 callers
Method
fetchItem
fetchItem retrieves a full models.Item via the api/v1/workspaces/{ws}/items/{ref} surface. Used by the related / implemented-by dispatchers which need
internal/mcp/dispatch_http_links.go:497
↓ 2 callers
Function
filenameFromContentDisposition
filenameFromContentDisposition extracts the filename token from a Content-Disposition header value (e.g. `attachment; filename="foo.pad.md"`). Returns
internal/cli/client.go:764
↓ 2 callers
Function
filterAgentAttention
(attention []server.DashboardAttention)
cmd/pad/query.go:238
↓ 2 callers
Function
findCatalogTool
findCatalogTool returns the ToolDef with the given name, or a failed test.
internal/mcp/catalog_project_test.go:6
↓ 2 callers
Function
findGaugeValue
findGaugeValue is a small lookup helper for the OAuth active-tokens test. Returns -1 when the metric isn't present so callers can spot "missing" disti
internal/metrics/metrics_test.go:336
↓ 2 callers
Function
findToolLine
findToolLine returns the first line of doc whose trimmed form starts with prefix (the tool's documentation-line marker), or "" if none matches. Scopin
internal/mcp/tool_surface_drift_test.go:111
↓ 2 callers
Function
flatJSONBody
flatJSONBody serializes selected input keys into a JSON object. Empty-string values are skipped; nil values are skipped. For more complex shapes (nes
internal/mcp/dispatch_http_routes.go:172
↓ 2 callers
Function
formatChangeValue
formatChangeValue renders a JSON-decoded field value as a human-readable string for the activity-feed `changes` summary. Primitives use Go's default f
internal/server/handlers_documents.go:464
↓ 2 callers
Function
formatItemRef
(item: Item)
web/src/lib/types/index.ts:1662
↓ 2 callers
Function
formatRef
formatRef rebuilds "PREFIX-NUMBER" from its parts. Kept inline rather than reaching for a models package helper to avoid an import cycle from store→mo
internal/store/wiki_links.go:1442
↓ 2 callers
Function
generateCSPNonce
generateCSPNonce generates a cryptographically random nonce for Content-Security-Policy headers. Returns a 16-byte base64-encoded string.
internal/server/middleware_security.go:56
↓ 2 callers
Function
generateCSRFToken
generateCSRFToken returns a cryptographically random hex string.
internal/server/middleware_csrf.go:328
↓ 2 callers
Function
generateRecoveryCodes
generateRecoveryCodes produces n random recovery codes. Each code is 10 bytes (80 bits) of cryptographic randomness encoded as unpadded base32 — 16 vi
internal/server/handlers_2fa.go:431
↓ 2 callers
Function
generateTempPassword
generateTempPassword returns a random hex temporary password for an operator-initiated reset (16 bytes → 32 hex chars). Shared by the admin reset endp
internal/server/handlers_admin_users.go:507
↓ 2 callers
Function
getCSRFToken
()
web/src/lib/stores/admin.svelte.ts:68
↓ 2 callers
Method
getChildItems
(q childQueryer, parentItemID string)
internal/store/items.go:3787
↓ 2 callers
Method
getItemLink
getItemLink is the unfiltered post-insert readback used by CreateItemLink to hydrate the freshly-inserted row with collection/source/target metadata.
internal/store/items.go:2636
↓ 2 callers
Method
getItemTx
getItemTx is the in-transaction variant of GetItem. Used by UpdateItemWithPreCheck to re-read the parent under the workspace + parent-children locks s
internal/store/items.go:391
↓ 2 callers
Method
getLatestVersionRaw
getLatestVersionRaw returns the most recent version without resolving diffs.
internal/store/versions.go:51
↓ 2 callers
Function
getScrollTarget
()
web/src/lib/scroll/restore.svelte.ts:63
↓ 2 callers
Method
guestResourceFilterCore
guestResourceFilterCore is the request-scoped wrapper around Store.ResolveBacklinksVisibility. Delegates the role-determination + merge logic to the s
internal/server/server.go:2228
↓ 2 callers
Method
handleSessionIPChange
handleSessionIPChange compares the client IP on this request to the IP recorded when the session was created. Behavior: - Session has no recorded IP
internal/server/middleware_auth.go:861
↓ 2 callers
Method
handleSessionUAChange
handleSessionUAChange compares the User-Agent hash on this request to the hash recorded when the session was created, and enforces the same opt-in pol
internal/server/middleware_auth.go:985
↓ 2 callers
Function
hasCloudSecretMarker
hasCloudSecretMarker returns true if the request carries a sidecar- style auth marker: X-Cloud-Secret header or a cloud_secret field in the JSON body
internal/server/handlers_cloud.go:113
↓ 2 callers
Function
hasPadEntryTOML
hasPadEntryTOML reports whether mcp_servers.pad is present plus its current `command` value. Missing files are "not installed", no error.
internal/mcp/install.go:475
↓ 2 callers
Function
hashCanonicalJSON
hashCanonicalJSON returns a SHA-256 hex of a canonicalized form of the input JSON. "Canonical" here means: round-trip through encoding/json to sort ob
internal/server/middleware_mcp_audit.go:406
↓ 2 callers
Function
hashCode
(code string)
internal/store/totp_test.go:10
↓ 2 callers
Function
hashTokenForLimiter
hashTokenForLimiter returns a SHA-256 hex digest of the bearer token, suitable for use as a rate-limiter map key. The hash means the limiter's in-memo
internal/server/middleware_ratelimit.go:581
↓ 2 callers
Function
helpCmd
helpCmd returns a custom `pad help` subcommand that replaces cobra's built-in help. It implements the cmdhelp v0.1 mandatory surface (https://getpad.d
cmd/pad/help_cmdhelp.go:45
↓ 2 callers
Function
humanBytes
(n int64)
cmd/pad/cmd_server.go:1057
↓ 2 callers
Function
humanSize
humanSize formats a byte count in a compact human-readable form (1.2 MB, 340 KB). Used by attachment list / show; not exported because the formatting
cmd/pad/cmd_attachment.go:585
↓ 2 callers
Function
includeLocalRuntime
(cfg *config.Config)
cmd/pad/server_info.go:171
↓ 2 callers
Function
incomingImplementedBy
(item *models.Item, links []models.ItemLink)
cmd/pad/query.go:347
↓ 2 callers
Function
insertLegacyUnverifiedUser
insertLegacyUnverifiedUser inserts a user row with email_verified_at = NULL, simulating an account that existed BEFORE migration 070 added + backfille
internal/store/users_email_verified_test.go:51
↓ 2 callers
Function
insertVerificationToken
insertVerificationToken writes a token row directly with a caller-chosen expires_at / used_at so tests can craft expired and already-used rows.
internal/store/email_verification_test.go:32
↓ 2 callers
Function
installInitCancelHandler
installInitCancelHandler installs a SIGINT/SIGTERM handler for the duration of an interactive init run. On signal receipt it calls cancelInit() — but
cmd/pad/cancel.go:48
↓ 2 callers
Function
installList
()
cmd/pad/cmd_agent.go:71
↓ 2 callers
Function
installUpdate
()
cmd/pad/cmd_agent.go:140
← previous
next →
1,301–1,400 of 6,005, ranked by callers