Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/PerpetualSoftware/pad
/ functions
Functions
7,856 in github.com/PerpetualSoftware/pad
⨍
Functions
7,856
◇
Types & classes
959
↓ 13 callers
Function
taskSchema
()
internal/items/validate_test.go:10
↓ 13 callers
Function
uploadIntegrationPNG
(t *testing.T, srv *Server, slug string, w, h int)
internal/server/handlers_attachments_transform_test.go:41
↓ 13 callers
Method
writeItemResolveError
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:789
↓ 12 callers
Method
AddConnectionWorkspace
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 callers
Function
EnsureServer
EnsureServer checks if the pad server is running; if not, starts it in the background.
internal/cli/server.go:16
↓ 12 callers
Function
ExtractWikiLinks
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 callers
Method
ForceRefreshRoom
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 callers
Method
GetOAuthConnectionAccess
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 callers
Method
MoveItem
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:4383
↓ 12 callers
Function
NewRegistry
NewRegistry returns an empty registry.
internal/attachments/registry.go:26
↓ 12 callers
Method
Search
(params SearchParams)
internal/store/search.go:89
↓ 12 callers
Function
SetWorkspaceTool
SetWorkspaceTool returns the (Tool, Handler) pair for the built-in pad_set_workspace tool. The handler updates state in place. Exposed as a construct
internal/mcp/workspace.go:121
↓ 12 callers
Method
Subscribe
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 callers
Method
SubscriberCount
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 callers
Function
ValidateUpload
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 callers
Function
WithTokenScopes
WithTokenScopes returns ctx decorated with the API token's JSON-encoded scopes string (e.g. `["read"]`, `["*"]`). Stashed by the MCP Bearer middleware
internal/server/context.go:89
↓ 12 callers
Function
acquire
(exemptRoot: HTMLElement)
web/src/lib/a11y/viewerBackdrop.ts:217
↓ 12 callers
Function
bootstrapBody
(email string)
internal/server/handlers_auth_bootstrap_token_test.go:45
↓ 12 callers
Method
checkItemVisible
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:2131
↓ 12 callers
Function
childLinkTypeSQL
childLinkTypeSQL returns a SQL IN clause fragment like "'parent','implements'" for filtering item_links by child relationship types.
internal/store/items.go:23
↓ 12 callers
Function
collectionSchemaJSONFromFlags
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 callers
Function
contextWithResolvedWorkspaceIDForTest
(ctx context.Context, wsID string)
internal/server/authz_cross_workspace_test.go:23
↓ 12 callers
Function
doAuthedJSON
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 callers
Function
getOnlyAttachmentID
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 callers
Function
mcpEnabledTestServer
mcpEnabledTestServer builds a Server with cloud mode + a stub streamable-HTTP transport so tests targeting auth / discovery / routing don't need to dr
internal/server/handlers_mcp_test.go:380
↓ 12 callers
Method
movedTo
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 callers
Function
newMockStore
(hooks []models.Webhook)
internal/webhooks/dispatcher_test.go:25
↓ 12 callers
Function
newRequestCapture
()
internal/mcp/dispatch_http_advanced_test.go:908
↓ 12 callers
Function
newTestConfig
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 callers
Function
newVerifiedEmailFixture
(t *testing.T, cloud bool)
internal/server/middleware_verified_email_test.go:46
↓ 12 callers
Function
runHelp
runHelp invokes the help command with the given args and returns (stdout, stderr, error).
cmd/pad/help_cmdhelp_test.go:46
↓ 11 callers
Method
AppendYjsUpdate
(itemID string, data []byte, schemaVersion string)
internal/collab/manager_test.go:61
↓ 11 callers
Method
CopyItem
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 callers
Method
CreateActivity
(a models.Activity)
internal/store/activities.go:17
↓ 11 callers
Method
CreateActivityDebounced
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 callers
Function
DeriveClaimCode
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 callers
Method
GetOAuthClient
GetOAuthClient looks up a registered client by ID. Returns ErrOAuthNotFound if no row matches.
internal/store/oauth.go:136
↓ 11 callers
Method
GetUserWorkspaces
(userID string)
internal/mcp/dispatch_http_lister.go:51
↓ 11 callers
Method
LoadYjsUpdatesSince
(itemID string, sinceID int64)
internal/collab/room.go:233
↓ 11 callers
Function
MigrateFields
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 callers
Function
New
New creates a MemoryBus with the default replay buffer size.
internal/watchevents/watchevents.go:222
↓ 11 callers
Function
NewFetcher
NewFetcher returns a Fetcher with production defaults applied.
internal/urlimport/fetch.go:92
↓ 11 callers
Method
RestoreItem
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:2691
↓ 11 callers
Method
Save
Save writes the persisted Pad config to disk.
internal/config/config.go:253
↓ 11 callers
Method
SetEncryptionKey
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 callers
Method
SetTOTPSecret
--- 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 callers
Method
StarItem
StarItem stars an item for a user. Idempotent — re-starring is a no-op.
internal/store/item_stars.go:13
↓ 11 callers
Method
Unsubscribe
Unsubscribe removes a subscriber and closes its channel.
internal/events/bus.go:136
↓ 11 callers
Function
callToolRequest
── 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 callers
Function
containsToolText
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 callers
Function
contextWithWorkspaceRoleForTest
contextWithWorkspaceRoleForTest / contextWithResolvedWorkspaceIDForTest stash the two values RequireWorkspaceAccess populates for the REQUEST's worksp
internal/server/authz_cross_workspace_test.go:19
↓ 11 callers
Function
createBlocksLink
helper: create a "blocks" link from source to target
internal/server/handlers_dashboard_test.go:37
↓ 11 callers
Method
dest
dest creates a destination item in ws and returns it.
internal/store/item_workspace_moves_test.go:37
↓ 11 callers
Function
diffFields
(oldFields, newFields string)
internal/server/handlers_documents.go:414
↓ 11 callers
Function
equalStrings
(a, b []string)
internal/mcp/catalog_test.go:338
↓ 11 callers
Function
hydrateItemComputedMetadata
(item *models.Item)
internal/store/items.go:5024
↓ 11 callers
Function
makeFanOutHandler
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:349
↓ 11 callers
Function
makeTestImage
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 callers
Function
mustParseQueryFromPath
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 callers
Function
newCopyTestClient
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 callers
Function
newHTTPResourceFetcher
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 callers
Function
newMoveFixture
(t *testing.T, name string)
internal/store/item_workspace_moves_test.go:22
↓ 11 callers
Function
newPadServer
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 callers
Function
AddPadEntry
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 callers
Method
CreateDocument
(workspaceID string, input models.DocumentCreate)
internal/store/documents.go:146
↓ 10 callers
Function
Decode
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 callers
Method
Delete
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 callers
Method
DeleteCollection
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 callers
Function
DetectWorkspace
DetectWorkspace walks up the directory tree from cwd looking for .pad.toml.
internal/cli/workspace.go:25
↓ 10 callers
Method
Dispatch
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 callers
Method
EventsSince
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
↓ 10 callers
Method
GetWorkspaceByID
(id string)
internal/store/workspaces.go:151
↓ 10 callers
Method
Handle
(_ context.Context, r slog.Record)
internal/store/items_test.go:1805
↓ 10 callers
Method
ListUserOAuthConnections
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 callers
Method
Register
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 callers
Function
RunBrowserBootstrap
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 callers
Method
SetPlatformSetting
SetPlatformSetting upserts a platform setting.
internal/store/platform_settings.go:16
↓ 10 callers
Method
UpdateCollection
(id string, input models.CollectionUpdate)
internal/store/collections.go:306
↓ 10 callers
Method
WorkspaceAttachments
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 callers
Function
appendToCatalog
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 callers
Function
configureBootstrapToken
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 callers
Function
connectSSE
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 callers
Function
createBulkTestItem
createBulkTestItem creates a task and returns it.
internal/server/handlers_items_bulk_test.go:15
↓ 10 callers
Function
createTestWorkspace
createTestWorkspace creates a workspace via API and returns its slug.
internal/server/handlers_events_test.go:113
↓ 10 callers
Method
decrypt
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 callers
Method
dispatchWebhook
dispatchWebhook fires a webhook event if a dispatcher is configured.
internal/server/handlers_webhooks.go:25
↓ 10 callers
Function
doArtifactRequest
doArtifactRequest posts a raw (non-JSON) body to an artifact-import endpoint.
internal/server/handlers_artifact_test.go:17
↓ 10 callers
Function
filterAttention
filterAttention returns attention items of a given type.
internal/server/handlers_dashboard_test.go:1275
↓ 10 callers
Function
getGraph
helper: fetch the workspace graph and return the parsed response
internal/server/handlers_graph_test.go:12
↓ 10 callers
Method
invalidate
Supersede every outstanding token without taking a new one.
web/src/lib/attachments/viewFence.ts:145
↓ 10 callers
Function
itemUrl
(fixture: SuiteFixture, slug: string)
web/e2e/lib/attachment-viewer.ts:387
↓ 10 callers
Function
mapItemCreate
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 callers
Function
newBackfillTestStore
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 callers
Function
newDownloadAuthzFixture
(t *testing.T, srv *Server)
internal/server/handlers_attachments_download_authz_test.go:83
↓ 10 callers
Function
newOAuthConnTestStore
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 callers
Function
newTestFSStore
(t *testing.T)
internal/attachments/fs_store_test.go:22
↓ 10 callers
Function
newTestRequest
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 callers
Function
putBlob
Blob-read authorization tests for PLAN-2391 / TASK-2401 (BUG-2386). handleGetAttachment used to open with a flat requireMinRole("viewer"). roleLevel(
internal/server/handlers_attachments_download_authz_test.go:33
↓ 10 callers
Method
removeEventListener
(type: 'toolchange', listener: (ev: Event) => void)
web/src/lib/webmcp/types.d.ts:79
↓ 10 callers
Function
renderMD
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
← previous
next →
301–400 of 7,856, ranked by callers