Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/PerpetualSoftware/pad
/ functions
Functions
9,998 in github.com/PerpetualSoftware/pad
⨍
Functions
9,998
◇
Types & classes
1,131
↓ 13 callers
Method
restrictedEditor
--- 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 callers
Method
seedImage
seedImage creates an image original anchored to itemID plus its thumb-md variant, each with distinct bytes, and returns (originalID, thumbMdBytes).
internal/server/handlers_share_attachments_test.go:156
↓ 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
↓ 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
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:55
↓ 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
GetMemberCollectionAccess
GetMemberCollectionAccess returns the collection IDs a member has been explicitly granted access to (only meaningful when collection_access = "specifi
internal/store/workspace_members.go:344
↓ 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
Function
RegisterSession
RegisterSession records the CURRENT session — owner from the environment (CaptureSessionOwner), the given cwd and agent name — to ~/.pad/sessions/<ses
internal/cli/session_registry.go:156
↓ 12 callers
Method
Search
(params SearchParams)
internal/store/search.go:89
↓ 12 callers
Method
Subscribe
Subscribe registers a local subscriber for the given workspace. Starts a Redis subscription for the workspace if this is the first local subscriber, a
internal/events/redis_bus.go:886
↓ 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
Method
UpdateCollection
(id string, input models.CollectionUpdate)
internal/store/collections.go:391
↓ 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:245
↓ 12 callers
Method
VisibleCollectionIDs
VisibleCollectionIDs returns the set of collection IDs a member can see. Returns nil if the member has "all" access (meaning no filtering needed). Sys
internal/store/workspace_members.go:167
↓ 12 callers
Function
WithCollectionAliasFallback
withCollectionAliasFallback runs op against the RAW collection slug the user typed, and — only if that fails specifically because the collection was n
internal/cli/collection_alias.go:59
↓ 12 callers
Function
acquire
(exemptRoot: HTMLElement)
web/src/lib/a11y/viewerBackdrop.ts:217
↓ 12 callers
Function
bodyDecodesNUL
bodyDecodesNUL reports whether any string a handler could read out of this JSON body — an object key or a value, at any nesting depth, including insid
internal/server/middleware_request_text.go:486
↓ 12 callers
Function
bootstrapBody
(email string)
internal/server/handlers_auth_bootstrap_token_test.go:45
↓ 12 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:327
↓ 12 callers
Method
channelFor
(workspaceID string)
internal/events/redis_heartbeat_test.go:76
↓ 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:24
↓ 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
dispatchPadItem
dispatchPadItem runs one pad_item call through the fan-out handler and returns the fake dispatcher plus the tool result.
internal/mcp/catalog_item_fields_test.go:55
↓ 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
Method
emitItemEventTx
emitItemEventTx writes one item-subject event to the outbox on the caller's transaction, carrying the post-mutation snapshot. The snapshot must be re
internal/store/event_outbox.go:621
↓ 12 callers
Method
getItemTx
getItemTx is the in-transaction variant of GetItem. Used by UpdateItemWithPreCheck to re-read the parent under the workspace + parent-children locks s
internal/store/items.go:603
↓ 12 callers
Function
kindsOf
(entries []models.TimelineEntry)
internal/server/handlers_timeline_structured_test.go:64
↓ 12 callers
Method
liveGen
liveGen reports the generation of the workspace's installed subscription, and whether there is one at all. Distinct from currentSubGen, which answers
internal/events/redis_heartbeat.go:389
↓ 12 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:399
↓ 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
newConsentEnv
(t *testing.T, mayCreate bool)
internal/server/handlers_workspace_create_consent_test.go:67
↓ 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
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
↓ 12 callers
Method
reload
(t *testing.T)
internal/mcp/dispatch_http_clear_assignment_test.go:121
↓ 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
↓ 12 callers
Function
wedge
wedge simulates the failure this unit exists to detect: the outbound probe keeps SUCCEEDING and nothing comes back. Simulated rather than produced, b
internal/watchevents/heartbeat_test.go:67
↓ 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
CreateAttachmentForLiveItem
CreateAttachmentForLiveItem inserts an attachment row, refusing when its item_id does not name a LIVE item of the same workspace — re-checked and pinn
internal/store/attachments.go:145
↓ 11 callers
Method
CreateWorkspace
(input models.WorkspaceCreate)
internal/cli/client.go:125
↓ 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
Function
DetectWorkspace
DetectWorkspace walks up the directory tree from cwd looking for .pad.toml.
internal/cli/workspace.go:53
↓ 11 callers
Function
EnvToken
EnvToken returns the value of the PAD_TOKEN environment variable, trimmed of surrounding whitespace. When non-empty, it overrides any credential store
internal/cli/env_token.go:31
↓ 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
GetParentForItem
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:3735
↓ 11 callers
Method
GetUserWorkspaces
(userID string)
internal/mcp/dispatch_http_lister.go:51
↓ 11 callers
Function
ListSessions
ListSessions reads every registry record and returns them with a liveness verdict each, newest first. A malformed file is returned as a Malformed reco
internal/cli/session_registry.go:209
↓ 11 callers
Method
LoadYjsUpdatesSince
(itemID string, sinceID int64)
internal/collab/room.go:233
↓ 11 callers
Function
LookupMIME
LookupMIME returns the entry for a MIME type if it is on the allowlist, or (zero, false) if rejected.
internal/attachments/mime.go:138
↓ 11 callers
Function
NewFSStore
NewFSStore returns a store rooted at baseDir, creating the directory if it does not exist. baseDir is typically <DataDir>/attachments.
internal/attachments/fs_store.go:42
↓ 11 callers
Function
NewFetcher
NewFetcher returns a Fetcher with production defaults applied.
internal/urlimport/fetch.go:92
↓ 11 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
↓ 11 callers
Function
SessionArmedLocally
SessionArmedLocally reports whether this session has a live explicit ARM (LocalArmOn). Retained for callers that only ask the ON question; the full tr
internal/cli/session_arm_state.go:452
↓ 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:1198
↓ 11 callers
Method
SoftDeleteAttachment
SoftDeleteAttachment marks the given attachment row deleted (and every variant whose parent_id points at it) so the orphan GC will reclaim the bytes a
internal/store/attachments.go:1310
↓ 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
SubscribeIfAllowed
SubscribeIfAllowed atomically checks the per-workspace limit and subscribes. See the EventBus interface for why there is no global limit here (BUG-272
internal/events/redis_bus.go:913
↓ 11 callers
Method
WorkspaceSubscriberCount
WorkspaceSubscriberCount returns the number of active subscribers for a specific workspace.
internal/events/bus.go:283
↓ 11 callers
Function
bindableText
bindableText reports whether a decoded string can be bound into a text comparison. It is the shared predicate of both middlewares in this file: Valida
internal/server/middleware_request_text.go:198
↓ 11 callers
Method
callCopy
Tests for the mutating cross-workspace copy (PLAN-2357 / TASK-2365). The fixture is the PREFLIGHT's, deliberately and not for convenience: the headli
internal/server/handlers_items_copy_test.go:50
↓ 11 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:2436
↓ 11 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
↓ 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:970
↓ 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
Function
createBulkTestItem
createBulkTestItem creates a task and returns it.
internal/server/handlers_items_bulk_test.go:17
↓ 11 callers
Function
createItemIn
(t *testing.T, srv *Server, wsSlug, collSlug, title string)
internal/server/collection_resolve_test.go:35
↓ 11 callers
Function
decodeAttributionBody
(t *testing.T, rr *httptest.ResponseRecorder, out any)
internal/server/handlers_items_attribution_test.go:127
↓ 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:519
↓ 11 callers
Method
dispatch
(t *testing.T, cmd []string, input map[string]any)
internal/mcp/dispatch_http_clear_parent_test.go:100
↓ 11 callers
Function
doArtifactRequest
doArtifactRequest posts a raw (non-JSON) body to an artifact-import endpoint.
internal/server/handlers_artifact_test.go:17
↓ 11 callers
Function
equalStrings
(a, b []string)
internal/mcp/catalog_test.go:345
↓ 11 callers
Function
makeCollection
makeCollection creates a collection via the API so it goes through the same slug/prefix machinery production does.
internal/server/collection_resolve_test.go:26
↓ 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
mapItemList
(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:1185
↓ 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:941
↓ 11 callers
Function
release
()
web/src/lib/a11y/viewerBackdrop.ts:233
↓ 11 callers
Function
stampAttachmentRefsTx
stampAttachmentRefsTx bumps attachments.last_referenced_at for every `pad-attachment:<id>` reference found in the given texts, inside the caller's tra
internal/store/attachments.go:805
↓ 11 callers
Function
waitForEvent
waitForEvent reads from the event channel with a timeout.
internal/server/handlers_events_test.go:76
↓ 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
CreateCollection
(wsSlug string, input models.CollectionCreate)
internal/cli/client.go:194
↓ 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
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:596
↓ 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:268
↓ 10 callers
Function
ExtractItemImplementationNotes
(fieldsJSON string)
internal/models/item.go:512
↓ 10 callers
Method
GetWorkspaceByID
(id string)
internal/store/workspaces.go:158
↓ 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
← previous
next →
401–500 of 9,998, ranked by callers