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
↓ 3 callers
Function
Register
Register installs pad's MCP tools on srv: the built-in pad_set_workspace plus every v0.2 catalog tool. Returns the count of registered tools (includin
internal/mcp/registry.go:68
↓ 3 callers
Method
Register
Register creates a new user account.
internal/cli/client.go:933
↓ 3 callers
Function
RegisterCatalog
RegisterCatalog installs the v0.2 catalog tools on srv. Returns the count of tools registered (excluding pad_set_workspace, which the cmdhelp-walk pat
internal/mcp/catalog.go:215
↓ 3 callers
Method
RegisterOAuthActiveTokensCollector
RegisterOAuthActiveTokensCollector exposes pad_oauth_active_tokens as a callback-driven gauge. Pulled on every scrape — same pattern as the db-stats c
internal/metrics/metrics.go:317
↓ 3 callers
Function
RegisterResources
RegisterResources installs the four read-only MCP resource templates on srv: - pad://workspace/{ws}/items/{ref} — single item markdown - pad://worksp
internal/mcp/resources.go:128
↓ 3 callers
Method
RemoveConnectionWorkspace
RemoveConnectionWorkspace deletes one (request_id, workspace_id) row. Idempotent: removing a pair that isn't present is a no-op (no error). Phase D's
internal/store/oauth_connections.go:334
↓ 3 callers
Method
RenameConnection
RenameConnection updates the human-readable name. Touches updated_at. Returns ErrOAuthConnectionNotFound if the row doesn't exist. Trim is the caller
internal/store/oauth_connections.go:246
↓ 3 callers
Method
ResolveBacklinksVisibility
ResolveBacklinksVisibility computes the (fullCollectionIDs, grantedItemIDs) access vectors for `userID` in `workspaceID`, REQUEST-INDEPENDENT. Mirrors
internal/store/backlinks_visibility.go:59
↓ 3 callers
Method
ResolveDefault
ResolveDefault returns the workspace to inject into a dispatched call that didn't carry an explicit `workspace` — or "" when this state must not be tr
internal/mcp/workspace.go:99
↓ 3 callers
Method
ResolvePath
ResolvePath returns the config path for the given agent using the installer's home/cwd + goos overrides. CWDBased agents (Claude Code) resolve against
internal/mcp/install.go:622
↓ 3 callers
Method
RestoreWorkspace
RestoreWorkspace un-soft-deletes a workspace: it clears deleted_at so the workspace (and every item/collection/member/attachment that was only transit
internal/store/workspaces.go:282
↓ 3 callers
Function
RewriteBracketAt
RewriteBracketAt rewrites the wiki-link bracket starting at byte position `position` in `content`, replacing the bracket's title segment with `newTitl
internal/links/links.go:113
↓ 3 callers
Method
Rotate
Rotate returns a new image rotated by deg degrees clockwise. Only multiples of 90 (90, 180, 270, plus their negatives) are supported in Phase 1 — that
internal/attachments/processor.go:48
↓ 3 callers
Method
RunStdio
RunStdio is Run with explicit stdin / stdout streams. Used by tests that drive the server in-process via io.Pipe. The same shutdown semantics as Run
internal/mcp/server.go:97
↓ 3 callers
Method
Save
Save writes the registry to disk.
internal/cli/registry.go:67
↓ 3 callers
Method
SaveReportLayout
SaveReportLayout upserts the user's layout for a workspace. The caller is responsible for sanitizing the layout (see server handler) before saving.
internal/store/report_layouts.go:40
↓ 3 callers
Method
SearchUsers
SearchUsers returns a filtered, paginated list of users for admin management. Each row carries the User model plus two cheap aggregations the admin t
internal/store/users.go:378
↓ 3 callers
Method
SendEmailVerification
SendEmailVerification sends an email-verification link to a newly registered user. Mirrors SendPasswordReset (buildHTMLShell/buildPlainShell, CloudMod
internal/email/templates.go:151
↓ 3 callers
Method
SendInvitation
SendInvitation sends a workspace invitation email. If unsubscribeURL is non-empty, an unsubscribe link is included in the footer.
internal/email/templates.go:11
↓ 3 callers
Function
SetBcryptCostForTesting
SetBcryptCostForTesting overrides the bcrypt cost used by CreateUser and UpdateUser for the lifetime of a test binary. It returns a restore function —
internal/store/testing_helpers.go:19
↓ 3 callers
Method
SetImageProcessor
SetImageProcessor wires the image processor that the upload handler uses to derive thumbnail variants (TASK-878). Optional — without it uploads still
internal/server/server.go:734
↓ 3 callers
Method
SetRevocationObserver
SetRevocationObserver wires a callback that fires after each access-token family revocation. Optional — leaving it unset is equivalent to wiring a no-
internal/oauth/storage.go:82
↓ 3 callers
Method
SetScopeFlags
SetScopeFlags updates the three boolean scope flags atomically. All three values are written every call — there's no PATCH semantic at the store layer
internal/store/oauth_connections.go:269
↓ 3 callers
Function
SniffMIME
SniffMIME detects the MIME type from the leading bytes of a payload using net/http's stdlib detector (the same RFC 6838 algorithm browsers use). The r
internal/attachments/mime.go:172
↓ 3 callers
Method
Stat
(ctx context.Context, key string)
internal/attachments/registry.go:71
↓ 3 callers
Method
Subscribe
Subscribe delegates to the inner bus and increments the SSE connection gauge.
internal/metrics/instrumented_bus.go:31
↓ 3 callers
Function
TerminalPlaceholdersForDoneField
TerminalPlaceholdersForDoneField is a SQL-layer convenience that returns the done-field key plus the placeholder + args pair needed for an IN clause.
internal/models/terminal.go:96
↓ 3 callers
Function
ThumbnailExt
ThumbnailExt returns the file extension for a thumbnail encoded in `format`. Used to build a synthetic filename for the derived row (parent's basename
internal/attachments/processor.go:156
↓ 3 callers
Function
ThumbnailFormat
Format-policy helpers — shared between the pure-Go and libvips backends. These are intentionally NOT inside a build-tagged file so they compile under
internal/attachments/processor.go:132
↓ 3 callers
Function
ThumbnailMime
ThumbnailMime returns the canonical MIME type for a thumbnail encoded in `format` (paired with ThumbnailFormat above).
internal/attachments/processor.go:141
↓ 3 callers
Function
TokenScopesFromContext
TokenScopesFromContext returns the JSON-encoded scopes attached by WithTokenScopes, or "" if none. Empty maps to "unrestricted" in TokenScopeAllows (t
internal/server/context.go:98
↓ 3 callers
Function
ToolSkillPath
ToolSkillPath returns the full path where a tool's skill file would be installed.
internal/cli/agents.go:144
↓ 3 callers
Method
Unsubscribe
Unsubscribe delegates to the inner bus and decrements the SSE connection gauge.
internal/metrics/instrumented_bus.go:61
↓ 3 callers
Method
UpdateCollection
(id string, input models.CollectionUpdate)
internal/store/collections.go:241
↓ 3 callers
Method
UpdateItemWithPreCheck
UpdateItemWithPreCheck is UpdateItem with an optional pre-mutation hook that runs inside the same transaction (and, on Postgres, holds the same worksp
internal/store/items.go:1815
↓ 3 callers
Method
UpdateView
UpdateView modifies an existing view.
internal/store/views.go:137
↓ 3 callers
Method
UserID
UserID returns the pad user ID this session was issued to. Equivalent to GetSubject() under our model where Subject is always the user ID; kept as a t
internal/oauth/session.go:63
↓ 3 callers
Function
ValidateBoolArity
ValidateBoolArity asserts that every bool-typed flag in doc obeys spec §5.3: bool flags MUST be presence switches. They MUST NOT appear in `--flag=val
internal/cmdhelp/example_validation.go:197
↓ 3 callers
Function
ValidateURL
ValidateURL is the pre-flight SSRF guard: it rejects non-http(s) schemes, URLs with embedded credentials, missing hostnames, and IP-literal hosts in p
internal/urlimport/fetch.go:219
↓ 3 callers
Function
ValidateUsername
ValidateUsername checks a username for format, length, and reserved word violations. It does NOT check uniqueness (that requires a store call).
internal/server/username.go:51
↓ 3 callers
Method
WorkspaceHasAgentActivity
WorkspaceHasAgentActivity reports whether any non-deleted item VISIBLE to the caller was created via an agent surface — direct CLI invocation or the R
internal/store/items.go:4487
↓ 3 callers
Method
WorkspaceSubscriberCount
WorkspaceSubscriberCount returns the number of active subscribers for a specific workspace.
internal/events/bus.go:127
↓ 3 callers
Method
acquireParentChildrenLocksForUpdate
acquireParentChildrenLocksForUpdate is the in-tx helper UpdateItem uses to serialize itself against the open-children guard (IDEA-1494 R2 / R4). It ac
internal/store/items.go:3598
↓ 3 callers
Function
actionItemExport
actionItemExport handles pad_item.action=export. The CLI's `pad item export <ref>` defaults to WRITING A FILE (<slug>.pad.md), which is useless to an
internal/mcp/catalog_item.go:660
↓ 3 callers
Function
actionItemImport
actionItemImport handles pad_item.action=import. The CLI's `pad item import <file>` reads the artifact from a file (or stdin when the positional is `-
internal/mcp/catalog_item.go:692
↓ 3 callers
Function
actionItemList
actionItemList handles pad_item.action=list. It forwards to `item list` but first applies a default limit (when the agent didn't ask for one) and clam
internal/mcp/catalog_item.go:627
↓ 3 callers
Function
adminFetch
(path: string, opts?: RequestInit)
web/src/lib/stores/admin.svelte.ts:75
↓ 3 callers
Function
asText
asText extracts the text payload from any content type that has one. mcp-go's Content interface is implemented by TextContent, etc.; we only care abou
internal/mcp/workspace_test.go:128
↓ 3 callers
Function
assertMemberCollectionAccessUnchanged
(t *testing.T, f *restrictedOwnerVisibilityFixture, userID, wantMode string, wantIDs []string)
internal/server/handlers_member_collection_access_escalation_test.go:183
↓ 3 callers
Function
authHeaders
(fixture: SuiteFixture)
web/e2e/lib/demo-seed.ts:26
↓ 3 callers
Method
authorizeCollabAccess
authorizeCollabAccess mirrors RequireWorkspaceAccess but keyed on the item's workspace ID (the WS URL path doesn't carry a workspace slug). It checks:
internal/server/handlers_collab.go:529
↓ 3 callers
Method
bearerHeaders
()
internal/server/handlers_comments_bearer_gate_test.go:32
↓ 3 callers
Function
buildDoneContextMap
buildDoneContextMap builds a map of collection ID → (schema, settings) for quick lookups during dashboard / lineage traversals.
internal/server/handlers_dashboard.go:225
↓ 3 callers
Function
bulkUpdateRefs
bulkUpdateRefs canonicalizes the `ref` input — accepts repeatable shapes the cmdhelp registry generates (string for a single value, []any from JSON ar
internal/mcp/dispatch_http_project.go:443
↓ 3 callers
Function
bumpEpoch
(ws: string)
web/src/lib/stores/localSearch.svelte.ts:341
↓ 3 callers
Function
bundleAttachmentPath
bundleAttachmentPath builds the tar entry name for an attachment. Exported as a function (not a const helper) so the import path can import it and res
internal/server/handlers_export_bundle.go:280
↓ 3 callers
Method
cancel
Cancel the pending debounce without saving. Leaves the dirty flag set.
web/src/lib/items/contentSaver.svelte.ts:52
↓ 3 callers
Function
capBootstrapDashboard
capBootstrapDashboard wraps a DashboardResponse with the bootstrap's per-section caps. The underlying *DashboardResponse is shallow-copied before the
internal/server/handlers_bootstrap.go:832
↓ 3 callers
Method
checkBootstrapToken
checkBootstrapToken validates the X-Bootstrap-Token header on r against the in-memory token using a constant-time comparison. Returns false if no toke
internal/server/bootstrap.go:169
↓ 3 callers
Method
checkUniqueFields
(workspaceID, collectionID, excludeItemID string, schema models.CollectionSchema, fieldMap map[string]any)
internal/server/handlers_items.go:2418
↓ 3 callers
Function
clampRect
Clamp a rectangle to fit within `bounds`, integer coords throughout.
web/src/lib/components/editor/attachment-crop-modal.ts:395
↓ 3 callers
Function
cleanupMarkdown
(md string)
internal/urlimport/generic.go:99
↓ 3 callers
Function
cloneStringMap
cloneStringMap returns a shallow copy of m. Used by mappers that need to normalize a single value before handing the map to a downstream helper, witho
internal/mcp/dispatch_http_routes.go:1358
↓ 3 callers
Method
closeSocket
(code: number, reason: string)
web/src/lib/collab/wsProvider.svelte.ts:1147
↓ 3 callers
Function
codeOrBlank
codeOrBlank wraps t in backticks unless t is empty. Any stray backtick characters inside t are stripped first so the resulting cell always carries exa
internal/urlimport/openapi.go:430
↓ 3 callers
Function
coerceObject
(value: unknown)
web/src/lib/components/share/shareView.ts:57
↓ 3 callers
Function
collCount
(list []ReportCollectionCount, slug string)
internal/store/reports_test.go:21
↓ 3 callers
Function
collectServerInfo
(cfg *config.Config)
cmd/pad/server_info.go:96
↓ 3 callers
Function
collectionSlugs
(colls []models.Collection)
internal/store/collections_test.go:418
↓ 3 callers
Function
computeAdminUserStatus
computeAdminUserStatus derives the at-a-glance status pill from the underlying fields. Precedence is intentional: a disabled user with no workspace is
internal/store/users.go:344
↓ 3 callers
Method
connect
()
web/src/lib/collab/wsProvider.svelte.ts:626
↓ 3 callers
Function
containsWorkspace
(list []models.Workspace, id string)
internal/server/handlers_workspaces_test.go:134
↓ 3 callers
Function
countParentLinks
countParentLinks returns how many `parent` link rows an item is the source of. The invariant is that a well-behaved item has at most one — the DELETE-
internal/store/parent_link_concurrency_test.go:30
↓ 3 callers
Function
countUAChangeEvents
countUAChangeEvents returns the number of session_ua_changed rows in the audit log.
internal/server/middleware_session_ua_test.go:47
↓ 3 callers
Function
createLineageLink
(spec lineageLinkSpec, sourceRef, targetRef string)
cmd/pad/lineage.go:120
↓ 3 callers
Function
credentialsPath
credentialsPath is retained for internal call sites.
internal/cli/credentials.go:83
↓ 3 callers
Function
cursorAsNum
* Cursors are decimal-encoded `seq` values as opaque strings — but * "monotonic forward" needs a numeric compare, not lexicographic. * Treat empty /
web/src/lib/stores/localIndex.svelte.ts:148
↓ 3 callers
Function
cursorStorageKey
(itemID: string)
web/src/lib/collab/wsProvider.svelte.ts:124
↓ 3 callers
Function
dbName
(userId: string | null, ws: string)
web/src/lib/stores/localIndexPersistence.ts:81
↓ 3 callers
Function
decodeJSONWithLimit
decodeJSONWithLimit is the size-configurable variant. Use this for endpoints that accept large payloads (e.g. bulk-import) where the default cap is to
internal/server/server.go:1839
↓ 3 callers
Function
decodeUserGrantsResponse
decodeUserGrantsResponse requires a 200 and decodes the body, failing the test otherwise.
internal/server/handlers_grant_visibility_test.go:879
↓ 3 callers
Function
deleteLineageLink
(spec lineageLinkSpec, sourceRef, targetRef string)
cmd/pad/lineage.go:150
↓ 3 callers
Function
dirExists
(parts ...string)
internal/cli/detect.go:208
↓ 3 callers
Function
dispatch
( api: Api, wsSlug: string, _isReadOnlyAction: (toolName: string, action: string) => boolean | undefined,
web/src/lib/webmcp/dispatch.ts:611
↓ 3 callers
Function
doBrowserLogin
doBrowserLogin implements the browser-based CLI auth flow. It creates a pending session, prints the auth URL, and polls until approved.
cmd/pad/cmd_auth.go:402
↓ 3 callers
Function
doMetricsRequest
(srv *Server, remoteAddr, authHeader string)
internal/server/metrics_auth_test.go:31
↓ 3 callers
Function
docsCollection
docsCollection returns the standard Docs collection shared across templates.
internal/collections/templates.go:138
↓ 3 callers
Method
doneFieldKey
doneFieldKey resolves the select field whose value represents a collection's workflow/done state (CollectionSettings.BoardGroupBy, else "status"). Use
internal/store/status_transitions_backfill.go:68
↓ 3 callers
Function
durationsByCollection
durationsByCollection turns per-collection samples into median+count entries, ordered by count desc then slug.
internal/store/reports.go:967
↓ 3 callers
Method
emailConfigured
emailConfigured reports whether this instance can actually SEND an emailed link — a sender is wired AND the public base URL is usable. This is the DR-
internal/server/server.go:662
↓ 3 callers
Function
emitRealPadJSON
emitRealPadJSON builds the real pad cobra tree and emits its JSON representation with a static (no-resolver, no live-workspace) configuration. Tests t
cmd/pad/cmdhelp_real_test.go:20
↓ 3 callers
Function
enableTOTPForDeleteUser
enableTOTPForDeleteUser turns on 2FA for a bootstrapped delete-test user using a known secret, mirroring the real SetTOTPSecret → EnableTOTP flow, and
internal/server/handlers_account_test.go:400
↓ 3 callers
Function
enc
(obj: Record<string, unknown>)
web/e2e/lib/demo-seed.ts:24
↓ 3 callers
Function
endDrag
()
web/src/lib/components/editor/block-drag-handle.ts:712
↓ 3 callers
Method
enqueue
enqueue tries to push one entry without blocking. Returns true on success; on a full queue, increments the drop counter and returns false. The MCP mid
internal/server/middleware_mcp_audit.go:120
↓ 3 callers
Function
ensureState
(ws: string)
web/src/lib/stores/localIndex.svelte.ts:119
↓ 3 callers
Function
envelopeFrom
envelopeFrom reads the ErrorEnvelope back out of an MCP error result's structured content. Used by classifyHTTPStatus's 404 workspace path so we can l
internal/mcp/errors.go:320
↓ 3 callers
Function
equalBytes
(a, b []byte)
internal/server/handlers_attachments_download_test.go:328
↓ 3 callers
Function
escapeHtml
* Escape HTML-significant characters so user-controlled strings can be * safely interpolated into attribute values and text nodes. Local copy so * t
web/src/lib/markdown/attachments.ts:106
↓ 3 callers
Function
escapeTable
escapeTable replaces newlines and pipes so a value can sit in a markdown table cell without breaking the table grid.
internal/cmdhelp/md.go:298
← previous
next →
901–1,000 of 6,005, ranked by callers