MCPcopy Create free account

hub / github.com/PerpetualSoftware/pad / functions

Functions8,091 in github.com/PerpetualSoftware/pad

↓ 13 callersFunctionbootstrapAccountDeleteUser
bootstrapAccountDeleteUser creates the first admin user, sets a Stripe customer ID on them, and returns (userID, sessionToken). Used by the handleDele
internal/server/handlers_account_test.go:70
↓ 13 callersMethodclose
()
web/src/lib/services/sseFirstConnectSync.svelte.test.ts:42
↓ 13 callersMethodcopyOK
copyOK issues the copy as the owner and requires a 201.
internal/server/handlers_items_copy_test.go:94
↓ 13 callersFunctiondeleteAccountReq
deleteAccountReq issues the delete-account request from a client IP that differs from the loopback address bootstrap ran on. The session-IP-change mid
internal/server/handlers_account_test.go:93
↓ 13 callersFunctiondownloadAs
downloadAs issues GET or HEAD on the blob endpoint as a specific user + workspace role, bypassing the auth middleware the same way deleteAsUser does.
internal/server/handlers_attachments_download_authz_test.go:158
↓ 13 callersMethodgoAsync
goAsync spawns fn in a goroutine that's tracked by s.bg, so Stop() can wait for in-flight background work to finish. Use this for any fire-and-forget
internal/server/server.go:327
↓ 13 callersFunctionisolateHome
isolateHome redirects HOME to a temp dir and chdirs to a fresh temp project dir so credential writes and .pad.toml detection don't leak into the real
cmd/pad/setup_headless_test.go:89
↓ 13 callersFunctionmustSeedWorkspaceWithRole
mustSeedWorkspaceWithRole is a test helper that creates a workspace + adds the user as a member with the given role. Centralized here because TASK-952
internal/server/handlers_oauth_test.go:1821
↓ 13 callersFunctionnewTestClient
Tests for the OAuth 2.1 storage layer (PLAN-943 TASK-951 sub-PR A). The store layer is fosite-agnostic by design — sub-PR B introduces the fosite impo
internal/store/oauth_test.go:22
↓ 13 callersFunctionpassThrough
passThrough returns an ActionFn that forwards the input verbatim to the given cmdPath via env.Dispatch. The vast majority of catalog actions use this
internal/mcp/catalog.go:178
↓ 13 callersMethodrestrictedEditor
--- authorization: the four checks, in order -------------------------- restrictedEditor returns an editor in both workspaces whose membership in each
internal/server/handlers_items_copy_preflight_test.go:652
↓ 13 callersFunctiontaskSchema
()
internal/items/validate_test.go:10
↓ 13 callersFunctionuploadIntegrationPNG
(t *testing.T, srv *Server, slug string, w, h int)
internal/server/handlers_attachments_transform_test.go:41
↓ 12 callersMethodAddConnectionWorkspace
AddConnectionWorkspace inserts a (request_id, workspace_id) row in the allow-list join table. Idempotent: re-adding an existing pair is a no-op (INSER
internal/store/oauth_connections.go:303
↓ 12 callersFunctionEnsureServer
EnsureServer checks if the pad server is running; if not, starts it in the background.
internal/cli/server.go:16
↓ 12 callersFunctionExtractWikiLinks
ExtractWikiLinks scans `content` for [[...]] occurrences OUTSIDE any fenced or inline code region, parses each into a WikiLinkRef, and returns them in
internal/links/extract.go:477
↓ 12 callersMethodForceRefreshRoom
ForceRefreshRoom makes items.content the canonical source for an item's collab state: it runs `commit` under the per-item lock (so the caller can atom
internal/collab/manager.go:1058
↓ 12 callersMethodGetOAuthConnectionAccess
GetOAuthConnectionAccess is the hot-path projection used by the MCP introspection middleware. Runs at most two cheap indexed queries (one PK lookup, o
internal/store/oauth_connections.go:151
↓ 12 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:4400
↓ 12 callersFunctionNew
New creates a MemoryBus with the default replay buffer size.
internal/watchevents/watchevents.go:272
↓ 12 callersFunctionNewRegistry
NewRegistry returns an empty registry.
internal/attachments/registry.go:26
↓ 12 callersMethodSearch
(params SearchParams)
internal/store/search.go:89
↓ 12 callersMethodSubscribe
Subscribe registers a new subscriber for the given workspace. Returns a buffered channel that will receive events for that workspace.
internal/events/bus.go:127
↓ 12 callersMethodSubscriberCount
SubscriberCount returns the number of active subscribers whose itemID matches. Used by the room manager to decide when the active peer count has dropp
internal/collab/memory_bus.go:154
↓ 12 callersFunctionValidateUpload
ValidateUpload combines the sniff result, the client-supplied MIME header, and the filename's extension to produce one of: - (entry, "", nil) — accep
internal/attachments/mime.go:242
↓ 12 callersFunctionacquire
(exemptRoot: HTMLElement)
web/src/lib/a11y/viewerBackdrop.ts:217
↓ 12 callersFunctionbootstrapBody
(email string)
internal/server/handlers_auth_bootstrap_token_test.go:45
↓ 12 callersMethodcheckItemVisible
checkItemVisible is the context-free visibility decision. Returns (true, nil) when the (user, role) pair can see `item` under the same rules `requireI
internal/server/server.go:2174
↓ 12 callersFunctionchildLinkTypeSQL
childLinkTypeSQL returns a SQL IN clause fragment like "'parent','implements'" for filtering item_links by child relationship types.
internal/store/items.go:23
↓ 12 callersFunctioncollectionSchemaJSONFromFlags
collectionSchemaJSONFromFlags resolves the --schema and --fields flags into a marshaled CollectionSchema JSON string. Exactly one of schemaInput or f
cmd/pad/cmd_collection.go:80
↓ 12 callersFunctioncontextWithResolvedWorkspaceIDForTest
(ctx context.Context, wsID string)
internal/server/authz_cross_workspace_test.go:23
↓ 12 callersFunctiondoAuthedJSON
Mutation-endpoint tests for /api/v1/connected-apps/{id}/... routes (PLAN-1519 / TASK-1524 / IDEA-1517 §3). What's covered (per endpoint): - PATCH /n
internal/server/handlers_connected_apps_mutations_test.go:35
↓ 12 callersFunctiongetOnlyAttachmentID
getOnlyAttachmentID returns the ID of the single live attachment row in a workspace — the test infrastructure uploads at most one blob per call, so th
internal/server/handlers_storage_test.go:410
↓ 12 callersMethodmovedTo
movedTo parses the response and returns the moved_to block. It also asserts the disclosure rule's negative half: when the block is absent the KEY must
internal/server/item_moved_to_test.go:181
↓ 12 callersFunctionnewMockStore
(hooks []models.Webhook)
internal/webhooks/dispatcher_test.go:25
↓ 12 callersFunctionnewRequestCapture
()
internal/mcp/dispatch_http_advanced_test.go:908
↓ 12 callersFunctionnewTestConfig
newTestConfig points DataDir at a fresh tmp dir and BrowserURL at the given test server. Most tests want both wired up together.
internal/cli/bootstrap_test.go:39
↓ 12 callersFunctionnewVerifiedEmailFixture
(t *testing.T, cloud bool)
internal/server/middleware_verified_email_test.go:46
↓ 12 callersMethodreload
(t *testing.T)
internal/mcp/dispatch_http_clear_assignment_test.go:121
↓ 12 callersFunctionrunHelp
runHelp invokes the help command with the given args and returns (stdout, stderr, error).
cmd/pad/help_cmdhelp_test.go:46
↓ 11 callersMethodAppendYjsUpdate
(itemID string, data []byte, schemaVersion string)
internal/collab/manager_test.go:61
↓ 11 callersMethodCopyItem
CopyItem performs the MUTATING cross-workspace copy. NEVER RETRY THIS CALL (DR-13). See the file header for the four mechanisms that enforce it. On f
internal/cli/client_items_copy.go:268
↓ 11 callersMethodCreateActivity
(a models.Activity)
internal/store/activities.go:17
↓ 11 callersMethodCreateActivityDebounced
CreateActivityDebounced creates a new activity or updates an existing one if a matching activity (same document, same user, same action) was recorded
internal/store/activities.go:39
↓ 11 callersFunctionDeriveClaimCode
DeriveClaimCode produces the 6-digit code for the given (user, workspace) at the given wall-clock time. Exported so the Phase E "Connect project" moda
internal/server/claim_codes.go:78
↓ 11 callersMethodGetOAuthClient
GetOAuthClient looks up a registered client by ID. Returns ErrOAuthNotFound if no row matches.
internal/store/oauth.go:136
↓ 11 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:3507
↓ 11 callersMethodGetUserWorkspaces
(userID string)
internal/mcp/dispatch_http_lister.go:51
↓ 11 callersMethodLoadYjsUpdatesSince
(itemID string, sinceID int64)
internal/collab/room.go:233
↓ 11 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
↓ 11 callersFunctionNewFetcher
NewFetcher returns a Fetcher with production defaults applied.
internal/urlimport/fetch.go:92
↓ 11 callersFunctionNewSQLite
NewSQLite returns a *store.Store backed by a fresh SQLite file in t.TempDir(), fully migrated. See the package doc for the template+copy mechanism. St
internal/store/storetest/storetest.go:54
↓ 11 callersMethodRestoreItem
RestoreItem un-archives a soft-deleted item and bumps the workspace-scoped seq so delta-sync clients re-materialize the row. Same lock + subquery shap
internal/store/items.go:2708
↓ 11 callersMethodSave
Save writes the persisted Pad config to disk.
internal/config/config.go:253
↓ 11 callersMethodSetEncryptionKey
SetEncryptionKey configures the store's AES-256 encryption key for encrypting sensitive fields (e.g., TOTP secrets) at rest. The key must be exactly 3
internal/store/encryption.go:19
↓ 11 callersMethodSetTOTPSecret
--- TOTP 2FA --- SetTOTPSecret stores the TOTP secret for a user (before 2FA is verified). The secret is encrypted at rest if an encryption key is con
internal/store/users.go:1183
↓ 11 callersMethodStarItem
StarItem stars an item for a user. Idempotent — re-starring is a no-op.
internal/store/item_stars.go:13
↓ 11 callersMethodUnsubscribe
Unsubscribe removes a subscriber and closes its channel.
internal/events/bus.go:136
↓ 11 callersFunctioncallToolRequest
── test helpers ── callToolRequest builds an mcp.CallToolRequest with the given input arguments — the public constructor isn't exposed by mcp-go so we
internal/mcp/catalog_test.go:320
↓ 11 callersFunctioncontainsToolText
containsToolText looks for substr in any TextContent block of res. MCP results can carry multiple content blocks; checking all of them keeps the asser
internal/mcp/dispatch_http_test.go:977
↓ 11 callersFunctioncontextWithWorkspaceRoleForTest
contextWithWorkspaceRoleForTest / contextWithResolvedWorkspaceIDForTest stash the two values RequireWorkspaceAccess populates for the REQUEST's worksp
internal/server/authz_cross_workspace_test.go:19
↓ 11 callersFunctioncreateBlocksLink
helper: create a "blocks" link from source to target
internal/server/handlers_dashboard_test.go:37
↓ 11 callersMethoddest
dest creates a destination item in ws and returns it.
internal/store/item_workspace_moves_test.go:37
↓ 11 callersFunctiondiffFields
(oldFields, newFields string)
internal/server/handlers_documents.go:414
↓ 11 callersMethoddispatch
(t *testing.T, cmd []string, input map[string]any)
internal/mcp/dispatch_http_clear_parent_test.go:100
↓ 11 callersFunctionequalStrings
(a, b []string)
internal/mcp/catalog_test.go:338
↓ 11 callersFunctionhydrateItemComputedMetadata
(item *models.Item)
internal/store/items.go:5041
↓ 11 callersFunctionmakeFanOutHandler
makeFanOutHandler returns the ToolHandlerFunc that mcp-go invokes when the tool is called. Reads `action` from the input, looks up the handler, and fo
internal/mcp/catalog.go:399
↓ 11 callersFunctionmakeTestImage
makeTestImage returns a freshly-allocated NRGBA image filled with a distinguishable pattern so transformation tests can assert on specific pixels. Wid
internal/attachments/processor_test.go:23
↓ 11 callersFunctionmapItemList
(BUG-2001) The dispatcher used to mirror the CLI's hardcoded active-status allowlist here. That wrongly hid open items in collections with custom stat
internal/mcp/dispatch_http_routes.go:1156
↓ 11 callersFunctionmustParseQueryFromPath
mustParseQueryFromPath extracts the query-string portion of path and parses it. Test-only — fails the test on malformed input.
internal/mcp/dispatch_http_routes_test.go:27
↓ 11 callersFunctionnewCopyTestClient
newCopyTestClient points a Client at ts with a HOME that has no saved credentials, so the test never picks up the developer's real token.
internal/cli/client_items_copy_test.go:17
↓ 11 callersFunctionnewHTTPResourceFetcher
newHTTPResourceFetcher wires an HTTPResourceFetcher over a test mux with a fixed authenticated user, mirroring the dispatch_http_*_test.go setup. The
internal/mcp/resources_http_test.go:24
↓ 11 callersFunctionnewMoveFixture
(t *testing.T, name string)
internal/store/item_workspace_moves_test.go:22
↓ 11 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
↓ 11 callersFunctionsetupPushTest
setupPushTest mirrors setupItemOpenTest (item_open_test.go): points getClient()/getWorkspace() at a fake httptest server via the same urlFlag/workspac
cmd/pad/cmd_push_test.go:14
↓ 10 callersFunctionAddPadEntry
AddPadEntry reads (or creates) the JSON config at path, ensures mcpServers.pad points to `binary`, and writes the file back. Existing entries outside
internal/mcp/install.go:211
↓ 10 callersMethodCreateDocument
(workspaceID string, input models.DocumentCreate)
internal/store/documents.go:146
↓ 10 callersFunctionDecode
Decode parses an artifact's portable on-disk form back into an Artifact. It splits a leading "---\n ... \n---" frontmatter block from the body, unmar
internal/artifact/decode.go:21
↓ 10 callersMethodDelete
Delete removes the blob identified by key. Deleting a missing key is NOT an error — callers (e.g. the orphan GC) treat it as the success case.
internal/attachments/store.go:54
↓ 10 callersMethodDeleteCollection
DeleteCollection soft-deletes a collection by id. When expectedUpdatedAt is non-empty it opts into optimistic-concurrency control (BUG-2265): the row'
internal/store/collections.go:497
↓ 10 callersFunctionDetectWorkspace
DetectWorkspace walks up the directory tree from cwd looking for .pad.toml.
internal/cli/workspace.go:25
↓ 10 callersMethodDispatch
Dispatch sends the event payload to all matching active webhooks for the workspace. Each delivery runs in its own goroutine so the caller is never blo
internal/webhooks/dispatcher.go:180
↓ 10 callersMethodGetWorkspaceByID
(id string)
internal/store/workspaces.go:151
↓ 10 callersMethodHandle
(_ context.Context, r slog.Record)
internal/store/items_test.go:1805
↓ 10 callersMethodListUserOAuthConnections
ListUserOAuthConnections returns every OAuth connection the user has active. "Active" means at least one access OR refresh token in the chain still ha
internal/store/connected_apps.go:59
↓ 10 callersFunctionNew
(s *store.Store)
internal/server/server.go:416
↓ 10 callersMethodPublish
Publish assigns the Notification a monotonic ID, stores it in the replay buffer, and fans it out to every live Subscribe channel. ID assignment and bu
internal/watchevents/watchevents.go:147
↓ 10 callersMethodRegister
Register installs store under prefix (e.g. "fs", "s3"). The prefix MUST NOT contain a colon — Resolve splits keys on the first colon, so a prefix with
internal/attachments/registry.go:37
↓ 10 callersFunctionRunBrowserBootstrap
RunBrowserBootstrap walks the operator through the browser-based first- admin bootstrap. Returns nil on success (server has flipped to setup_required:
internal/cli/bootstrap.go:92
↓ 10 callersMethodSetPlatformSetting
SetPlatformSetting upserts a platform setting.
internal/store/platform_settings.go:16
↓ 10 callersMethodUpdateCollection
(id string, input models.CollectionUpdate)
internal/store/collections.go:306
↓ 10 callersMethodWorkspaceAttachments
WorkspaceAttachments lists original (non-derived) attachments in a workspace, with optional filtering + sorting + pagination. Returns the page rows an
internal/store/attachments.go:476
↓ 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 callersMethoddispatchWebhook
dispatchWebhook fires a webhook event if a dispatcher is configured.
internal/server/handlers_webhooks.go:25
← previousnext →301–400 of 8,091, ranked by callers