MCPcopy Create free account

hub / github.com/PerpetualSoftware/pad / functions

Functions11,926 in github.com/PerpetualSoftware/pad

↓ 58 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:216
↓ 58 callersFunctiondoRequestWithHeaders
doRequestWithHeaders is a thin variant of doRequest that lets a test set arbitrary request headers (e.g. Authorization) without spinning up a real aut
internal/server/handlers_items_test.go:19
↓ 57 callersMethodWriteHeader
(_ int)
internal/server/handlers_events_test.go:486
↓ 57 callersFunctionrealPNG
realPNG returns a tiny but real PNG (1x1 transparent) so image.DecodeConfig succeeds.
internal/server/handlers_attachments_test.go:68
↓ 57 callersMethodset
(workspaceID string, info *store.WorkspaceStorageInfo)
internal/server/handlers_storage.go:77
↓ 56 callersMethodDeleteItem
DeleteItem soft-deletes the item by stamping deleted_at and bumping the workspace-scoped seq so delta-sync clients see the tombstone. The seq bump use
internal/store/items.go:3028
↓ 56 callersMethodrequest
* Open the confirmation and resolve when the user answers — the descriptor's * `ctx.confirmDelete`. A no-op that resolves false when the caller may
web/src/lib/attachments/surfaceDeleteConfirm.svelte.ts:54
↓ 56 callersFunctiontextOf
textOf returns the text of the first content block, or empty string. Robust to mcp-go's content-type variations (TextContent, ErrorContent).
internal/mcp/catalog_test.go:335
↓ 55 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
internal/events/bus.go:273
↓ 55 callersMethodPublish
Publish sends an event to all subscribers for the event's workspace.
internal/events/bus.go:260
↓ 53 callersFunctionNewWorkspaceState
NewWorkspaceState returns a state pre-seeded with `initial`. Pass an empty string to start with no default — the first tool call will then need an exp
internal/mcp/workspace.go:57
↓ 53 callersMethodUnsubscribe
Unsubscribe removes a subscriber and closes its channel.
internal/watchevents/watchevents.go:272
↓ 52 callersFunctioncreateTestDoc
(t *testing.T, s *Store, workspaceID, title, content string)
internal/store/store_test.go:386
↓ 52 callersFunctionmustUser
(t *testing.T, srv *Server, email, username, role string)
internal/server/authz_cross_workspace_test.go:76
↓ 52 callersFunctionrequireMinRole
requireMinRole checks role and writes a 403 if insufficient. Returns true if the request should continue, false if it was rejected.
internal/server/middleware_auth.go:818
↓ 51 callersFunctionmustSchemaCollection
(t *testing.T, srv *Server, wsID, name, schema string)
internal/server/handlers_items_copy_preflight_test.go:113
↓ 50 callersFunctionnewCollabTestServer
newCollabTestServer wires up an httptest server whose only handler upgrades the inbound WS, registers it with the manager, and waits for the session t
internal/collab/manager_test.go:260
↓ 49 callersMethodCreateItemGrant
--- Item Grants --- CreateItemGrant creates a direct grant on an item for a user.
internal/store/grants.go:101
↓ 49 callersMethodGetBacklinks
GetBacklinks returns the items in `workspaceID` that contain a resolved `[[...]]` reference to `targetItemID`. Phase 1 only returns ref-kind backlinks
internal/store/wiki_links.go:1043
↓ 49 callersFunctionNew
New creates a new Metrics instance with a custom registry and registers all application metrics plus Go runtime and process collectors.
internal/metrics/metrics.go:409
↓ 49 callersFunctiongetDashboard
helper: fetch the dashboard and return the parsed response
internal/server/handlers_dashboard_test.go:25
↓ 48 callersFunctionoauthEnabledTestServer
oauthEnabledTestServer builds a Server with cloud mode + a real internal/oauth.Server backed by the test store. Returns the Server so each test can dr
internal/server/handlers_oauth_test.go:54
↓ 48 callersFunctionregisterTestClient
===================================================================== Helpers ===================================================================== re
internal/server/handlers_oauth_test.go:2426
↓ 48 callersFunctionrender
()
web/src/lib/components/timeline/ItemTimeline.svelte.test.ts:228
↓ 47 callersMethodString
()
internal/cli/pidfile.go:117
↓ 47 callersFunctiondoMultipartUpload
(srv *Server, slug, filename string, body []byte)
internal/server/handlers_attachments_test.go:52
↓ 46 callersMethodClose
Close stops every active room AND blocks until every in-flight Join goroutine has returned. After Close, Join is undefined — callers must coordinate s
internal/collab/manager.go:1338
↓ 46 callersMethodGetCollectionBySlug
(workspaceID, slug string)
internal/store/collections.go:293
↓ 46 callersFunctiontestServerWithWatchEvents
(t *testing.T)
internal/server/handlers_watch_events_test.go:18
↓ 46 callersMethodvisibleCollectionIDs
visibleCollectionIDs returns the set of collection IDs the current user can see in the given workspace. Returns nil if the user has "all" access (no f
internal/server/server.go:2745
↓ 45 callersMethodcall
call drives one handler with the route params it reads, exactly as the router would. Shared by every leg so a difference in invocation cannot be mista
internal/server/relation_referents_doors_test.go:110
↓ 45 callersFunctionclearOutbox
(t *testing.T, s *Store)
internal/store/event_outbox_test.go:76
↓ 45 callersFunctioncreateTestWorkspaceViaAPI
(t *testing.T, srv *Server)
internal/server/handlers_items_attribution_test.go:134
↓ 45 callersFunctiontick
()
web/src/lib/components/editor/block-drag-handle.ts:709
↓ 43 callersMethodDecode
Decode reads bytes from r and returns the decoded image plus the detected format ("png", "jpeg", "gif", "bmp", "tiff", …). The returned format is the
internal/attachments/processor.go:35
↓ 43 callersMethodIsZero
IsZero reports whether the collection declares no kernel traits at all.
internal/models/collection_traits.go:128
↓ 42 callersMethodGetUserByEmail
GetUserByEmail retrieves a user by email address (case-insensitive).
internal/store/users.go:138
↓ 42 callersFunctionbearerJSON
bearerJSON marshals body and issues a Bearer-authenticated request. Needed for any mutation issued AFTER a real user has been created in the test's st
internal/server/handlers_watches_test.go:53
↓ 42 callersFunctioncurrentUserID
currentUserID returns the authenticated user's ID, or empty string.
internal/server/middleware_auth.go:576
↓ 42 callersFunctiontestServerWithEvents
(t *testing.T)
internal/server/handlers_events_test.go:20
↓ 41 callersMethodCreateAttachment
CreateAttachment inserts an attachment row. id and created_at are generated by the store. The caller is expected to have already written the blob via
internal/store/attachments.go:78
↓ 41 callersMethodrequireItemVisible
requireItemVisible checks that the item's collection is visible to the requesting user. For guests with item-level grants, also verifies that the spec
internal/server/server.go:2799
↓ 40 callersMethodListCollections
(workspaceID string)
internal/store/collections.go:372
↓ 40 callersMethodUpdateCollection
(id string, input models.CollectionUpdate)
internal/store/collections.go:440
↓ 40 callersMethodWrite
(p []byte)
internal/server/token_reaper_test.go:21
↓ 40 callersFunctionnewDoorFixture
(t *testing.T)
internal/server/relation_referents_doors_test.go:68
↓ 39 callersMethodreq
req builds a request from A to B with the standard actor.
internal/store/attachments_copy_plan_test.go:85
↓ 38 callersFunctionNew
New creates a Store backed by SQLite at the given path. The DSN is configured for safe concurrent use under Go's connection pool: - `_pragma=busy_ti
internal/store/store.go:324
↓ 38 callersMethodRead
(p []byte)
internal/cli/client_items_copy.go:499
↓ 38 callersMethodRebind
Rebind converts a query with "?" placeholders to the dialect's format. For SQLite this is a no-op. For PostgreSQL, "?" becomes "$1", "$2", etc.
internal/store/dialect.go:28
↓ 38 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
↓ 38 callersFunctionrunItemCopy
runItemCopy is the whole command, minus flag binding. Order of operations is load-bearing: 1. Build the request (the SAME body both endpoints take).
cmd/pad/cmd_item.go:1899
↓ 38 callersFunctiontestServerWithCollab
testServerWithCollab wires a RoomManager onto a fresh test server so the collab handler answers 200/101 on the happy path. Tests that only assert on a
internal/server/handlers_collab_test.go:21
↓ 37 callersMethodSetObserver
SetObserver attaches an Observer. Passing nil detaches. Safe to call after the bus is running; cmd/pad/cmd_server.go calls it at wiring time.
internal/events/observer.go:284
↓ 37 callersFunctionbaseOpts
()
cmd/pad/item_copy_test.go:139
↓ 37 callersMethoddeps
()
cmd/pad/item_copy_test.go:110
↓ 37 callersMethodget
(path string, result interface{})
internal/cli/client.go:1961
↓ 36 callersMethodImportWorkspace
ImportWorkspace imports a workspace from an exported data structure. It creates a new workspace with regenerated IDs, remapping all references. If new
internal/store/export.go:404
↓ 36 callersFunctionauditMeta
auditMeta safely marshals a map to a JSON string for audit log metadata. Falls back to "{}" on marshal error so audit calls never break.
internal/server/handlers_documents.go:463
↓ 36 callersFunctionnewPlanFixture
(t *testing.T)
internal/store/attachments_copy_plan_test.go:24
↓ 35 callersFunctionWithCurrentUser
Exported context-key helpers for callers that need to synthesize an authenticated request without going through the auth middleware chain (e.g. the in
internal/server/context.go:35
↓ 35 callersFunctionbrowserLogin
(page: Page)
web/e2e/lib/collab-helpers.ts:18
↓ 35 callersMethodguestResourceFilter
guestResourceFilter returns the full-collection IDs and granted item IDs for the current user if they need item-level grant filtering. Returns nil/nil
internal/server/server.go:3011
↓ 35 callersFunctionnewTransitionTestWorkspace
(t *testing.T, s *Store)
internal/store/status_transitions_test.go:48
↓ 35 callersFunctionwaitForWatchEvent
(t *testing.T, ch <-chan watchSSEEvent, timeout time.Duration)
internal/server/handlers_watch_events_test.go:113
↓ 34 callersMethodAppendYjsUpdate
(itemID string, data []byte, schemaVersion string)
internal/collab/room.go:232
↓ 34 callersMethodSet
Set adds or replaces the credential for the given server URL. The canonical URL is mirrored into the value's ServerURL field so a caller reading the c
internal/cli/credentials.go:185
↓ 34 callersFunctionisCollectionVisible
isCollectionVisible checks if a collection ID is in the visible set. If visibleIDs is nil, all collections are visible.
internal/server/server.go:3078
↓ 34 callersFunctionmount
()
web/src/lib/components/graph/ItemGraph.svelte.test.ts:151
↓ 33 callersFunctionBuild
Build returns a cmdhelp Document without serializing it. Callers that need to inspect or further mutate the document (tests, dynamic enum resolvers in
internal/cmdhelp/json.go:83
↓ 33 callersMethodEventsSince
EventsSince returns buffered notifications with ID > sinceID, for Last-Event-ID resume. Returns nil if sinceID has been evicted from the buffer (gap t
internal/watchevents/watchevents.go:280
↓ 33 callersMethodExportWorkspace
ExportWorkspace exports all data for a workspace into a portable format. It reads the POOL, so each of its sections takes its own snapshot and a conc
internal/store/export.go:134
↓ 33 callersMethodGetCollection
(id string)
internal/store/collections.go:226
↓ 33 callersFunctiondialWS
(t *testing.T, server *httptest.Server, itemID string)
internal/collab/manager_test.go:296
↓ 33 callersMethodplan
(t *testing.T, req AttachmentCopyRequest)
internal/store/attachments_copy_plan_test.go:96
↓ 33 callersFunctions256Challenge
s256Challenge computes the base64url(no-padding, SHA256(verifier)) per RFC 7636 §4.2. PKCE clients use this to derive code_challenge from code_verifie
internal/server/handlers_oauth_test.go:2548
↓ 32 callersMethodGetAttachment
GetAttachment returns the attachment with the given id, or (nil, nil) if no such row exists. Soft-deleted rows ARE returned (so download handlers can
internal/store/attachments.go:239
↓ 32 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:313
↓ 32 callersFunctionliveCmdhelpDoc
liveCmdhelpDoc returns a minimal cmdhelp.Document with every command path the read-only catalog references. Lighter than re-running pad's full cobra e
internal/mcp/catalog_readonly_test.go:438
↓ 32 callersFunctionworkspaceIDForSlug
workspaceIDForSlug looks up the internal UUID for a slug — used by tests that synthesize attachment rows directly via the store (bypassing the upload
internal/server/handlers_storage_test.go:425
↓ 31 callersMethodCreateItemLink
--- Item Links ---
internal/store/items.go:3333
↓ 31 callersFunctionItemRef
ItemRef returns the reference string (e.g. "TASK-5") for an item, or empty string.
internal/cli/format.go:95
↓ 31 callersFunctionLoad
()
internal/config/config.go:313
↓ 31 callersMethodOpen
(name string)
internal/store/nulguard.go:316
↓ 31 callersMethodSeedCollectionsFromTemplate
SeedCollectionsFromTemplate seeds the workspace with collections from the named template. An empty template name materializes the default collections
internal/store/collections.go:1033
↓ 31 callersMethodUpdateDocument
(id string, input models.DocumentUpdate)
internal/store/documents.go:271
↓ 31 callersFunctioncaptureStdout
captureStdout runs fn with os.Stdout redirected and returns what it wrote. The list commands print through fmt/os.Stdout rather than cmd.OutOrStdout,
cmd/pad/format_markdown_routing_test.go:48
↓ 31 callersFunctionnewRestrictedOwnerVisibilityFixture
(t *testing.T)
internal/server/handlers_grant_visibility_test.go:33
↓ 31 callersFunctionreadCSRFFromCookie
readCSRFFromCookie hits any consent-rendering endpoint that sets the CSRF cookie on first visit, returns the token. We use oauth/authorize because it'
internal/server/handlers_oauth_test.go:2515
↓ 31 callersFunctionrefOf
refOf builds a PREFIX-NUMBER string from a fresh item — used by the integration tests since the canonical ref isn't on the model directly. ItemNumber
internal/store/wiki_links_test.go:556
↓ 31 callersMethodresolvableBody
resolvableBody is a request the copy can actually satisfy: the two needs_value entries the base fixture leaves open are supplied, so the preflight com
internal/server/handlers_items_copy_test.go:111
↓ 31 callersMethodsnapshot
()
internal/watchevents/observer_test.go:96
↓ 31 callersFunctiontimelineItemWithStructured
BUG-2301: `pad item note` / `pad item decide` wrote structured entries that no web surface rendered — the renderer shipped in c61f4cda and was deleted
internal/server/handlers_timeline_structured_test.go:24
↓ 30 callersFunctionNew
New creates a MemoryBus with the default replay buffer size.
internal/watchevents/watchevents.go:423
↓ 30 callersMethodRemove
Remove deregisters a session. It must be idempotent and must not panic on an unknown id — the stream handler calls it from a defer that also runs on p
internal/server/session_presence.go:306
↓ 30 callersFunctionimageRef
(id string)
internal/store/attachments_copy_plan_test.go:105
↓ 29 callersMethodSetParentLink
--- Phase Links --- SetParentLink sets the parent for an item. Since an item can belong to at most one parent, this deletes any existing parent link f
internal/store/items.go:3668
↓ 29 callersFunctionloginUser
(t *testing.T, srv *Server, email, password string)
internal/server/handlers_rbac_test.go:92
↓ 29 callersFunctionroot
()
web/src/lib/components/common/Lightbox.svelte.test.ts:187
↓ 28 callersMethodGetWorkspaceMember
GetWorkspaceMember retrieves a single membership record.
internal/store/workspace_members.go:111
← previousnext →101–200 of 11,926, ranked by callers