MCPcopy Create free account

hub / github.com/PerpetualSoftware/pad / functions

Functions9,998 in github.com/PerpetualSoftware/pad

↓ 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 callersMethodseedImage
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 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 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:55
↓ 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 callersMethodGetMemberCollectionAccess
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 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 callersFunctionRegisterSession
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 callersMethodSearch
(params SearchParams)
internal/store/search.go:89
↓ 12 callersMethodSubscribe
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 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 callersMethodUpdateCollection
(id string, input models.CollectionUpdate)
internal/store/collections.go:391
↓ 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:245
↓ 12 callersMethodVisibleCollectionIDs
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 callersFunctionWithCollectionAliasFallback
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 callersFunctionacquire
(exemptRoot: HTMLElement)
web/src/lib/a11y/viewerBackdrop.ts:217
↓ 12 callersFunctionbodyDecodesNUL
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 callersFunctionbootstrapBody
(email string)
internal/server/handlers_auth_bootstrap_token_test.go:45
↓ 12 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:327
↓ 12 callersMethodchannelFor
(workspaceID string)
internal/events/redis_heartbeat_test.go:76
↓ 12 callersFunctionchildLinkTypeSQL
childLinkTypeSQL returns a SQL IN clause fragment like "'parent','implements'" for filtering item_links by child relationship types.
internal/store/items.go:24
↓ 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 callersFunctiondispatchPadItem
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 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 callersMethodemitItemEventTx
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 callersMethodgetItemTx
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 callersFunctionkindsOf
(entries []models.TimelineEntry)
internal/server/handlers_timeline_structured_test.go:64
↓ 12 callersMethodliveGen
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 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
↓ 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 callersFunctionnewConsentEnv
(t *testing.T, mayCreate bool)
internal/server/handlers_workspace_create_consent_test.go:67
↓ 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 callersFunctionputBlob
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 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
↓ 12 callersFunctionwedge
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 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 callersMethodCreateAttachmentForLiveItem
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 callersMethodCreateWorkspace
(input models.WorkspaceCreate)
internal/cli/client.go:125
↓ 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 callersFunctionDetectWorkspace
DetectWorkspace walks up the directory tree from cwd looking for .pad.toml.
internal/cli/workspace.go:53
↓ 11 callersFunctionEnvToken
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 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:3735
↓ 11 callersMethodGetUserWorkspaces
(userID string)
internal/mcp/dispatch_http_lister.go:51
↓ 11 callersFunctionListSessions
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 callersMethodLoadYjsUpdatesSince
(itemID string, sinceID int64)
internal/collab/room.go:233
↓ 11 callersFunctionLookupMIME
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 callersFunctionNewFSStore
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 callersFunctionNewFetcher
NewFetcher returns a Fetcher with production defaults applied.
internal/urlimport/fetch.go:92
↓ 11 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
↓ 11 callersFunctionSessionArmedLocally
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 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:1198
↓ 11 callersMethodSoftDeleteAttachment
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 callersMethodStarItem
StarItem stars an item for a user. Idempotent — re-starring is a no-op.
internal/store/item_stars.go:13
↓ 11 callersMethodSubscribeIfAllowed
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 callersMethodWorkspaceSubscriberCount
WorkspaceSubscriberCount returns the number of active subscribers for a specific workspace.
internal/events/bus.go:283
↓ 11 callersFunctionbindableText
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 callersMethodcallCopy
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 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:2436
↓ 11 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
↓ 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:970
↓ 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 callersFunctioncreateBulkTestItem
createBulkTestItem creates a task and returns it.
internal/server/handlers_items_bulk_test.go:17
↓ 11 callersFunctioncreateItemIn
(t *testing.T, srv *Server, wsSlug, collSlug, title string)
internal/server/collection_resolve_test.go:35
↓ 11 callersFunctiondecodeAttributionBody
(t *testing.T, rr *httptest.ResponseRecorder, out any)
internal/server/handlers_items_attribution_test.go:127
↓ 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:519
↓ 11 callersMethoddispatch
(t *testing.T, cmd []string, input map[string]any)
internal/mcp/dispatch_http_clear_parent_test.go:100
↓ 11 callersFunctiondoArtifactRequest
doArtifactRequest posts a raw (non-JSON) body to an artifact-import endpoint.
internal/server/handlers_artifact_test.go:17
↓ 11 callersFunctionequalStrings
(a, b []string)
internal/mcp/catalog_test.go:345
↓ 11 callersFunctionmakeCollection
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 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:1185
↓ 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:941
↓ 11 callersFunctionrelease
()
web/src/lib/a11y/viewerBackdrop.ts:233
↓ 11 callersFunctionstampAttachmentRefsTx
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 callersFunctionwaitForEvent
waitForEvent reads from the event channel with a timeout.
internal/server/handlers_events_test.go:76
↓ 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 callersMethodCreateCollection
(wsSlug string, input models.CollectionCreate)
internal/cli/client.go:194
↓ 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 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:596
↓ 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:268
↓ 10 callersFunctionExtractItemImplementationNotes
(fieldsJSON string)
internal/models/item.go:512
↓ 10 callersMethodGetWorkspaceByID
(id string)
internal/store/workspaces.go:158
↓ 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
← previousnext →401–500 of 9,998, ranked by callers