MCPcopy Create free account

hub / github.com/PerpetualSoftware/pad / functions

Functions6,412 in github.com/PerpetualSoftware/pad

↓ 10 callersMethodappend
append adds an event to the ring buffer, evicting the oldest if full.
internal/events/bus.go:174
↓ 10 callersFunctionappendToCatalog
appendToCatalog inserts def into Catalog. Called from catalog_<resource>.go init() functions. Keep this small + simple; validation happens at Register
internal/mcp/catalog.go:194
↓ 10 callersFunctionconfigureBootstrapToken
configureBootstrapToken seeds a known token on the server so tests don't depend on the random generator. The on-disk file is created in a temp dir so
internal/server/handlers_auth_bootstrap_token_test.go:34
↓ 10 callersFunctionconnectSSE
connectSSE connects to the SSE endpoint on a real test server and returns a channel of parsed events. Cancel the context to disconnect.
internal/server/handlers_events_test.go:35
↓ 10 callersFunctioncreateBulkTestItem
createBulkTestItem creates a task and returns it.
internal/server/handlers_items_bulk_test.go:15
↓ 10 callersFunctioncreateTestWorkspace
createTestWorkspace creates a workspace via API and returns its slug.
internal/server/handlers_events_test.go:113
↓ 10 callersMethoddecrypt
decrypt decrypts a value that was encrypted with encrypt(). If the value doesn't have the "enc:" prefix, it's treated as plaintext (backward compatibi
internal/store/encryption.go:60
↓ 10 callersFunctiondoArtifactRequest
doArtifactRequest posts a raw (non-JSON) body to an artifact-import endpoint.
internal/server/handlers_artifact_test.go:17
↓ 10 callersFunctionfilterAttention
filterAttention returns attention items of a given type.
internal/server/handlers_dashboard_test.go:1275
↓ 10 callersFunctiongetGraph
helper: fetch the workspace graph and return the parsed response
internal/server/handlers_graph_test.go:12
↓ 10 callersFunctionmapItemCreate
mapItemCreate translates an `item create` MCP call into a POST to api/v1/workspaces/{ws}/collections/{coll}/items. The MCP tool schema (auto-generate
internal/mcp/dispatch_http.go:716
↓ 10 callersFunctionmount
(html: string)
web/src/lib/collections/paneFocus.svelte.test.ts:16
↓ 10 callersFunctionnewBackfillTestStore
BackfillOAuthConnections tests (PLAN-1519 / TASK-1522 / IDEA-1517 §2). What's covered: - Pre-TASK-952 session (no key) → all_current=1, no
internal/store/oauth_connections_backfill_test.go:29
↓ 10 callersFunctionnewOAuthConnTestStore
OAuth connection store tests (PLAN-1519 / TASK-1520 — Phase A foundation). What's covered: - CreateOAuthConnection + GetOAuthConnection round-trip w
internal/store/oauth_connections_test.go:35
↓ 10 callersFunctionnewPadServer
newPadServer stands up the same *server.Server that production uses, wired to a fast fixture SQLite store (storetest.NewSQLite, IDEA-1914). Mirrors te
internal/mcp/dispatch_http_test.go:948
↓ 10 callersFunctionnewTestFSStore
(t *testing.T)
internal/attachments/fs_store_test.go:22
↓ 10 callersFunctionnewTestRequest
newTestRequest builds an OAuthRequest with sensible defaults; tests override fields they care about. signature uniqueness is the caller's responsibili
internal/store/oauth_test.go:42
↓ 10 callersFunctionrenderMD
renderMD is a small test helper that builds + renders the synthetic tree with a fixed clock and returns the markdown output as a string.
internal/cmdhelp/md_test.go:18
↓ 10 callersMethodrunOrphanGCSweep
runOrphanGCSweep walks the orphaned-attachments query and reclaims rows past the grace period. Two reclamation paths: - DB row only. content_hash is
internal/server/orphan_gc.go:47
↓ 10 callersFunctionsha256Hex
(b []byte)
internal/attachments/fs_store_test.go:17
↓ 10 callersFunctionslugify
slugify converts a string to a URL-friendly slug.
internal/store/store.go:877
↓ 10 callersFunctionuploadHelper
uploadHelper does a fresh upload and returns the parsed response.
internal/server/handlers_attachments_download_test.go:19
↓ 10 callersFunctionwaitForEvent
waitForEvent reads from the event channel with a timeout.
internal/server/handlers_events_test.go:76
↓ 10 callersFunctionwithTempHome
withTempHome chroots ~/.pad to a fresh tempdir for the test. CredentialsPath resolves via os.UserHomeDir → $HOME, so a t.Setenv("HOME", ...) is enough
internal/cli/credentials_test.go:14
↓ 10 callersMethodwriteItemResolveError
writeItemResolveError distinguishes a soft-deleted (archived) item from a genuinely-missing one for mutation handlers. An archived item still appears
internal/server/handlers_items.go:765
↓ 9 callersMethodCreateComment
CreateComment adds a new comment to an item. userID is the authenticated user authoring the comment (empty for agent/system comments); it's stored as
internal/store/comments.go:16
↓ 9 callersMethodCreateInvitation
--- Invitations --- CreateInvitation creates a pending workspace invitation. Generates a 128-bit (16-byte) random code and stores only its SHA-256 has
internal/store/workspace_members.go:626
↓ 9 callersMethodEnsureEncryptionKey
EnsureEncryptionKey makes sure the server has a usable encryption key without requiring the operator to set one explicitly. Resolution order: 1. If c
internal/config/config.go:449
↓ 9 callersMethodEventsSince
EventsSince returns events for a workspace with IDs greater than sinceID. Used to replay missed events on SSE reconnect (Last-Event-ID). Returns nil i
internal/events/bus.go:144
↓ 9 callersFunctionFormatForTool
FormatForTool takes the raw embedded skill content and formats it for a specific tool. Returns the appropriately formatted content with tool-specific
internal/cli/agents.go:202
↓ 9 callersMethodGetWorkspaceByID
(id string)
internal/store/workspaces.go:151
↓ 9 callersMethodIsCloud
IsCloud reports whether the server is running in cloud mode.
internal/server/server.go:493
↓ 9 callersMethodListDocuments
(workspaceID string, params models.DocumentListParams)
internal/store/documents.go:13
↓ 9 callersMethodMoveItem
MoveItem moves an item to a different collection within the same workspace. It updates the collection_id and fields JSON. The item_number is preserved
internal/store/items.go:4146
↓ 9 callersFunctionParseTrustedProxyCIDRs
ParseTrustedProxyCIDRs parses a comma-separated list of CIDRs or bare IPs from the PAD_TRUSTED_PROXIES setting. Bare IPs get /32 (IPv4) or 128 (IPv6).
internal/server/middleware_realip.go:90
↓ 9 callersMethodRestoreBoundary
RestoreBoundary returns the restore boundary recorded for itemID, or (0, false) when none has been set. The collab-snapshot PATCH handler consults it
internal/collab/manager.go:168
↓ 9 callersMethodSend
Send sends an email using the default from address/name.
internal/email/sender.go:122
↓ 9 callersMethodSetBypassSetupToken
SetBypassSetupToken wires the operator's PAD_BYPASS_SETUP_TOKEN choice into the Server. When true, handleBootstrap accepts a self-host first-admin POS
internal/server/bootstrap.go:191
↓ 9 callersMethodSetIPChangeEnforce
SetIPChangeEnforce controls how the auth middleware reacts when a session's binding (client IP OR User-Agent hash) changes mid-lifetime: - mode == "st
internal/server/server.go:922
↓ 9 callersMethodSetMCPTransport
MCP transport state. Set at startup by cmd/pad/main.go via SetMCPTransport when the deployment is in cloud mode (PAD_MODE=cloud). Self-hosted deployme
internal/server/handlers_mcp.go:66
↓ 9 callersFunctionTerminalValuesForDoneField
TerminalValuesForDoneField returns the resolved done-field key and the list of terminal values for that field. If the resolved field has no terminal_o
internal/models/terminal.go:74
↓ 9 callersFunctionValidateExamples
ValidateExamples is the contractual mechanism by which cmdhelp v0.1 prevents documentation drift (spec §6, §11 Q5). For every example in every command
internal/cmdhelp/example_validation.go:28
↓ 9 callersFunctionaddPadEntryTOML
--- TOML config path (Codex) -------------------------------------------- Codex nests its MCP servers in a TOML `[mcp_servers.pad]` table, so the JSO
internal/mcp/install.go:405
↓ 9 callersFunctionaudienceMatchingStrategy
audienceMatchingStrategy returns a fosite.AudienceMatchingStrategy that enforces "every requested audience must equal the configured canonical audienc
internal/oauth/audience.go:115
↓ 9 callersFunctioncreateTaskWithFields
createTaskWithFields is a small helper for the field-patch/OCC tests: POST a task with the given fields JSON and return the created item.
internal/server/handlers_items_fieldpatch_test.go:13
↓ 9 callersFunctioncsrfCookieName
csrfCookieName returns the CSRF cookie name. Uses the same __Host- prefix strategy as the session cookie.
internal/server/handlers_auth.go:54
↓ 9 callersFunctiondoJSONReq
doJSONReq drives a JSON request through srv and returns the recorder. Mirrors the local pattern in internal/server/server_test.go::doRequest, kept pac
internal/mcp/dispatch_http_routes_test.go:45
↓ 9 callersFunctiondoRequestWithHeadersFromAddr
doRequestWithHeadersFromAddr lets us combine arbitrary headers with a non-loopback remote-addr. Existing helpers cover one or the other but not both.
internal/server/handlers_auth_bootstrap_token_test.go:56
↓ 9 callersFunctiondocWith
docWith constructs a minimal Document with two commands sharing a `collection` arg (caching test) and one `role` flag.
internal/cmdhelp/dynamic_test.go:49
↓ 9 callersFunctionfakeSessionServer
fakeSessionServer returns an httptest.Server whose /api/v1/auth/session handler responds with the SessionResponse produced by `gen` (called once per r
internal/cli/bootstrap_test.go:23
↓ 9 callersFunctionmapCollectionUpdate
mapCollectionUpdate dispatches `pad collection update <slug> [--name ...] [--icon ...] [--description ...] [--prefix ...] [--schema ...] [--fields ...
internal/mcp/dispatch_http_routes.go:700
↓ 9 callersFunctionnewMCPSessionTracker
newMCPSessionTracker constructs a tracker with the given TTL and optional onChange callback. ttl <= 0 falls back to the default; onChange may be nil (
internal/server/middleware_mcp_session.go:79
↓ 9 callersFunctionnewRefResolverFixture
(t *testing.T)
internal/server/handlers_ref_resolver_test.go:51
↓ 9 callersFunctionnewStub
newStub starts a test HTTP server and returns a CloudClient pointed at it. Callers supply the handler to control the response.
internal/billing/cloud_client_test.go:16
↓ 9 callersFunctionnewTestSender
(ts *httptest.Server)
internal/email/sender_test.go:12
↓ 9 callersFunctionreadBinaryWithin
readBinaryWithin reads a single binary frame within d. Returns the payload bytes or fails the test on timeout.
internal/collab/manager_test.go:405
↓ 9 callersFunctionreadControlWithin
readControlWithin reads frames off the conn within d, drains payload (binary) frames, and returns the FIRST TextMessage parsed as a ControlMessage. Te
internal/collab/manager_test.go:1774
↓ 9 callersFunctionseedBackfillClient
seedBackfillClient mirrors seedClient in connected_apps_test.go but stays internal to this file so the backfill suite can run in isolation when other
internal/store/oauth_connections_backfill_test.go:64
↓ 9 callersFunctionseedBackfillUser
(t *testing.T, s *Store, email string)
internal/store/oauth_connections_backfill_test.go:40
↓ 9 callersFunctionseedConnectedAppForMutations
seedConnectedAppForMutations creates a user + workspace + an oauth_connections row directly so the mutation handlers have something to mutate. Returns
internal/server/handlers_connected_apps_mutations_test.go:64
↓ 9 callersFunctionseedDoc
( fixture: SuiteFixture, request: APIRequestContext, titlePrefix = 'Collab persistence', fields: Record<st
web/e2e/lib/collab-helpers.ts:47
↓ 9 callersFunctionsessionUserPayload
(user *models.User)
internal/server/handlers_auth.go:61
↓ 9 callersFunctionsetupPermissionTest
Phase 2 permission test suite (TASK-488). Tests collection-level visibility, system collection exemptions, and the VisibleCollectionIDs resolution log
internal/store/permissions_test.go:13
↓ 9 callersFunctionstr
* Read a string param. Absent (undefined/null) returns undefined — not an * error, matching strArray's absent-vs-malformed line. A present value of a
web/src/lib/webmcp/dispatch.ts:50
↓ 9 callersFunctionvalidatePasswordStrength
validatePasswordStrength enforces length + strength. It rejects weak passwords at registration / rotation / reset so top-of-breach-list entries like "
internal/server/password_strength.go:34
↓ 9 callersFunctionworkspaceRole
workspaceRole returns the user's role in the current workspace, as set by RequireWorkspaceAccess. Returns empty string if not set.
internal/server/middleware_auth.go:690
↓ 8 callersMethodAllowedWorkspaces
AllowedWorkspaces returns the workspace allow-list stored in session.Extra at consent time (TASK-952). Three return shapes matter to callers: - nil —
internal/oauth/session.go:100
↓ 8 callersMethodCreateRefreshToken
============================================================ Refresh tokens (handler/oauth2/storage.go RefreshTokenStorage) ==========================
internal/store/oauth.go:348
↓ 8 callersFunctionDoneFieldKey
DoneFieldKey resolves which field on a collection's schema represents "is this item done?". The resolution is: 1. If CollectionSettings.BoardGroupBy
internal/models/terminal.go:49
↓ 8 callersMethodEncryptionKeyFile
EncryptionKeyFile returns the on-disk path where an auto-generated encryption key is persisted. Operator-provided keys (PAD_ENCRYPTION_KEY env, encryp
internal/config/config.go:423
↓ 8 callersFunctionExtractItemCodeContext
(fieldsJSON string)
internal/models/item.go:172
↓ 8 callersFunctionExtractItemConventionMetadata
(fieldsJSON string)
internal/models/item.go:214
↓ 8 callersMethodFetch
Fetch performs a GET against rawURL, re-validating every redirect hop and aborting if the response exceeds the size cap. Returns a wrapped error suita
internal/urlimport/fetch.go:115
↓ 8 callersMethodGetComment
GetComment returns a single comment by ID.
internal/store/comments.go:64
↓ 8 callersMethodGetParentForItem
GetParentForItem returns the parent link for an item, or nil if it has no parent. A parent link pointing to a soft-deleted item is treated as no paren
internal/store/items.go:3253
↓ 8 callersMethodHydrateDerivedFields
()
internal/models/workspace_settings.go:141
↓ 8 callersMethodInstall
Install adds (or refreshes) the pad entry in the named agent's config. Returns the resolved path + whether the file was actually modified (false on a
internal/mcp/install.go:639
↓ 8 callersFunctionMigrateFields
MigrateFields maps field values from a source schema to a target schema. Fields with matching keys and compatible types are transferred. Incompatible
internal/items/migrate.go:24
↓ 8 callersFunctionNewRegistry
NewRegistry returns an empty registry.
internal/attachments/registry.go:26
↓ 8 callersFunctionNewServer
NewServer constructs an OAuth 2.1 authorization server backed by fosite v0.49.0. Compliance posture (PLAN-943 TASK-951): - PKCE required (S256 only)
internal/oauth/server.go:96
↓ 8 callersFunctionResolveAttachmentReferences
ResolveAttachmentReferences scans `markdown` for `pad-attachment:UUID` references in standard markdown image/link syntax and replaces each with render
internal/server/render/attachments.go:291
↓ 8 callersMethodRoomCount
RoomCount is a test/debug accessor. Production code shouldn't make decisions based on this — the count is racy with grace-timer expirations.
internal/collab/manager.go:864
↓ 8 callersMethodSubscriberCount
SubscriberCount returns the number of active subscribers for the given item. Useful for room-manager TTL accounting (TASK-1255 — when the count hits 0
internal/collab/bus.go:113
↓ 8 callersFunctionTrustedProxyRealIP
TrustedProxyRealIP returns middleware that rewrites r.RemoteAddr from X-Real-IP / X-Forwarded-For ONLY when the direct TCP peer is within one of the s
internal/server/middleware_realip.go:50
↓ 8 callersFunctionapplySQLiteMigration
applySQLiteMigration applies a single migration file atomically. Behavior (IDEA-1485): 1. PRAGMA statements are lifted out of the migration body (se
internal/store/store.go:595
↓ 8 callersFunctionassertBlocked
assertBlocked asserts the response is a 403 email_not_verified.
internal/server/middleware_verified_email_test.go:154
↓ 8 callersFunctionauditUser
auditUser creates a user that subsequent audit rows can FK-reference. The schema requires user_id REFERENCES users(id), so we can't insert audit rows
internal/store/mcp_audit_test.go:39
↓ 8 callersMethodbuild
(workspace string)
internal/cmdhelp/dynamic_test.go:22
↓ 8 callersFunctionbuildFositeRequest
buildFositeRequest produces a fully-populated *fosite.Request so adapter tests can drive Create*Session methods without depending on fosite's HTTP ent
internal/oauth/server_test.go:934
↓ 8 callersFunctionbuildHTMLShell
buildHTMLShell wraps body HTML in the standard transactional-email chrome — header (Pad wordmark) + body + footer note + (Cloud only) marketing footer
internal/email/shell.go:29
↓ 8 callersFunctiondialWSBracket
dialWSBracket joins as a bracket-capable participant (`?applier_bracket=1`) so the conn can be durably confirmed by a restore's finalization (BUG-2276
internal/collab/manager_test.go:362
↓ 8 callersFunctiondoRequestWithCookieFrom
doRequestWithCookieFrom is like doRequestWithCookie but lets the caller set the request RemoteAddr so tests can simulate a session jumping to a differ
internal/server/middleware_session_ip_test.go:18
↓ 8 callersFunctionexpandPath
expandPath substitutes {key} placeholders in template using input. Each placeholder must appear as a non-empty string in input; otherwise expandPath r
internal/mcp/dispatch_http_routes.go:85
↓ 8 callersMethodgetOrCreate
getOrCreate returns the existing Room for itemID or, atomically under m.mu, mints a new one. Holding m.mu across the lookup + insertion keeps the grac
internal/collab/manager.go:824
↓ 8 callersMethodisItemVisibleToGuest
isItemVisibleToGuest checks if an item is visible given grant-based access, considering both full-collection grants and individual item grants. When f
internal/server/server.go:2167
↓ 8 callersMethodlogActivity
logActivity is a helper that logs activity, ignoring errors (best-effort).
internal/server/handlers_documents.go:295
↓ 8 callersFunctionmapCollectionCreate
mapCollectionCreate dispatches `pad collection create <name> [--fields key:type[:opts]; ...] [--icon ...] [--description ...] [--layout ...] [--defaul
internal/mcp/dispatch_http_routes.go:460
↓ 8 callersMethodmaybeInjectWorkspace
maybeInjectWorkspace defaults the `workspace` input from the dispatcher's WorkspaceLister when the caller didn't pass one explicitly (TASK-1076). The
internal/mcp/dispatch_http_advanced.go:462
↓ 8 callersFunctionnewAuditTestStore
Store-layer tests for the MCP audit log (PLAN-943 TASK-960). What's covered: - InsertMCPAuditEntry validates required fields and round-trips correct
internal/store/mcp_audit_test.go:25
↓ 8 callersFunctionnewClaimTestEnv
(t *testing.T)
internal/server/handlers_oauth_claim_test.go:57
← previousnext →301–400 of 6,412, ranked by callers