MCPcopy Create free account

hub / github.com/PerpetualSoftware/pad / functions

Functions6,005 in github.com/PerpetualSoftware/pad

↓ 2 callersFunctionclearTimerFor
(id: string)
web/src/lib/stores/toast.svelte.ts:77
↓ 2 callersFunctioncliAuthBrowserURL
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 callersFunctioncliAuthScheme
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 callersMethodclock
()
internal/server/handlers_storage.go:51
↓ 2 callersFunctioncmdhelpOptions
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 callersFunctioncoercePlaybookValue
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 callersFunctioncollapseAutosaveBursts
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 callersFunctioncollapseChanges
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 callersFunctioncollectFlags
(fs *pflag.FlagSet)
internal/cmdhelp/json.go:385
↓ 2 callersMethodcollectPlaybookMetadata
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 callersMethodcollectionChildrenProgress
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 callersFunctionconfigureEmailForTest
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 callersFunctionconnectionToDTO
(c models.OAuthConnection, stats *models.MCPConnectionStats)
internal/server/handlers_connected_apps.go:77
↓ 2 callersMethodconsumeBootstrapToken
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 callersFunctioncontains
contains is a small test helper.
internal/server/handlers_playbooks_test.go:393
↓ 2 callersFunctioncontainsAction
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 callersFunctioncontentPreview
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 callersFunctioncopyStrings
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 callersFunctioncorsAllowCredentials
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 callersFunctioncreate
(data: { name: string; description?: string; template?: string })
web/src/lib/stores/workspace.svelte.ts:126
↓ 2 callersMethodcreateCLIAuthSession
(ttl time.Duration)
internal/store/cli_auth_sessions.go:48
↓ 2 callersMethodcreateItemChecked
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 callersFunctioncreateMiniSearch
()
web/src/lib/stores/localSearch.svelte.ts:214
↓ 2 callersFunctioncreateWSWithDeletedAt
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 callersFunctiondashboardArrayField
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 callersFunctiondateBucketSubstr
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 callersFunctiondecodeToolSurface
(t *testing.T)
internal/mcp/tool_surface_test.go:28
↓ 2 callersFunctiondefaultIfEmpty
(v, fallback string)
cmd/pad/cmd_bootstrap.go:174
↓ 2 callersMethoddeliver
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 callersFunctionderiveClaimCodeForBucket
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 callersFunctionderiveTOTPStep
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 callersMethodderiveThumbnails
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 callersMethoddestroy
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 callersFunctiondisconnect
()
web/src/lib/services/sse.svelte.ts:383
↓ 2 callersMethoddispatchItemBulkUpdate
--- 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 callersFunctiondispatchItemEvent
(data: ItemEvent)
web/src/lib/services/sse.svelte.ts:84
↓ 2 callersFunctiondispatchSyncRequired
()
web/src/lib/services/sse.svelte.ts:91
↓ 2 callersFunctiondoGetWithCookieUA
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 callersFunctiondoIncrementalOrFull
(absenceMs: number)
web/src/lib/services/sync.svelte.ts:153
↓ 2 callersFunctiondoneFieldKeyFromSchemaJSON
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 callersMethoddoneFiltersForWorkspace
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 callersFunctiondownloadAttachmentToPath
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 callersFunctiondownloadTextFile
(filename: string, text: string, mime = 'text/markdown')
web/src/lib/utils/artifacts.ts:14
↓ 2 callersFunctiondrain
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 callersFunctiondropPosAtY
(view: EditorView, y: number, dragPos: number)
web/src/lib/components/editor/block-drag-handle.ts:156
↓ 2 callersFunctiondurationHours
--- 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 callersMethodeffectivePurgeRetention
effectivePurgeRetention returns the retention window the purge sweeper actually enforces: the SetWorkspacePurgeConfig override when set (PAD_WORKSPACE
internal/server/workspace_purge.go:87
↓ 2 callersFunctioneffectiveWorkspaceUpdatedAt
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 callersMethodemitMCPAuditDenied
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 callersFunctionencodePNG
(t *testing.T, img image.Image)
internal/attachments/processor_test.go:38
↓ 2 callersFunctionencodeSchemaForBody
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 callersMethodenforceUserPlanLimit
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 callersMethodenrichActivities
enrichActivities populates ItemTitle, ItemSlug, and CollectionSlug on each activity by looking up the referenced item.
internal/server/handlers_activity.go:159
↓ 2 callersFunctionerrorServer
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 callersFunctionescapeHtml
* 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 callersFunctionexpectNoMessage
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 callersFunctionextractAllowedWorkspacesFromSessionExtra
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 callersFunctionextractItemStatus
(fieldsJSON string)
cmd/pad/reconcile.go:356
↓ 2 callersFunctionextractPragmas
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 callersFunctionextractUpstreamMessage
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 callersFunctionextractVerifyToken
extractVerifyToken pulls the padver_ token out of a verification email body.
internal/server/handlers_verify_email_test.go:80
↓ 2 callersMethodfetchDashboardJSON
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 callersMethodfetchItem
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 callersFunctionfilenameFromContentDisposition
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 callersFunctionfilterAgentAttention
(attention []server.DashboardAttention)
cmd/pad/query.go:238
↓ 2 callersFunctionfindCatalogTool
findCatalogTool returns the ToolDef with the given name, or a failed test.
internal/mcp/catalog_project_test.go:6
↓ 2 callersFunctionfindGaugeValue
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 callersFunctionfindToolLine
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 callersFunctionflatJSONBody
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 callersFunctionformatChangeValue
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 callersFunctionformatItemRef
(item: Item)
web/src/lib/types/index.ts:1662
↓ 2 callersFunctionformatRef
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 callersFunctiongenerateCSPNonce
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 callersFunctiongenerateCSRFToken
generateCSRFToken returns a cryptographically random hex string.
internal/server/middleware_csrf.go:328
↓ 2 callersFunctiongenerateRecoveryCodes
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 callersFunctiongenerateTempPassword
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 callersFunctiongetCSRFToken
()
web/src/lib/stores/admin.svelte.ts:68
↓ 2 callersMethodgetChildItems
(q childQueryer, parentItemID string)
internal/store/items.go:3787
↓ 2 callersMethodgetItemLink
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 callersMethodgetItemTx
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 callersMethodgetLatestVersionRaw
getLatestVersionRaw returns the most recent version without resolving diffs.
internal/store/versions.go:51
↓ 2 callersFunctiongetScrollTarget
()
web/src/lib/scroll/restore.svelte.ts:63
↓ 2 callersMethodguestResourceFilterCore
guestResourceFilterCore is the request-scoped wrapper around Store.ResolveBacklinksVisibility. Delegates the role-determination + merge logic to the s
internal/server/server.go:2228
↓ 2 callersMethodhandleSessionIPChange
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 callersMethodhandleSessionUAChange
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 callersFunctionhasCloudSecretMarker
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 callersFunctionhasPadEntryTOML
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 callersFunctionhashCanonicalJSON
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 callersFunctionhashCode
(code string)
internal/store/totp_test.go:10
↓ 2 callersFunctionhashTokenForLimiter
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 callersFunctionhelpCmd
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 callersFunctionhumanBytes
(n int64)
cmd/pad/cmd_server.go:1057
↓ 2 callersFunctionhumanSize
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 callersFunctionincludeLocalRuntime
(cfg *config.Config)
cmd/pad/server_info.go:171
↓ 2 callersFunctionincomingImplementedBy
(item *models.Item, links []models.ItemLink)
cmd/pad/query.go:347
↓ 2 callersFunctioninsertLegacyUnverifiedUser
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 callersFunctioninsertVerificationToken
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 callersFunctioninstallInitCancelHandler
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 callersFunctioninstallList
()
cmd/pad/cmd_agent.go:71
↓ 2 callersFunctioninstallUpdate
()
cmd/pad/cmd_agent.go:140
← previousnext →1,301–1,400 of 6,005, ranked by callers