MCPcopy Create free account

hub / github.com/PerpetualSoftware/pad / functions

Functions31,685 in github.com/PerpetualSoftware/pad

↓ 23 callersMethodLoadYjsUpdatesSince
(itemID string, sinceID int64)
internal/collab/room.go:317
↓ 23 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:68
↓ 23 callersFunctionNewRegistry
NewRegistry returns an empty registry.
internal/attachments/registry.go:26
↓ 23 callersMethodRedactItem
RedactItem plans, rewrites and verifies the complete logical population in one transaction. The workspace scan and physical cleanup run after it ends.
internal/store/redact.go:126
↓ 23 callersMethodSetDecisionSetResolver
SetDecisionSetResolver installs the resolver, or removes it with nil. Atomic, unlike the test seams on Store, because this is production wiring: ever
internal/store/decisions.go:48
↓ 23 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:22
↓ 23 callersMethodUpdateScheduleLink
UpdateScheduleLink changes a link's offset or cancel policy. It needs edit on both ends, rechecks the limits and cycle rule, and, like a new link, mov
internal/store/commitment_links.go:728
↓ 23 callersMethodValidateToken
ValidateToken hashes the provided plaintext token, looks it up in the database, checks expiry, and updates last_used_at. Returns nil if the token is i
internal/store/api_tokens.go:319
↓ 23 callersFunctionactorNameFromRequest
actorNameFromRequest returns the authenticated user's display name, or empty string.
internal/server/handlers_documents.go:342
↓ 23 callersFunctionapplyPostgresMigration
applyPostgresMigration applies a single Postgres migration file atomically. IDEA-1485: even though Postgres wraps each DDL statement in an implicit t
internal/store/store.go:1471
↓ 23 callersMethodcomment
comment adds a comment by u (nil: no user) with createdBy, stamped at `at` so same-second cases are exact rather than timing-dependent.
internal/store/needs_snooze_test.go:47
↓ 23 callersFunctionconnectedAppsTestServer
Connected-apps handler tests (PLAN-943 TASK-954). What's covered: - GET /api/v1/connected-apps requires cloud mode (404 outside). - List returns onl
internal/server/handlers_connected_apps_test.go:50
↓ 23 callersFunctioncontextWithResolvedWorkspaceIDForTest
(ctx context.Context, wsID string)
internal/server/authz_cross_workspace_test.go:23
↓ 23 callersFunctiondoArtifactRequest
doArtifactRequest posts a raw (non-JSON) body to an artifact-import endpoint.
internal/server/handlers_artifact_test.go:17
↓ 23 callersMethodgetAsset
getAsset issues GET on the asset endpoint. rawQuery is appended verbatim (already URL-formed, no leading '?').
internal/server/handlers_share_attachments_test.go:214
↓ 23 callersMethoditemByTitle
(t *testing.T, wsID, title string)
internal/store/schedule_carry_test.go:50
↓ 23 callersMethodmember
(email, username, wsRole string, ws *models.Workspace)
internal/server/authz_cross_workspace_test.go:123
↓ 23 callersFunctionmount
()
web/src/routes/(console)/agenda/agenda.svelte.test.ts:34
↓ 23 callersFunctionnewCapFixture
newCapFixture builds a store the way an existing install has it — migrated, users present, a workspace, PATs, and NO mcp_enabled row — then a server o
cmd/pad/mcp_capability_test.go:96
↓ 23 callersFunctionnewLinkBundleFix
newLinkBundleFix is four commitments titled P, C1, C2 and D, so a restored workspace can be read by name.
internal/store/schedule_link_carry_test.go:26
↓ 23 callersFunctionrawJSONRequest
rawJSONRequest sends a RAW body string. A test cannot marshal a Go map here: marshalling would escape the backslash and send the literal text instead
internal/server/decode_json_nul_test.go:26
↓ 23 callersMethodreminder
(t *testing.T, id string)
internal/store/schedule_fire_test.go:42
↓ 23 callersFunctionresolve
()
web/src/lib/components/items/ItemAppActions.svelte.test.ts:57
↓ 23 callersFunctionrunScript
(t *testing.T, e stubEnv, built, installed, commit string)
internal/buildtools/install_refresh_test.go:262
↓ 23 callersFunctionrunner
(t *testing.T)
internal/materialize/materialize_test.go:29
↓ 23 callersFunctionstr
(p *string)
internal/store/commitment_c1_test.go:73
↓ 22 callersFunctionCoerceFields
CoerceFields converts STRING field values to the type the collection schema declares, so every write door stores the same native type for the same inp
internal/items/coerce.go:46
↓ 22 callersFunctionCrossWorkspaceCollectionScope
CrossWorkspaceCollectionScope scopes the check to one collection — creating into it, or disclosing its schema. Visibility here is FULL-collection-acc
internal/server/authz_cross_workspace.go:358
↓ 22 callersMethodGetOAuthClient
GetOAuthClient looks up a registered client by ID. Returns ErrOAuthNotFound if no row matches.
internal/store/oauth.go:147
↓ 22 callersFunctionNewSession
NewSession constructs a Session with the given subject (pad user ID). Returns a non-nil DefaultSession so the embedded methods don't panic on a zero-v
internal/oauth/session.go:49
↓ 22 callersMethodPublish
Publish broadcasts an event to every subscriber whose itemID matches event.ItemID. Non-blocking: a full subscriber channel drops the event with a warn
internal/collab/bus.go:127
↓ 22 callersMethodPut
Put writes the blob from r into the backend, addressable by hash. The implementation MUST verify that the bytes streamed from r hash to the supplied h
internal/attachments/store.go:41
↓ 22 callersFunctionResolveAnnouncedArmed
ResolveAnnouncedArmed is the full S3 resolution of what a stream this session opens should announce for ?armed (PLAN-2613 S3): a live explicit local o
internal/cli/session_arm_state.go:566
↓ 22 callersMethodSetForecast
SetForecast stores the schedule's forecast, replacing the current one, and appends a history event. It touches no role, override or reminder row, so a
internal/store/milestone.go:75
↓ 22 callersMethodSetUserRole
SetUserRole updates a user's role (admin or member). When demoting an admin to member, the update is conditional: it only proceeds if at least one oth
internal/store/users.go:1435
↓ 22 callersMethodbuildAuthedRequest
( ctx context.Context, method, urlPath string, body []byte, user *models.User, )
internal/mcp/dispatch_http.go:656
↓ 22 callersMethodcalOK
(t *testing.T, u *models.User, coll, query string)
internal/server/handlers_calendar_test.go:34
↓ 22 callersFunctioncopyInput
(in map[string]any)
internal/mcp/task4105_schedule_test.go:115
↓ 22 callersFunctioncreateUnverifiedUser
createUnverifiedUser makes a user whose email starts UNVERIFIED, so a consume can be observed flipping it verified. CreateUser's safe default is verif
internal/store/email_verification_test.go:16
↓ 22 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
↓ 22 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:507
↓ 22 callersFunctionmcpAndOAuthEnabledTestServer
===================================================================== mcp ↔ OAuth integration (sub-PR E, TASK-1027) ==================================
internal/server/handlers_mcp_test.go:505
↓ 22 callersMethodredeemNow
(t *testing.T)
internal/server/handlers_apps_delivery_test.go:57
↓ 22 callersMethodreq
()
internal/store/items_cross_workspace_copy_test.go:48
↓ 22 callersFunctionrequireRole
requireRole checks if the user's workspace role meets the minimum required level. Role hierarchy: owner > editor > viewer.
internal/server/middleware_auth.go:970
↓ 22 callersMethodscheduleRolesOf
scheduleRolesOf is the roles a schedule reads as: the columns of a native row, legacyRoles of a legacy_backfill row.
internal/store/commitment.go:86
↓ 22 callersFunctionscript
(cmd string)
internal/materialize/supervisor_test.go:381
↓ 22 callersFunctiontabsWorkspace
(t *testing.T, s *Store, owner *models.User, name string)
internal/store/workspace_tabs_test.go:26
↓ 22 callersFunctiontask3399Fixture
task3399Fixture is an install whose manifest offers delegated access (offered), with a human member who can sign in through it.
internal/store/task3399_delegated_barrier_test.go:21
↓ 22 callersFunctionu1RelationSchema
Referent validation for relation values (PLAN-2857 U1 / TASK-2878). These are the STORE-level rules — does the value name a live item in the declared
internal/store/relation_referents_test.go:21
↓ 22 callersFunctionupdateCmd
--- update ---
cmd/pad/cmd_item.go:1269
↓ 21 callersMethodBeginInstallTeardown
BeginInstallTeardown is phase 1. It is a no-op when the install is already in the phase-1 state for this kind (a resumed call): the epoch was bumped a
internal/store/app_lifecycle.go:105
↓ 21 callersMethodClaimItemLease
ClaimItemLease atomically acquires (or, for the live holder, refreshes) the execution lease on an item. It succeeds iff no live lease exists or the ca
internal/store/item_lease.go:62
↓ 21 callersFunctionCollectionTracksWorkJSON
CollectionTracksWorkJSON is CollectionTracksWork over the stored settings JSON. Unparseable settings count as work (today's behaviour).
internal/models/tracks_work.go:29
↓ 21 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:244
↓ 21 callersMethodRunOnce
RunOnce evaluates up to limit owed jobs, CLAIMING ONE AT A TIME, and returns how many it claimed. One at a time so that each job's lease starts when
internal/decision/runner.go:1017
↓ 21 callersMethodaccess
(editable ...int)
internal/store/commitment_links_test.go:43
↓ 21 callersMethodappendRows
(t *testing.T, itemID string, rows ...[]byte)
internal/server/materialize_recovery_test.go:131
↓ 21 callersFunctionargsContainPair
(args []string, flag, value string)
internal/mcp/catalog_item_fields_test.go:73
↓ 21 callersMethodbearerHeaders
()
internal/server/handlers_items_test.go:2625
↓ 21 callersFunctionbuildSyntheticTree
buildSyntheticTree returns a small cobra tree exercising the shapes the emitter has to handle: subgroups, leaf commands with positional args, flags of
internal/cmdhelp/json_test.go:26
↓ 21 callersFunctionbundleObject
(t *testing.T, v any)
internal/store/commitment_bundle_v2_test.go:14
↓ 21 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:389
↓ 21 callersMethodclock
clock installs a fake dispatcher clock reading at.
internal/server/task3939b_push_fixture_test.go:252
↓ 21 callersMethodcopyOK
copyOK issues the copy as the owner and requires a 201.
internal/server/handlers_items_copy_test.go:94
↓ 21 callersFunctioncountRows
BUG-3349 (b, c): disabling an account ends every credential it holds, and a disabled account is refused everywhere but sign-out and the session check.
internal/server/bug3349_disable_test.go:19
↓ 21 callersFunctioncsrfCookieName
csrfCookieName returns the CSRF cookie name. Uses the same __Host- prefix strategy as the session cookie.
internal/server/handlers_auth.go:60
↓ 21 callersMethodcurrent
(t *testing.T)
internal/server/plan3578_patch_test.go:33
↓ 21 callersMethodcycleIdleSubscriptions
cycleIdleSubscriptions ends coverage for every workspace whose subscription has received nothing for idleTimeout, and REPLACES that subscription. DRO
internal/events/redis_heartbeat.go:463
↓ 21 callersFunctiondecodeEnvelope
decodeEnvelope helper extracts the ErrorEnvelope from an MCP error result. Uses textOf (the shared helper in catalog_test.go) to retrieve the JSON bod
internal/mcp/errors_test.go:309
↓ 21 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:418
↓ 21 callersMethodlogAuditEventForUser
logAuditEventForUser logs an audit event with an explicit user ID. Use this when the user isn't (yet) in the request context, e.g. after a successful
internal/server/handlers_documents.go:476
↓ 21 callersFunctionmeAgendaFacts
(t *testing.T, w *agendaWorld, coll, title string)
internal/server/handlers_me_agenda_test.go:63
↓ 21 callersFunctionmount
(extra: Extension[] = [])
web/src/lib/components/editor/codeBlockCopy.svelte.test.ts:77
↓ 21 callersFunctionnewAgentClaimFixture
(t *testing.T)
internal/server/handlers_agent_claim_test.go:27
↓ 21 callersFunctionnewHeartbeatBus
(t *testing.T, publishHeartbeat bool)
internal/watchevents/heartbeat_test.go:37
↓ 21 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:940
↓ 21 callersFunctionnewPatchFixture
(t *testing.T, srv *Server, body string)
internal/server/plan3578_patch_test.go:22
↓ 21 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:23
↓ 21 callersFunctionpl4745Read
(t *testing.T, rr *httptest.ResponseRecorder)
internal/server/task4745_pending_link_test.go:144
↓ 21 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
↓ 21 callersMethodserveCapped
serveCapped runs d.Handler.ServeHTTP into a response writer bounded at d.responseMaxBytes() and returns an *http.Response over the retained bytes alon
internal/mcp/response_cap.go:43
↓ 21 callersFunctionsetupRBACEnv
(t *testing.T)
internal/server/handlers_rbac_test.go:24
↓ 21 callersFunctiontask3408Fixture
task3408Fixture: an active install with one companion collection and a released hook subscribed to item.created on it.
internal/store/task3408_delivery_test.go:26
↓ 21 callersMethodupdateScheduleAt
(workspaceID, itemID string, upd models.ScheduleUpdate, nowT time.Time)
internal/store/schedules.go:756
↓ 21 callersFunctionwatchNotificationVisible
watchNotificationVisible decides whether a Notification should be delivered to a caller holding the given watch map. Extracted from the handler so the
internal/server/handlers_watch_events.go:792
↓ 21 callersFunctionwriteRootStructuredError
writeRootStructuredError adds the machine-readable marker line for the refusals ANY command can receive, which no per-command writer can own (BUG-3147
cmd/pad/main.go:83
↓ 20 callersFunctionApplyPatch
ApplyPatch applies a patch to baseText to produce the target text. Returns an error if the patch cannot be applied cleanly, or if the base or the patc
internal/diff/diff.go:39
↓ 20 callersMethodGetCLIAuthSession
GetCLIAuthSession retrieves a CLI auth session by code. Returns nil if not found. Expired sessions are returned with status updated to "expired".
internal/store/cli_auth_sessions.go:141
↓ 20 callersMethodGetDocument
(id string)
internal/store/documents.go:222
↓ 20 callersMethodMigrateRelationReferents
MigrateRelationReferents is the ONE decision the four migrate doors share (PLAN-2857 U1 / TASK-2878). Same-workspace move, bulk move, cross-workspace
internal/store/relation_referents.go:1229
↓ 20 callersFunctionNewRunner
NewRunner returns a runner, or nil when provider is nil — the configured-off case. Every method is nil-safe, so the server holds a *Runner and never b
internal/decision/runner.go:401
↓ 20 callersFunctionRedactText
RedactText masks credentials in free text: an error message, a response body, a log message. It recognises the shapes a credential takes in text (an A
internal/logging/scrub.go:81
↓ 20 callersMethodRemapAttachmentReferencesInWorkspace
RemapAttachmentReferencesInWorkspace rewrites every "pad-attachment:OLD" reference in items.content + items.fields, in comment bodies (BUG-2615) AND i
internal/store/attachments_remap.go:175
↓ 20 callersMethodResolveRelationReferents
ResolveRelationReferents canonicalises every `relation` value in fieldMap to the target item's ID and reports the ones that cannot be resolved. It MU
internal/store/relation_referents.go:207
↓ 20 callersMethodServeHTTP
(w http.ResponseWriter, r *http.Request)
cmd/pad/cmd_needs_test.go:32
↓ 20 callersMethodSetMCPTransport
MCP transport state. Set at startup by cmd/pad via SetMCPTransport on every install (PLAN-2310 DR-4); whether a request may reach it is decided per re
internal/server/handlers_mcp.go:65
↓ 20 callersMethodallow
allow charges one token from key's bucket and reports whether the request may proceed. The lookup and the charge happen under one lock hold: a caller
internal/server/middleware_ratelimit.go:137
↓ 20 callersFunctionappendFrame
(t *testing.T, s *store.Store, itemID string, frame []byte)
internal/store/bug3124_content_bearing_test.go:60
↓ 20 callersFunctionarmViaAPI
(t *testing.T, srv *Server, wsSlug string, item models.Item, at string)
internal/server/handlers_reminders_test.go:22
← previousnext →701–800 of 31,685, ranked by callers