MCPcopy Create free account

hub / github.com/PerpetualSoftware/pad / functions

Functions6,005 in github.com/PerpetualSoftware/pad

↓ 2 callersMethodpublishReactionEvent
publishReactionEvent publishes a real-time event for reaction changes.
internal/server/handlers_comments.go:459
↓ 2 callersFunctionrawJSONOrNil
rawJSONOrNil returns s as json.RawMessage when it is a non-empty, non-empty- container JSON value, else nil (so the field is omitted). Guards against
internal/cli/item_summary.go:79
↓ 2 callersFunctionreadBundle
readBundle decompresses + extracts a gzipped tar bundle into a map[name]bytes. Test helper kept here so both export and (later) import tests can read
internal/server/handlers_export_bundle_test.go:283
↓ 2 callersFunctionreadChoice
()
cmd/pad/cmd_workspace.go:735
↓ 2 callersMethodreadDashboard
readDashboard handles pad://workspace/{ws}/dashboard.
internal/mcp/resources.go:336
↓ 2 callersMethodreadParentLinkTarget
readParentLinkTarget returns the target_id of an item's `parent` link, or "" when it has none. Parameterized over rowQueryer so it can read either unl
internal/store/items.go:2982
↓ 2 callersFunctionreadPassword
()
cmd/pad/cmd_auth.go:703
↓ 2 callersFunctionreadRepoFile
readRepoFile reads a file relative to the repo root. Go runs tests with the package directory as the working directory, so the repo root is two levels
internal/mcp/tool_surface_drift_test.go:132
↓ 2 callersFunctionreadResourceJSON
readResourceJSON drives a resources/read request through the server for uri and returns the text body. Fails the test on protocol errors, missing cont
internal/mcp/meta_test.go:95
↓ 2 callersFunctionreadScrollY
(target: HTMLElement | Window | null)
web/src/lib/scroll/restore.svelte.ts:71
↓ 2 callersFunctionreadStructuredEntryBody
()
cmd/pad/notes.go:156
↓ 2 callersFunctionrebindQuery
---------- Helper ---------- rebindQuery converts "?" placeholders to PostgreSQL's "$1", "$2", etc. Respects string literals (single quotes) and does
internal/store/dialect.go:328
↓ 2 callersMethodrebuildFTSForWorkspace
rebuildFTSForWorkspace rebuilds the FTS index for all items in a workspace. This is needed after import because direct INSERTs bypass the FTS triggers
internal/store/export.go:437
↓ 2 callersFunctionredactQueryString
redactQueryString replaces sensitive query-key values with REDACTED while leaving the rest of the query string intact for diagnostics. Operates on the
internal/server/middleware_logging.go:29
↓ 2 callersFunctionrefresh
()
web/src/lib/components/editor/attachment-image.ts:277
↓ 2 callersFunctionrefreshFilenameDom
()
web/src/lib/components/editor/attachment-chip.ts:273
↓ 2 callersFunctionrefreshHref
()
web/src/lib/components/editor/attachment-chip.ts:263
↓ 2 callersFunctionregistryPath
registryPath returns ~/.pad/installations.json.
internal/cli/registry.go:34
↓ 2 callersFunctionrelatedEntryFromLink
relatedEntryFromLink projects a link's source-side or target-side metadata into a relatedEntry. Mirrors cmd/pad/query.go's helper.
internal/mcp/dispatch_http_links.go:651
↓ 2 callersFunctionrelatedEntryFromLink
(link models.ItemLink, useSource bool)
cmd/pad/query.go:366
↓ 2 callersFunctionrelativeTimeStr
(t time.Time)
cmd/pad/cmd_github.go:419
↓ 2 callersMethodremoveConn
removeConn unsubscribes the connection from the bus and, if it was the last subscriber, schedules a graceTTL grace timer. The caller is responsible fo
internal/collab/room.go:196
↓ 2 callersFunctionrenderAttachmentChip
( meta: AttachmentMeta, displayText: string | undefined, workspaceSlug: string )
web/src/lib/markdown/attachments.ts:145
↓ 2 callersFunctionrenderAttachmentMissing
(uuid: string, alt: string)
web/src/lib/markdown/attachments.ts:163
↓ 2 callersFunctionreorderedList
( ordered: Item[], itemId: string, dir: ReorderDirection )
web/src/lib/collections/reorder.ts:30
↓ 2 callersMethodreportVisibleCollections
reportVisibleCollections computes the collection-visibility scope for the aggregate report. Aggregate counts have no item-level filtering, so a collec
internal/server/handlers_reports.go:78
↓ 2 callersFunctionrequireArg
(args: Record<string, unknown>, key: string)
web/src/lib/webmcp/dispatch.ts:106
↓ 2 callersFunctionrequireRef
(args: Record<string, unknown>)
web/src/lib/webmcp/dispatch.ts:100
↓ 2 callersMethodrequireShareLinkTargetVisible
requireShareLinkTargetVisible resolves a share link's target (item or collection) and gates on the appropriate visibility check (BUG-1923). Item-scope
internal/server/handlers_share_links.go:340
↓ 2 callersMethodrequireUnrestrictedExportAccess
requireUnrestrictedExportAccess denies workspace export (both the JSON and tar.gz bundle forms) to a caller whose workspace access is scoped to specif
internal/server/handlers_export_bundle.go:38
↓ 2 callersMethodrequireViewEditable
requireViewEditable is like requireViewVisible but also checks edit permission on the view's collection (grant-aware for guests/restricted members).
internal/server/handlers_views.go:144
↓ 2 callersMethodresolveBrokenTitleLinks
resolveBrokenTitleLinks flips item_wiki_links rows in the workspace that have target_kind='title' and a target_title matching the given (collSlug, tit
internal/store/wiki_links.go:731
↓ 2 callersFunctionresolveItemLink
resolveItemLink reads link_type/ref/target from input and returns the dispatch tuple for action=link (creating=true) or action=unlink (creating=false)
internal/mcp/catalog_item.go:437
↓ 2 callersFunctionresolveLinkRoute
(args: Record<string, unknown>)
web/src/lib/webmcp/dispatch.ts:311
↓ 2 callersMethodresolveParentFilter
resolveParentFilter extracts a "parent" (or "plan") key from the field filters and converts it to a ParentLinkID filter (which uses item_links instead
internal/server/handlers_items.go:2289
↓ 2 callersMethodresolvePlaybook
resolvePlaybook finds a playbook by either its invocation_slug, its item slug, or its issue ref. invocation_slug takes precedence — that's the user-fa
internal/server/handlers_playbooks.go:297
↓ 2 callersFunctionresolveSQLiteDBPath
resolveSQLiteDBPath returns the SQLite database path using the SAME precedence the server uses (PAD_DB_PATH > PAD_DATA_DIR/pad.db > ~/.pad/pad.db), vi
cmd/pad/cmd_db.go:52
↓ 2 callersFunctionresolveShareWithPassword
resolveShareWithPassword issues an anonymous GET /api/v1/s/{token} from the given source IP with the password supplied via the X-Share-Password header
internal/server/handlers_share_links_bruteforce_test.go:16
↓ 2 callersFunctionresolveWikiBody
* Resolve a same-workspace wiki-link body against the in-memory items list. * Callers handle the cross-workspace `[[ws::REF]]` form first; this cover
web/src/lib/utils/markdown.ts:491
↓ 2 callersFunctionrun
(api: ReturnType<typeof mockApi>, tool: string, args: Record<string, unknown>)
web/src/lib/webmcp/dispatch.test.ts:120
↓ 2 callersMethodrun
run is the worker goroutine. Drains queue → InsertMCPAuditEntry, logs (but doesn't crash on) DB errors, exits on stop. Tracked via Server.bg so Stop()
internal/server/middleware_mcp_audit.go:133
↓ 2 callersFunctionrunMCPStatus
(cmd *cobra.Command, inst *mcpserver.Installer)
cmd/pad/mcp.go:160
↓ 2 callersMethodrunTokenReaperTick
runTokenReaperTick runs one sweep. Each cleaner is independent — a failure in one is logged and does not skip the others. Quiet on success (operators
internal/server/token_reaper.go:97
↓ 2 callersFunctionsafeJsonParse
(raw: string | undefined | null, fallback: T)
web/src/lib/stores/localSearch.svelte.ts:262
↓ 2 callersFunctionsanitizeHeaderFilename
sanitizeHeaderFilename strips characters that can't safely appear in a Content-Disposition filename header — quotes, CR, LF, and any control byte. The
internal/server/handlers_attachments.go:516
↓ 2 callersFunctionscanAPIToken
scanAPIToken scans an API token from a row scanner.
internal/store/api_tokens.go:304
↓ 2 callersFunctionscanBool
---- helpers ---- scanBool normalizes the dialect-specific bool encoding (SQLite INTEGER 0/1; Postgres BOOLEAN true/false) into a Go bool. Mirrors the
internal/store/oauth_connections.go:581
↓ 2 callersMethodscanBucketCounts
scanBucketCounts runs a "SELECT <bucket>, COUNT(*) ... GROUP BY <bucket>" query and returns a label→count map.
internal/store/reports.go:867
↓ 2 callersFunctionscreenDialAddr
screenDialAddr rejects a dial to a private/reserved IP. The dialer calls this with the resolved connection address (ip:port), so it validates the exac
internal/webhooks/dispatcher.go:163
↓ 2 callersFunctionseedActiveAccessTokenForChain
seedActiveAccessTokenForChain inserts one active access-token row in the chain identified by requestID for subject userID. Lets the IsWorkspaceCovered
internal/server/handlers_claim_code_test.go:25
↓ 2 callersFunctionseedAuditRow
MCP audit handler tests (PLAN-943 TASK-960). Two endpoints: - GET /api/v1/connected-apps/{id}/audit — owner-scoped per-connection. - GET /api/v1/ad
internal/server/handlers_mcp_audit_test.go:32
↓ 2 callersFunctionseedFullWorkspace
seedFullWorkspace inserts one row into every workspace-scoped child table so a purge can be proven exhaustive. Raw inserts deliberately omit columns t
internal/store/workspace_purge_test.go:60
↓ 2 callersFunctionseedOwnerWorkspace
32 hex chars, never issued seedOwnerWorkspace bootstraps the first admin (so RequireAuth is active and users exist) and returns the owner plus a fresh
internal/server/handlers_invitation_preview_test.go:28
↓ 2 callersFunctionseedRealisticContent
(fixture: SuiteFixture, request: APIRequestContext)
web/e2e/lib/demo-seed.ts:59
↓ 2 callersFunctionseedUser
seedUser inserts a user directly with the given plan + created_at so tests can deterministically populate the customers_by_plan and new_signups_30d ag
internal/server/handlers_admin_billing_test.go:59
↓ 2 callersMethodsendWith
sendWith is the internal send implementation.
internal/email/sender.go:142
↓ 2 callersFunctionserverBusyMessage
(retryAfterMs?: number)
web/src/lib/api/serverBusyToast.ts:38
↓ 2 callersMethodsetParentLinkTx
setParentLinkTx performs the lock acquisition, cycle check, and the DELETE-then-INSERT of the parent link entirely within the caller's transaction, re
internal/store/items.go:2882
↓ 2 callersFunctionsetTokenExpiryWarning
setTokenExpiryWarning adds an X-Token-Expires-Soon header if the API token used for this request is within the warning threshold of its expiry. Called
internal/server/handlers_tokens.go:244
↓ 2 callersFunctionsetupCmd
()
cmd/pad/cmd_auth.go:25
↓ 2 callersFunctionsha256Hex
sha256Hex returns the hex-encoded sha256 of b. The FS storage backend keys blobs by this exact form, so the value also serves as the storage_key suffi
internal/server/handlers_attachments_thumbnails.go:204
↓ 2 callersFunctionsha256hex
sha256hex returns the SHA-256 hex digest of a string.
internal/server/middleware_auth.go:794
↓ 2 callersFunctionshouldDedupeEditorSpace
( lastFlushedContent: string | null, seedMarkdown: string | null, normalizedMarkdown: string, )
web/src/lib/collab/flushDedupe.ts:22
↓ 2 callersFunctionshowDropLine
(pos: number)
web/src/lib/components/editor/block-drag-handle.ts:596
↓ 2 callersFunctionshowMenu
()
web/src/lib/components/editor/block-drag-handle.ts:407
↓ 2 callersFunctionsignEmail
(emailAddr, secret string)
internal/email/unsubscribe.go:28
↓ 2 callersFunctionslugSet
(hints []WorkspaceHint)
internal/mcp/dispatch_http_envelope_test.go:453
↓ 2 callersFunctionsnippetAround
snippetAround returns roughly `snippetRadius*2` bytes of `content` centered on `position` (the start of the `[[`). Caller doesn't need the snippet to
internal/store/wiki_links.go:1453
↓ 2 callersFunctionsnippetFor
(text: string)
web/src/lib/utils/hiddenContentDetector.ts:243
↓ 2 callersFunctionsourcesOf
(versions []models.Version)
internal/server/handlers_items_collab_versions_test.go:214
↓ 2 callersFunctionsplitAroundArguments
(body: string)
web/src/lib/playbooks/arguments.ts:91
↓ 2 callersFunctionsplitCodeFences
splitCodeFences partitions markdown source into alternating fenced / non-fenced spans. The fence detector recognizes the CommonMark form: at least thr
internal/server/render/attachments.go:336
↓ 2 callersFunctionsplitOnUnescapedPipe
splitOnUnescapedPipe scans `body` for the first `|` that isn't preceded by an unescaped `\`, splitting the body into (key, display, found). Mirrors sp
internal/links/extract.go:615
↓ 2 callersFunctionsplitWikiBody
(body: string)
web/src/lib/utils/markdown.ts:701
↓ 2 callersFunctionsseEventVisibleFor
sseVisibility is the per-connection event-filter state. All four fields are rebuilt atomically on each revalidation tick so that permission-tightening
internal/server/handlers_events.go:326
↓ 2 callersFunctionstartDrag
()
web/src/lib/components/editor/block-drag-handle.ts:689
↓ 2 callersMethodstartRedisSubscription
startRedisSubscription begins listening on a Redis channel for a workspace. Must be called with b.mu held.
internal/events/redis_bus.go:224
↓ 2 callersFunctionstrArray
* Coerce an array<string> param (the MCP transport may also deliver a single * string). Returns undefined when absent/empty. Throws on a non-string e
web/src/lib/webmcp/dispatch.ts:119
↓ 2 callersFunctionstripCobraUsageBlock
stripCobraUsageBlock removes cobra's auto-appended "Usage: ..." help block from a stderr string. cobra emits this block on any runtime error from a Ru
internal/mcp/errors.go:624
↓ 2 callersFunctionstripDuplicatedFieldsKeys
stripDuplicatedFieldsKeys removes implementation_notes and decision_log from a parsed fields object. The server hydrates both onto items as top-level
internal/mcp/dispatch.go:251
↓ 2 callersFunctionstripErrorPrefix
stripErrorPrefix removes the leading "Error:" prefix that the CLI (and many of its dependencies) emit on stderr lines. Cosmetic — the envelope's error
internal/mcp/errors.go:517
↓ 2 callersFunctionsurfacesUntrustedContent
(tool: ToolSurfaceTool)
web/src/lib/webmcp/descriptors.ts:111
↓ 2 callersFunctionswapNodeUuid
(newId: string)
web/src/lib/components/editor/attachment-image.ts:317
↓ 2 callersFunctionthrottleTime
throttleTime returns a timestamp 5 minutes before the given RFC3339 time string.
internal/store/users.go:876
↓ 2 callersFunctiontick
()
web/src/lib/components/editor/block-drag-handle.ts:672
↓ 2 callersFunctiontitleCaseLabel
titleCaseLabel converts a snake_case key into a Title Case label the same way the CLI does ("due_date" → "Due Date"). Avoids pulling in golang.org/x/t
internal/mcp/dispatch_http_routes.go:654
↓ 2 callersMethodtotalChildRows
totalChildRows sums every seeded child row for a workspace, checking item-scoped tables against the original parent IDs so a leaked row is detectable
internal/store/workspace_purge_test.go:185
↓ 2 callersFunctiontrimRedundantSchemaLabels
trimRedundantSchemaLabels parses the schema JSON, drops field labels equal to TitleCase(key), and re-marshals. Returns the original bytes verbatim on
internal/server/handlers_bootstrap.go:174
↓ 2 callersFunctiontruncateTitle
truncateTitle limits an uncolorized, SGR-free title to maxRunes visible columns, appending an ellipsis when it had to cut. Callers strip SGR escapes f
internal/cli/format.go:167
↓ 2 callersFunctionunescapeMarkdownText
unescapeMarkdownText reverses CommonMark escape sequences in a captured label. Marked's tokenizer drops the backslash and emits the literal character,
internal/server/render/attachments.go:254
↓ 2 callersFunctionunescapeWikiBody
unescapeWikiBody undoes the editor's body-escape sequences: `\]` → `]`, `\|` → `|`, `\\` → `\`. Other backslash sequences are left as-is (the renderer
internal/links/extract.go:634
↓ 2 callersFunctionunescapeWikiBody
(s: string)
web/src/lib/utils/markdown.ts:694
↓ 2 callersFunctionuniqueStrings
(values []string)
internal/models/item.go:503
↓ 2 callersFunctionunknownWorkspaceResult
unknownWorkspaceResult wraps a "workspace X doesn't exist" failure. Same available_workspaces enrichment as no_workspace. Empty slug emits a generic m
internal/mcp/errors.go:264
↓ 2 callersFunctionunwrapErrorEnvelope
unwrapErrorEnvelope extracts the structured ErrorEnvelope from a CallToolResult. Test helper — fails fast if the result isn't shaped like a structured
internal/mcp/dispatch_http_envelope_uniform_test.go:276
↓ 2 callersFunctionupdateAspectActive
()
web/src/lib/components/editor/attachment-crop-modal.ts:150
↓ 2 callersFunctionuserActorLabel
userActorLabel produces a stable string label for the actor that created a structured entry. Mirrors the CLI's "user" label for CLI-driven entries; fo
internal/mcp/dispatch_http_project.go:645
↓ 2 callersFunctionvalidHash
validHash returns true if h looks like a hex-encoded sha256 — 64 lowercase hex characters. We only accept this canonical form so on-disk paths are sta
internal/attachments/fs_store.go:85
↓ 2 callersFunctionvalidTOTPCode
validTOTPCode mints the current valid TOTP code for a secret, using the same library the handler validates against.
internal/server/handlers_account_test.go:414
↓ 2 callersMethodvalidateAssignmentScope
validateAssignmentScope checks that the assigned user and agent role belong to the same workspace as the item. This prevents cross-workspace assignmen
internal/store/items.go:40
← previousnext →1,501–1,600 of 6,005, ranked by callers