MCPcopy Create free account

hub / github.com/PerpetualSoftware/pad / functions

Functions8,091 in github.com/PerpetualSoftware/pad

↓ 4 callersFunctionsaveCredentials
(cfg *config.Config, resp *cli.LoginResponse)
cmd/pad/cmd_auth.go:741
↓ 4 callersFunctionschemaHasField
schemaHasField returns true if the collection schema defines a field with the given key.
internal/server/handlers_items.go:2547
↓ 4 callersFunctionschemaTypeBrief
schemaTypeBrief returns a one-line type description for a schema proxy: the declared type, format if present, item type for arrays, or the ref name fo
internal/urlimport/openapi.go:450
↓ 4 callersMethodseedItem
seedItem creates a collection (idempotent on slug) + an item with the given title, returning the resolved item record.
internal/server/handlers_ref_resolver_test.go:99
↓ 4 callersFunctionsendSync
(t *testing.T, c *websocket.Conn, payload byte)
internal/collab/manager_test.go:386
↓ 4 callersFunctionsetCSRFCookie
setCSRFCookie writes a new CSRF token cookie. The cookie is NOT HttpOnly so that JavaScript can read it and send it back as a header.
internal/server/middleware_csrf.go:299
↓ 4 callersFunctionsetupFormatRoutingTest
End-to-end coverage of the --format routing itself, not just the render helpers: the command is executed through cobra against an httptest server, so
cmd/pad/format_markdown_routing_test.go:25
↓ 4 callersFunctionsetupItemOpenTest
(t *testing.T, handler http.Handler)
cmd/pad/item_open_test.go:15
↓ 4 callersFunctionsetupOwnedDeletedWorkspace
setupOwnedDeletedWorkspace registers Alice + Bob, has Alice create and then soft-delete a workspace, and returns their tokens plus the workspace. Shar
internal/server/handlers_workspaces_test.go:154
↓ 4 callersFunctionshowMissing
()
web/src/lib/components/editor/attachment-image.ts:484
↓ 4 callersMethodsince
since returns all buffered events with ID > sinceID, in chronological order. Returns nil if sinceID is older than the oldest buffered event AND the bu
internal/events/bus.go:187
↓ 4 callersFunctionsingleLine
singleLine collapses internal whitespace and newlines for safe inclusion in a markdown table cell.
internal/urlimport/openapi.go:488
↓ 4 callersMethodsnapshotBeforeMigrate
snapshotBeforeMigrate copies the live SQLite database file to <db>.pre-<VERSION> before any pending migrations run, so a botched upgrade can be rolled
internal/store/migration_guard.go:107
↓ 4 callersFunctionsortedActionNames
sortedActionNames returns def.Actions' keys in lexical order. Used for both the schema's action enum (so the ordering is stable across builds and repr
internal/mcp/catalog.go:431
↓ 4 callersFunctionssrSafe
()
web/src/lib/stores/localSearch.svelte.ts:378
↓ 4 callersFunctionstreamWatchEvents
streamWatchEvents reads SSE lines from an open connection, printing formatMonitorLine for each "notification" event, until the body is exhausted (conn
cmd/pad/cmd_watch.go:452
↓ 4 callersFunctionstripANSI
stray C0 controls + DEL (includes bare ESC) stripANSI removes escape and control sequences from s, leaving the visible text. TAB, LF, and CR are prese
internal/cli/format.go:159
↓ 4 callersFunctiontightenPerms
tightenPerms sets path to 0600 if it exists. Best-effort: errors only emit a warning to stderr (the user's primary intent — install / no-op — already
internal/mcp/install.go:250
↓ 4 callersFunctiontoIdle
()
web/src/lib/attachments/viewerImageLoader.svelte.ts:163
↓ 4 callersFunctiontoSkinny
* Strip a row down to the skinny shape. Defensive: discard `content` * if a caller passed a full `Item` rather than an `ItemIndexRow`. The * destruc
web/src/lib/stores/localIndex.svelte.ts:158
↓ 4 callersFunctiontransformOf
The `transform` inline style on the viewer's image (empty before it mounts).
web/src/lib/components/common/Lightbox.svelte.test.ts:218
↓ 4 callersMethoduniqueSlug
uniqueSlug generates a unique slug within a scope by appending -2, -3, etc.
internal/store/store.go:1127
↓ 4 callersFunctionunwrapItems
unwrapItems extracts the array from a `{items: [...]}` envelope — the post-BUG-985 shape ExecDispatcher and packageHTTPResponse use for top-level arra
internal/mcp/dispatch_http_links_test.go:460
↓ 4 callersFunctionuploadedAttachmentID
uploadedAttachmentID pulls the new attachment's id out of a 201 upload response body.
internal/server/handlers_attachments_test.go:334
↓ 4 callersFunctionupstreamHTTPErrorResult
upstreamHTTPErrorResult is the canonical wrapper for "the dispatcher made an HTTP call that returned a non-2xx" cases outside the main executeRequest/
internal/mcp/errors.go:1264
↓ 4 callersFunctionvariantUrl
* The URL for one variant. `original` is the CANONICAL, no-`?variant` download — * that is what "the original" IS on the server (it serves the origin
web/src/lib/attachments/viewerImageLoader.svelte.ts:139
↓ 4 callersFunctionviewerClose
(page: Page)
web/e2e/lib/attachment-viewer.ts:148
↓ 4 callersFunctionwrapItemNotFound
wrapItemNotFound rewrites a bare "not_found" APIError from the item-by-ref endpoints into a message that echoes the failing ref and workspace, so `pad
internal/cli/client.go:269
↓ 4 callersMethodwrite
write performs a single insert with a per-call timeout. DB errors log + drop the row — there's no retry path because the audit log is best-effort by d
internal/server/middleware_mcp_audit.go:159
↓ 4 callersFunctionwriteAttachmentNotFound
writeAttachmentNotFound is the single denial writer for the blob read path. Every authorization-dependent refusal — attachment missing, wrong workspac
internal/server/handlers_attachments.go:524
↓ 4 callersFunctionwriteConfig
(t *testing.T, path string, data map[string]any)
internal/mcp/install_test.go:805
↓ 4 callersFunctionwriteMarkdownRow
writeMarkdownRow writes one pipe-delimited row. Cells are expected to be pre-escaped.
internal/cli/format_markdown.go:57
↓ 4 callersFunctionwriteRateLimitResponse
writeRateLimitResponse sends a 429 response with Retry-After and X-RateLimit-* headers.
internal/server/middleware_ratelimit.go:621
↓ 4 callersFunctionwriteSSEEvent
writeSSEEvent writes a single SSE event to the response writer. If eventID > 0, an "id:" field is included for Last-Event-ID support. Returns nil for
internal/server/handlers_events.go:696
↓ 3 callersFunctionActorKind
ActorKind is the writer role — "agent" or "user" — as this process can best describe itself. Same self-declared signal as ResolveAgentName, just reduc
internal/cli/agent_identity.go:81
↓ 3 callersFunctionAllToolNames
AllToolNames returns all valid names and aliases that can be passed to `pad agent install`.
internal/cli/agents.go:236
↓ 3 callersFunctionAppendDecisionLogEntry
(fieldsJSON string, entry ItemDecisionLogEntry)
internal/models/item.go:463
↓ 3 callersFunctionAppendImplementationNote
(fieldsJSON string, note ItemImplementationNote)
internal/models/item.go:451
↓ 3 callersMethodAsOpenChildren
AsOpenChildren returns the parsed open-children details when this APIError carries them, or nil otherwise. Returns nil for any error other than "open_
internal/cli/client.go:1244
↓ 3 callersFunctionAttachmentDownloadURL
AttachmentDownloadURL builds the canonical attachment download URL. Pass an empty variant for the original; otherwise "thumb-sm" / "thumb-md" (the ser
internal/server/render/attachments.go:63
↓ 3 callersMethodBackfillStatusTransitions
BackfillStatusTransitions populates status_transitions from history in two passes, designed to be called once from server startup after migrations run
internal/store/status_transitions_backfill.go:149
↓ 3 callersMethodCancelCustomer
CancelCustomer asks pad-cloud to cancel every active Stripe subscription for customerID and then delete the Stripe customer object. Idempotent at the
internal/billing/cloud_client.go:195
↓ 3 callersMethodCapabilities
Capabilities reports what this backend can do. The editor reads these flags via GET /api/v1/server/capabilities and gates rotate/crop UI on per-format
internal/attachments/processor.go:71
↓ 3 callersFunctionCategoryLabel
CategoryLabel returns the human-readable label for a category slug. Unknown categories are returned unchanged so the picker can still render a reasona
internal/collections/templates.go:49
↓ 3 callersFunctionChildLinkTypes
ChildLinkTypes is the exported, read-only view of childLinkTypes (items.go) — the link types GetChildItems walks to find an item's children. It exist
internal/store/link_types.go:17
↓ 3 callersFunctionColorizedStatus
ColorizedStatus returns a status icon + status text with appropriate color.
internal/cli/format.go:66
↓ 3 callersMethodCreateAccessTokenSession
===================================================================== AccessTokenStorage =============================================================
internal/oauth/storage.go:229
↓ 3 callersMethodCreateOAuthUser
CreateOAuthUser creates a user from an OAuth provider with a random unusable password. OAuth users can later set a password via the password reset flo
internal/store/users.go:646
↓ 3 callersMethodCreatePKCERequest
============================================================ PKCE request sessions (handler/pkce/storage.go PKCERequestStorage) ======================
internal/store/oauth.go:522
↓ 3 callersMethodDateBucket
DateBucket returns a SQL expression that truncates an RFC3339 UTC timestamp TEXT column to the start of its bucket, as a sortable TEXT label, for GROU
internal/store/dialect.go:127
↓ 3 callersMethodDelete
(ctx context.Context, key string)
internal/attachments/registry.go:79
↓ 3 callersMethodDeleteAccountAtomic
DeleteAccountAtomic deletes a user and all their owned workspaces in a single transaction. If any step fails, the entire operation is rolled back and
internal/store/users.go:965
↓ 3 callersMethodDeleteDocument
(id string)
internal/store/documents.go:397
↓ 3 callersMethodDeleteWatch
DeleteWatch removes a user's watch on an item. Returns sql.ErrNoRows if no such watch exists — mirrors UnstarItem's contract.
internal/store/watches.go:112
↓ 3 callersMethodDisableTOTP
DisableTOTP disables 2FA and clears the secret and recovery codes. It also clears the totp_last_step single-use watermark (BUG-2054) so it doesn't out
internal/store/users.go:1234
↓ 3 callersMethodDispatch
Dispatch runs `<Binary> <cmdPath...> <cliArgs...>` and packages the output for an MCP client.
internal/mcp/dispatch.go:127
↓ 3 callersMethodEnsureUniqueUsername
EnsureUniqueUsername takes a candidate username and returns a unique variant by appending -2, -3, etc. if the candidate already exists in the database
internal/store/users.go:1090
↓ 3 callersMethodError
()
internal/store/items_cross_workspace_copy.go:105
↓ 3 callersMethodExportItemArtifact
ExportItemArtifact GETs the single-item artifact export endpoint (GET /workspaces/{ws}/items/{ref}/export) and returns the artifact bytes (Markdown +
internal/cli/client.go:855
↓ 3 callersMethodFetch
Fetch runs `<Binary> <args...>` and returns stdout on success.
internal/mcp/resources.go:66
↓ 3 callersFunctionFieldKeysForKind
FieldKeysForKind returns the frontmatter field keys for the given kind, or ErrUnknownKind if the kind is not recognized. A later phase's server code c
internal/artifact/artifact.go:64
↓ 3 callersMethodGet
Get / Stat / Delete are convenience helpers that resolve the key first.
internal/attachments/registry.go:63
↓ 3 callersMethodGetAccessTokenSession
GetAccessTokenSession hydrates an access token. Inactive rows surface as fosite.ErrInactiveToken so the introspection / authorization-bearer middlewar
internal/oauth/storage.go:247
↓ 3 callersMethodGetAllItemProgress
GetAllItemProgress returns child item completion counts for every item in the given collection within a workspace. includeArchived controls whether s
internal/store/items.go:3896
↓ 3 callersMethodGetAttachmentVariant
GetAttachmentVariant returns the derived attachment row for parentID with the given variant key (e.g. "thumb-sm"), or (nil, nil) if no such row exists
internal/store/attachments.go:245
↓ 3 callersMethodGetBillingMetrics
GetBillingMetrics asks pad-cloud for an aggregated Stripe-derived snapshot (active subs, MRR, ARR, churn, cancellations). Auth is the same shared Clou
internal/billing/cloud_client.go:144
↓ 3 callersMethodGetBlocksEdges
GetBlocksEdges returns every `blocks` link in the workspace whose source and target items are both live (non-deleted), newest link first. The created_
internal/store/items.go:4321
↓ 3 callersMethodGetCLIAuthSession
GetCLIAuthSession retrieves a CLI auth session by code. Returns nil if not found. Expired sessions are returned with status updated to "expired".
internal/store/cli_auth_sessions.go:82
↓ 3 callersMethodGetCollection
(wsSlug, collSlug string)
internal/cli/client.go:185
↓ 3 callersMethodGetCollectionGrant
GetCollectionGrant retrieves a collection grant by ID.
internal/store/grants.go:29
↓ 3 callersMethodGetCurrentUser
GetCurrentUser returns the authenticated user's profile.
internal/cli/client.go:1167
↓ 3 callersMethodGetInvitation
GetInvitation retrieves an invitation by ID.
internal/store/workspace_members.go:660
↓ 3 callersMethodGetItem
(wsSlug, itemSlug string)
internal/cli/client.go:241
↓ 3 callersMethodGetItemByRef
GetItemByRef looks up an item by its PREFIX-NUMBER reference (e.g. "IDEA-15"). Since item numbers are workspace-unique, this first tries an exact pref
internal/store/items.go:665
↓ 3 callersMethodGetItemBySlug
(workspaceID, slug string)
internal/store/items.go:645
↓ 3 callersMethodGetItemGrant
GetItemGrant retrieves an item grant by ID.
internal/store/grants.go:117
↓ 3 callersMethodGetItemsByIDsIncludeDeleted
GetItemsByIDsIncludeDeleted fetches items (soft-deleted included) for the given IDs in ONE `WHERE id IN (...)` query, keyed by item ID. It replaces th
internal/store/items.go:916
↓ 3 callersFunctionGetLibraryConvention
GetLibraryConvention finds a convention in the library by its title. Returns nil if no convention with the given title exists.
internal/collections/convention_library.go:210
↓ 3 callersMethodGetPKCERequest
GetPKCERequest hydrates the PKCE session. Returns ErrOAuthNotFound if the row is missing.
internal/store/oauth.go:531
↓ 3 callersMethodGetParentMap
GetParentMap returns a map of item ID -> parent item ID for all parent links in a workspace. Used for efficient batch lookups (e.g., dashboard, list e
internal/store/items.go:3571
↓ 3 callersMethodGetReportLayout
Per-user Insights/report layout preferences (PLAN-1628 / TASK-1634). GetReportLayout returns the user's saved layout for a workspace, or nil when they
internal/store/report_layouts.go:15
↓ 3 callersMethodGetUserMetrics
GetUserMetrics computes the AdminUserMetrics bundle. Cheap by design: - days_since_write reads users.last_write_at directly (one row) - writes_7d is a
internal/store/users.go:774
↓ 3 callersMethodGetUserWorkspaceMemberships
GetUserWorkspaceMemberships returns workspace memberships for admin user detail.
internal/store/workspace_members.go:1104
↓ 3 callersMethodHasPassword
HasPassword returns true if the user has explicitly set a password that they can sign in with. OAuth-only users have a random placeholder hash stored
internal/models/user.go:72
↓ 3 callersMethodImportArtifact
ImportArtifact POSTs the raw artifact bytes to the workspace import endpoint (POST /workspaces/{ws}/import-artifact) and decodes the {ref, slug, warni
internal/cli/client.go:892
↓ 3 callersMethodInvalidateAuthorizationCode
InvalidateAuthorizationCode marks a code inactive (single-use). Idempotent: invalidating an already-invalid or missing row is a no-op (fosite's contra
internal/store/oauth.go:287
↓ 3 callersMethodIsCloudServer
IsCloudServer reports whether THIS server process should run in cloud-tenant mode (enabling cloud-specific endpoints, requiring PAD_CLOUD_SECRET, wiri
internal/config/config.go:320
↓ 3 callersMethodIsWorkspaceMember
IsWorkspaceMember checks if a user is a member of a workspace.
internal/store/workspace_members.go:593
↓ 3 callersMethodItemLastRestoreSeq
ItemLastRestoreSeq returns the DURABLE per-item restore boundary (items.last_restore_seq) — the item.seq of the most recent version restore (BUG-2264)
internal/collab/room.go:274
↓ 3 callersMethodItemRestoreBoundaryOpID
ItemRestoreBoundaryOpID returns items.restore_boundary_op_id — the DURABLE op-log-id restore boundary (BUG-2264), or (0, false) when the item has neve
internal/store/yjs_updates.go:298
↓ 3 callersMethodJSONArrayContains
JSONArrayContains returns SQL + the arg to check if a JSON array column contains a given text value. SQLite: "column LIKE ?" with arg `%"value"%` Post
internal/store/dialect.go:105
↓ 3 callersMethodListMovedOutSince
ListMovedOutSince finds items that the main /items-changes delta drops because they moved OUT of the caller's visible scope: their CURRENT collection
internal/store/items.go:1577
↓ 3 callersMethodListUserGrants
--- Cross-cutting queries --- ListUserGrants returns all collection and item grants for a user in a workspace.
internal/store/grants.go:189
↓ 3 callersMethodListUsers
ListUsers returns all users.
internal/store/users.go:243
↓ 3 callersMethodListVersionsResolved
ListVersionsResolved returns versions with full content (diffs resolved). Requires the current document content to reconstruct diff-based versions.
internal/store/versions.go:102
↓ 3 callersFunctionLoadPadToml
LoadPadToml finds and reads the nearest .pad.toml by walking up from cwd. Returns nil if no .pad.toml is found (not an error).
internal/cli/workspace.go:60
↓ 3 callersFunctionLoadRegistry
LoadRegistry reads the installation registry from disk. Returns an empty registry if the file doesn't exist.
internal/cli/registry.go:44
↓ 3 callersMethodMCP
MCP returns the underlying mark3labs MCPServer. Use this to register tools / resources / prompts BEFORE Run() takes over the stdio transport — registr
internal/mcp/server.go:80
↓ 3 callersMethodMCPConnectionStatsForUser
MCPConnectionStatsForUser returns last-used + 30-day-count keyed by (token_kind, token_ref) for every connection the user has any audit-log activity f
internal/store/mcp_audit.go:204
↓ 3 callersFunctionMCPConnectionStatsKey
MCPConnectionStatsKey is the exported wrapper for callers in other packages (notably internal/server/handlers_connected_apps.go in TASK-954) that need
internal/store/mcp_audit.go:265
← previousnext →1,101–1,200 of 8,091, ranked by callers