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
↓ 4 callers
Method
runOpenChildrenGuard
runOpenChildrenGuard executes the guard logic inside the store-layer transaction. Returns: - (nil, nil) when the guard doesn't apply (no transition,
internal/server/handlers_items_open_children_guard.go:155
↓ 4 callers
Function
samplePlaybook
()
internal/artifact/encode_test.go:13
↓ 4 callers
Function
saveCredentials
(cfg *config.Config, resp *cli.LoginResponse)
cmd/pad/cmd_auth.go:676
↓ 4 callers
Function
schemaHasField
schemaHasField returns true if the collection schema defines a field with the given key.
internal/server/handlers_items.go:2345
↓ 4 callers
Function
schemaTypeBrief
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 callers
Method
seedItem
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 callers
Function
sendSync
(t *testing.T, c *websocket.Conn, payload byte)
internal/collab/manager_test.go:286
↓ 4 callers
Function
setCSRFCookie
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 callers
Function
setupItemOpenTest
(t *testing.T, handler http.Handler)
cmd/pad/item_open_test.go:15
↓ 4 callers
Function
setupOwnedDeletedWorkspace
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 callers
Method
since
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:160
↓ 4 callers
Function
singleLine
singleLine collapses internal whitespace and newlines for safe inclusion in a markdown table cell.
internal/urlimport/openapi.go:488
↓ 4 callers
Method
snapshotBeforeMigrate
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 callers
Function
sortedActionNames
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:381
↓ 4 callers
Function
ssrSafe
()
web/src/lib/stores/localSearch.svelte.ts:354
↓ 4 callers
Function
tightenPerms
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 callers
Function
tokenScopeAllows
tokenScopeAllows checks if the token's scopes permit the given HTTP method and path. Scopes are stored as a JSON array of strings. Supported scopes (
internal/server/middleware_auth.go:1147
↓ 4 callers
Function
unwrapItems
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 callers
Function
upstreamHTTPErrorResult
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 callers
Function
wrapItemNotFound
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:266
↓ 4 callers
Method
write
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 callers
Function
writeConfig
(t *testing.T, path string, data map[string]any)
internal/mcp/install_test.go:805
↓ 4 callers
Function
writeRateLimitResponse
writeRateLimitResponse sends a 429 response with Retry-After and X-RateLimit-* headers.
internal/server/middleware_ratelimit.go:621
↓ 3 callers
Function
AllToolNames
AllToolNames returns all valid names and aliases that can be passed to `pad agent install`.
internal/cli/agents.go:236
↓ 3 callers
Function
AppendDecisionLogEntry
(fieldsJSON string, entry ItemDecisionLogEntry)
internal/models/item.go:379
↓ 3 callers
Function
AppendImplementationNote
(fieldsJSON string, note ItemImplementationNote)
internal/models/item.go:367
↓ 3 callers
Method
AsOpenChildren
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:1093
↓ 3 callers
Function
AttachmentDownloadURL
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 callers
Method
BackfillStatusTransitions
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 callers
Method
CancelCustomer
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 callers
Method
Capabilities
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 callers
Function
CategoryLabel
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 callers
Function
ColorizedStatus
ColorizedStatus returns a status icon + status text with appropriate color.
internal/cli/format.go:66
↓ 3 callers
Method
CreateAccessTokenSession
===================================================================== AccessTokenStorage =============================================================
internal/oauth/storage.go:229
↓ 3 callers
Method
CreateOAuthUser
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 callers
Method
CreatePKCERequest
============================================================ PKCE request sessions (handler/pkce/storage.go PKCERequestStorage) ======================
internal/store/oauth.go:522
↓ 3 callers
Method
CreateView
CreateView adds a new saved view.
internal/store/views.go:11
↓ 3 callers
Method
DateBucket
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 callers
Method
Delete
(ctx context.Context, key string)
internal/attachments/registry.go:79
↓ 3 callers
Method
DeleteAccountAtomic
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 callers
Method
DeleteDocument
(id string)
internal/store/documents.go:397
↓ 3 callers
Method
DisableTOTP
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 callers
Method
Dispatch
Dispatch runs `<Binary> <cmdPath...> <cliArgs...>` and packages the output for an MCP client.
internal/mcp/dispatch.go:127
↓ 3 callers
Method
EnsureUniqueUsername
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 callers
Method
ExportItemArtifact
ExportItemArtifact GETs the single-item artifact export endpoint (GET /workspaces/{ws}/items/{ref}/export) and returns the artifact bytes (Markdown +
internal/cli/client.go:704
↓ 3 callers
Method
Fetch
(ctx context.Context, args []string)
internal/mcp/resources.go:40
↓ 3 callers
Method
Fetch
Fetch runs `<Binary> <args...>` and returns stdout on success.
internal/mcp/resources.go:52
↓ 3 callers
Function
FieldKeysForKind
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 callers
Method
Get
Get / Stat / Delete are convenience helpers that resolve the key first.
internal/attachments/registry.go:63
↓ 3 callers
Method
GetAccessTokenSession
GetAccessTokenSession hydrates an access token. Inactive rows surface as fosite.ErrInactiveToken so the introspection / authorization-bearer middlewar
internal/oauth/storage.go:247
↓ 3 callers
Method
GetAllItemProgress
GetAllItemProgress returns child item completion counts for every item in the given collection within a workspace. includeArchived controls whether s
internal/store/items.go:3481
↓ 3 callers
Method
GetBillingMetrics
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 callers
Method
GetBlocksEdges
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:3906
↓ 3 callers
Method
GetCLIAuthSession
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 callers
Method
GetCollectionAnyState
GetCollectionAnyState is GetCollection without the `deleted_at IS NULL` filter — used by the open-children guard (IDEA-1494 R3 P3) so a child still at
internal/store/collections.go:103
↓ 3 callers
Method
GetCollectionGrant
GetCollectionGrant retrieves a collection grant by ID.
internal/store/grants.go:29
↓ 3 callers
Method
GetCurrentUser
GetCurrentUser returns the authenticated user's profile.
internal/cli/client.go:1016
↓ 3 callers
Method
GetDeletedWorkspaceBySlug
GetDeletedWorkspaceBySlug returns a SOFT-DELETED workspace by slug (deleted_at IS NOT NULL), including its owner_id, or nil when no such row exists (l
internal/store/workspaces.go:307
↓ 3 callers
Method
GetInvitation
GetInvitation retrieves an invitation by ID.
internal/store/workspace_members.go:660
↓ 3 callers
Method
GetItem
(wsSlug, itemSlug string)
internal/cli/client.go:238
↓ 3 callers
Method
GetItemByRef
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:455
↓ 3 callers
Method
GetItemBySlug
(workspaceID, slug string)
internal/store/items.go:435
↓ 3 callers
Method
GetItemGrant
GetItemGrant retrieves an item grant by ID.
internal/store/grants.go:117
↓ 3 callers
Method
GetItemsByIDsIncludeDeleted
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:706
↓ 3 callers
Function
GetLibraryConvention
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 callers
Function
GetLibraryPlaybook
GetLibraryPlaybook finds a playbook in the library by its title. Returns nil if no playbook with the given title exists.
internal/collections/playbook_library.go:80
↓ 3 callers
Method
GetPKCERequest
GetPKCERequest hydrates the PKCE session. Returns ErrOAuthNotFound if the row is missing.
internal/store/oauth.go:531
↓ 3 callers
Method
GetParentMap
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:3156
↓ 3 callers
Method
GetReportLayout
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 callers
Method
GetUserMetrics
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 callers
Method
GetUserWorkspaceMemberships
GetUserWorkspaceMemberships returns workspace memberships for admin user detail.
internal/store/workspace_members.go:1104
↓ 3 callers
Method
GetView
GetView returns a single view by ID.
internal/store/views.go:47
↓ 3 callers
Method
HasPassword
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 callers
Method
ImportArtifact
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:741
↓ 3 callers
Method
InvalidateAuthorizationCode
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 callers
Method
IsCloudServer
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 callers
Method
JSONArrayContains
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 callers
Method
ListMovedOutSince
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:1344
↓ 3 callers
Method
ListUserGrants
--- Cross-cutting queries --- ListUserGrants returns all collection and item grants for a user in a workspace.
internal/store/grants.go:189
↓ 3 callers
Method
ListUsers
ListUsers returns all users.
internal/store/users.go:243
↓ 3 callers
Method
ListVersionsResolved
ListVersionsResolved returns versions with full content (diffs resolved). Requires the current document content to reconstruct diff-based versions.
internal/store/versions.go:102
↓ 3 callers
Function
LoadRegistry
LoadRegistry reads the installation registry from disk. Returns an empty registry if the file doesn't exist.
internal/cli/registry.go:44
↓ 3 callers
Method
MCP
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 callers
Method
MCPConnectionStatsForUser
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 callers
Function
MCPConnectionStatsKey
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
↓ 3 callers
Function
MCPPropertyName
MCPPropertyName converts a CLI flag or argument name to the snake_case form used inside the dispatch input map. Hyphens become underscores; everything
internal/mcp/registry.go:110
↓ 3 callers
Method
ManagesLocalServer
ManagesLocalServer reports whether this client configuration should auto-manage a local Pad server process.
internal/config/config.go:283
↓ 3 callers
Method
MarkStripeEventProcessed
MarkStripeEventProcessed records a Stripe webhook event ID in stripe_processed_events if it hasn't been seen before. Returns alreadyProcessed=true whe
internal/store/stripe_events.go:27
↓ 3 callers
Method
MinOpLogID
MinOpLogID powers the resume-cursor / force-refresh check (TASK-1319): when a reconnecting client announces `?since=<id>` and that id is below MIN, ro
internal/collab/room.go:169
↓ 3 callers
Method
MoveItemWithPreCheck
MoveItemWithPreCheck is MoveItem with the same precheck escape hatch UpdateItemWithPreCheck offers. Codex round-3 P1: a `pad item move ... --field sta
internal/store/items.go:4002
↓ 3 callers
Function
NewPostgres
NewPostgres creates a Store backed by PostgreSQL. The connStr should be a PostgreSQL connection string (e.g. "postgres://user:pass@host/db").
internal/store/store.go:232
↓ 3 callers
Function
NewSharedWorkspaceState
NewSharedWorkspaceState returns a state for a multi-user process (the cloud /mcp transport). It records Set/Get like any other state, but ResolveDefau
internal/mcp/workspace.go:66
↓ 3 callers
Function
NewWithReplay
NewWithReplay creates a new in-memory EventBus with custom replay settings.
internal/events/bus.go:229
↓ 3 callers
Function
ParseAttachmentHref
ParseAttachmentHref returns the UUID portion of a `pad-attachment:UUID` reference, or "" if href is not a pad-attachment reference / has an empty UUID
internal/server/render/attachments.go:53
↓ 3 callers
Function
ParsePlaybookCLIArgs
ParsePlaybookCLIArgs splits a sequence of positional args + bareword flags + key=value pairs into a typed map matching the playbook's declared spec. E
internal/server/handlers_playbooks.go:424
↓ 3 callers
Function
PlaybookSummary
PlaybookSummary extracts a short prose hint from a playbook body. Picks the first non-heading non-empty paragraph and caps at ~240 chars so summary pa
internal/collections/summary.go:12
↓ 3 callers
Method
PostRaw
PostRaw sends raw bytes to the API and decodes the JSON response.
internal/cli/client.go:838
↓ 3 callers
Method
Publish
Publish fans an event out to every subscriber whose itemID matches. Non-blocking: a slow subscriber whose buffer is full has new events dropped (logg
internal/collab/memory_bus.go:113
↓ 3 callers
Method
PurgeWorkspaceData
PurgeWorkspaceData hard-deletes every child row of a soft-deleted workspace and the workspace row itself, in a single transaction. Blob bytes are NOT
internal/store/workspace_purge.go:221
↓ 3 callers
Function
ReadBootstrapToken
ReadBootstrapToken reads <DataDir>/.bootstrap-token. The file is created by EnsureBootstrapToken in internal/server/bootstrap.go with mode 0600 and co
internal/cli/bootstrap.go:197
← previous
next →
801–900 of 6,005, ranked by callers