MCPcopy Create free account

hub / github.com/PerpetualSoftware/pad / functions

Functions6,005 in github.com/PerpetualSoftware/pad

↓ 3 callersFunctionRegister
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 callersMethodRegister
Register creates a new user account.
internal/cli/client.go:933
↓ 3 callersFunctionRegisterCatalog
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 callersMethodRegisterOAuthActiveTokensCollector
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 callersFunctionRegisterResources
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 callersMethodRemoveConnectionWorkspace
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 callersMethodRenameConnection
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 callersMethodResolveBacklinksVisibility
ResolveBacklinksVisibility computes the (fullCollectionIDs, grantedItemIDs) access vectors for `userID` in `workspaceID`, REQUEST-INDEPENDENT. Mirrors
internal/store/backlinks_visibility.go:59
↓ 3 callersMethodResolveDefault
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 callersMethodResolvePath
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 callersMethodRestoreWorkspace
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 callersFunctionRewriteBracketAt
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 callersMethodRotate
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 callersMethodRunStdio
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 callersMethodSave
Save writes the registry to disk.
internal/cli/registry.go:67
↓ 3 callersMethodSaveReportLayout
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 callersMethodSearchUsers
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 callersMethodSendEmailVerification
SendEmailVerification sends an email-verification link to a newly registered user. Mirrors SendPasswordReset (buildHTMLShell/buildPlainShell, CloudMod
internal/email/templates.go:151
↓ 3 callersMethodSendInvitation
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 callersFunctionSetBcryptCostForTesting
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 callersMethodSetImageProcessor
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 callersMethodSetRevocationObserver
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 callersMethodSetScopeFlags
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 callersFunctionSniffMIME
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 callersMethodStat
(ctx context.Context, key string)
internal/attachments/registry.go:71
↓ 3 callersMethodSubscribe
Subscribe delegates to the inner bus and increments the SSE connection gauge.
internal/metrics/instrumented_bus.go:31
↓ 3 callersFunctionTerminalPlaceholdersForDoneField
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 callersFunctionThumbnailExt
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 callersFunctionThumbnailFormat
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 callersFunctionThumbnailMime
ThumbnailMime returns the canonical MIME type for a thumbnail encoded in `format` (paired with ThumbnailFormat above).
internal/attachments/processor.go:141
↓ 3 callersFunctionTokenScopesFromContext
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 callersFunctionToolSkillPath
ToolSkillPath returns the full path where a tool's skill file would be installed.
internal/cli/agents.go:144
↓ 3 callersMethodUnsubscribe
Unsubscribe delegates to the inner bus and decrements the SSE connection gauge.
internal/metrics/instrumented_bus.go:61
↓ 3 callersMethodUpdateCollection
(id string, input models.CollectionUpdate)
internal/store/collections.go:241
↓ 3 callersMethodUpdateItemWithPreCheck
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 callersMethodUpdateView
UpdateView modifies an existing view.
internal/store/views.go:137
↓ 3 callersMethodUserID
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 callersFunctionValidateBoolArity
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 callersFunctionValidateURL
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 callersFunctionValidateUsername
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 callersMethodWorkspaceHasAgentActivity
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 callersMethodWorkspaceSubscriberCount
WorkspaceSubscriberCount returns the number of active subscribers for a specific workspace.
internal/events/bus.go:127
↓ 3 callersMethodacquireParentChildrenLocksForUpdate
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 callersFunctionactionItemExport
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 callersFunctionactionItemImport
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 callersFunctionactionItemList
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 callersFunctionadminFetch
(path: string, opts?: RequestInit)
web/src/lib/stores/admin.svelte.ts:75
↓ 3 callersFunctionasText
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 callersFunctionassertMemberCollectionAccessUnchanged
(t *testing.T, f *restrictedOwnerVisibilityFixture, userID, wantMode string, wantIDs []string)
internal/server/handlers_member_collection_access_escalation_test.go:183
↓ 3 callersFunctionauthHeaders
(fixture: SuiteFixture)
web/e2e/lib/demo-seed.ts:26
↓ 3 callersMethodauthorizeCollabAccess
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 callersMethodbearerHeaders
()
internal/server/handlers_comments_bearer_gate_test.go:32
↓ 3 callersFunctionbuildDoneContextMap
buildDoneContextMap builds a map of collection ID → (schema, settings) for quick lookups during dashboard / lineage traversals.
internal/server/handlers_dashboard.go:225
↓ 3 callersFunctionbulkUpdateRefs
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 callersFunctionbumpEpoch
(ws: string)
web/src/lib/stores/localSearch.svelte.ts:341
↓ 3 callersFunctionbundleAttachmentPath
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 callersMethodcancel
Cancel the pending debounce without saving. Leaves the dirty flag set.
web/src/lib/items/contentSaver.svelte.ts:52
↓ 3 callersFunctioncapBootstrapDashboard
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 callersMethodcheckBootstrapToken
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 callersMethodcheckUniqueFields
(workspaceID, collectionID, excludeItemID string, schema models.CollectionSchema, fieldMap map[string]any)
internal/server/handlers_items.go:2418
↓ 3 callersFunctionclampRect
Clamp a rectangle to fit within `bounds`, integer coords throughout.
web/src/lib/components/editor/attachment-crop-modal.ts:395
↓ 3 callersFunctioncleanupMarkdown
(md string)
internal/urlimport/generic.go:99
↓ 3 callersFunctioncloneStringMap
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 callersMethodcloseSocket
(code: number, reason: string)
web/src/lib/collab/wsProvider.svelte.ts:1147
↓ 3 callersFunctioncodeOrBlank
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 callersFunctioncoerceObject
(value: unknown)
web/src/lib/components/share/shareView.ts:57
↓ 3 callersFunctioncollCount
(list []ReportCollectionCount, slug string)
internal/store/reports_test.go:21
↓ 3 callersFunctioncollectServerInfo
(cfg *config.Config)
cmd/pad/server_info.go:96
↓ 3 callersFunctioncollectionSlugs
(colls []models.Collection)
internal/store/collections_test.go:418
↓ 3 callersFunctioncomputeAdminUserStatus
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 callersMethodconnect
()
web/src/lib/collab/wsProvider.svelte.ts:626
↓ 3 callersFunctioncontainsWorkspace
(list []models.Workspace, id string)
internal/server/handlers_workspaces_test.go:134
↓ 3 callersFunctioncountParentLinks
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 callersFunctioncountUAChangeEvents
countUAChangeEvents returns the number of session_ua_changed rows in the audit log.
internal/server/middleware_session_ua_test.go:47
↓ 3 callersFunctioncreateLineageLink
(spec lineageLinkSpec, sourceRef, targetRef string)
cmd/pad/lineage.go:120
↓ 3 callersFunctioncredentialsPath
credentialsPath is retained for internal call sites.
internal/cli/credentials.go:83
↓ 3 callersFunctioncursorAsNum
* 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 callersFunctioncursorStorageKey
(itemID: string)
web/src/lib/collab/wsProvider.svelte.ts:124
↓ 3 callersFunctiondbName
(userId: string | null, ws: string)
web/src/lib/stores/localIndexPersistence.ts:81
↓ 3 callersFunctiondecodeJSONWithLimit
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 callersFunctiondecodeUserGrantsResponse
decodeUserGrantsResponse requires a 200 and decodes the body, failing the test otherwise.
internal/server/handlers_grant_visibility_test.go:879
↓ 3 callersFunctiondeleteLineageLink
(spec lineageLinkSpec, sourceRef, targetRef string)
cmd/pad/lineage.go:150
↓ 3 callersFunctiondirExists
(parts ...string)
internal/cli/detect.go:208
↓ 3 callersFunctiondispatch
( api: Api, wsSlug: string, _isReadOnlyAction: (toolName: string, action: string) => boolean | undefined,
web/src/lib/webmcp/dispatch.ts:611
↓ 3 callersFunctiondoBrowserLogin
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 callersFunctiondoMetricsRequest
(srv *Server, remoteAddr, authHeader string)
internal/server/metrics_auth_test.go:31
↓ 3 callersFunctiondocsCollection
docsCollection returns the standard Docs collection shared across templates.
internal/collections/templates.go:138
↓ 3 callersMethoddoneFieldKey
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 callersFunctiondurationsByCollection
durationsByCollection turns per-collection samples into median+count entries, ordered by count desc then slug.
internal/store/reports.go:967
↓ 3 callersMethodemailConfigured
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 callersFunctionemitRealPadJSON
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 callersFunctionenableTOTPForDeleteUser
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 callersFunctionenc
(obj: Record<string, unknown>)
web/e2e/lib/demo-seed.ts:24
↓ 3 callersFunctionendDrag
()
web/src/lib/components/editor/block-drag-handle.ts:712
↓ 3 callersMethodenqueue
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 callersFunctionensureState
(ws: string)
web/src/lib/stores/localIndex.svelte.ts:119
↓ 3 callersFunctionenvelopeFrom
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 callersFunctionequalBytes
(a, b []byte)
internal/server/handlers_attachments_download_test.go:328
↓ 3 callersFunctionescapeHtml
* 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 callersFunctionescapeTable
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
← previousnext →901–1,000 of 6,005, ranked by callers