MCPcopy Create free account

hub / github.com/PerpetualSoftware/pad / functions

Functions6,412 in github.com/PerpetualSoftware/pad

↓ 3 callersFunctionactionItemExport
actionItemExport handles pad_item.action=export. The CLI's `pad item export <ref>` defaults to WRITING A FILE (<slug>.pad.md), which is useless to an
internal/mcp/catalog_item.go:670
↓ 3 callersFunctionactionItemImport
actionItemImport handles pad_item.action=import. The CLI's `pad item import <file>` reads the artifact from a file (or stdin when the positional is `-
internal/mcp/catalog_item.go:702
↓ 3 callersFunctionadminFetch
(path: string, opts?: RequestInit)
web/src/lib/stores/admin.svelte.ts:75
↓ 3 callersFunctionasText
asText extracts the text payload from any content type that has one. mcp-go's Content interface is implemented by TextContent, etc.; we only care abou
internal/mcp/workspace_test.go:128
↓ 3 callersFunctionassertGotForceRefresh
assertGotForceRefresh drains conn until it either receives a force_refresh control frame (pass) or the conn closes without one (fail).
internal/server/handlers_items_collab_versions_test.go:651
↓ 3 callersFunctionassertMemberCollectionAccessUnchanged
(t *testing.T, f *restrictedOwnerVisibilityFixture, userID, wantMode string, wantIDs []string)
internal/server/handlers_member_collection_access_escalation_test.go:183
↓ 3 callersFunctionassertOpLogEmpty
(t *testing.T, srv *Server, itemID string)
internal/server/handlers_items_collab_versions_test.go:642
↓ 3 callersFunctionauthHeaders
(fixture: SuiteFixture)
web/e2e/pane-collection-migration-race.spec.ts:43
↓ 3 callersFunctionauthHeaders
(fixture: SuiteFixture)
web/e2e/pane-async-race.spec.ts:121
↓ 3 callersFunctionauthHeaders
(fixture: SuiteFixture)
web/e2e/pane-content-link-anchors.spec.ts:53
↓ 3 callersFunctionauthHeaders
(fixture: SuiteFixture)
web/e2e/lib/demo-seed.ts:26
↓ 3 callersMethodbearerHeaders
()
internal/server/handlers_comments_bearer_gate_test.go:32
↓ 3 callersFunctionbuildDoneContextMap
buildDoneContextMap builds a map of collection ID → (schema, settings) for quick lookups during dashboard / lineage traversals.
internal/server/handlers_dashboard.go:225
↓ 3 callersFunctionbulkUpdateRefs
bulkUpdateRefs canonicalizes the `ref` input — accepts repeatable shapes the cmdhelp registry generates (string for a single value, []any from JSON ar
internal/mcp/dispatch_http_project.go:443
↓ 3 callersFunctionbumpEpoch
(ws: string)
web/src/lib/stores/localSearch.svelte.ts:341
↓ 3 callersFunctionbundleAttachmentPath
bundleAttachmentPath builds the tar entry name for an attachment. Exported as a function (not a const helper) so the import path can import it and res
internal/server/handlers_export_bundle.go:280
↓ 3 callersMethodcancel
Cancel the pending debounce without saving. Leaves the dirty flag set.
web/src/lib/items/contentSaver.svelte.ts:52
↓ 3 callersFunctioncapBootstrapDashboard
capBootstrapDashboard wraps a DashboardResponse with the bootstrap's per-section caps. The underlying *DashboardResponse is shallow-copied before the
internal/server/handlers_bootstrap.go:832
↓ 3 callersMethodcheckBootstrapToken
checkBootstrapToken validates the X-Bootstrap-Token header on r against the in-memory token using a constant-time comparison. Returns false if no toke
internal/server/bootstrap.go:169
↓ 3 callersMethodcheckUniqueFields
(workspaceID, collectionID, excludeItemID string, schema models.CollectionSchema, fieldMap map[string]any)
internal/server/handlers_items.go:2513
↓ 3 callersFunctionclampRect
Clamp a rectangle to fit within `bounds`, integer coords throughout.
web/src/lib/components/editor/attachment-crop-modal.ts:395
↓ 3 callersFunctioncleanupMarkdown
(md string)
internal/urlimport/generic.go:99
↓ 3 callersFunctioncloneStringMap
cloneStringMap returns a shallow copy of m. Used by mappers that need to normalize a single value before handing the map to a downstream helper, witho
internal/mcp/dispatch_http_routes.go:1369
↓ 3 callersMethodcloseSocket
(code: number, reason: string)
web/src/lib/collab/wsProvider.svelte.ts:1204
↓ 3 callersFunctioncodeOrBlank
codeOrBlank wraps t in backticks unless t is empty. Any stray backtick characters inside t are stripped first so the resulting cell always carries exa
internal/urlimport/openapi.go:430
↓ 3 callersFunctioncoerceObject
(value: unknown)
web/src/lib/components/share/shareView.ts:65
↓ 3 callersFunctioncollCount
(list []ReportCollectionCount, slug string)
internal/store/reports_test.go:21
↓ 3 callersFunctioncollectServerInfo
(cfg *config.Config)
cmd/pad/server_info.go:96
↓ 3 callersFunctioncollectionSlugs
(colls []models.Collection)
internal/store/collections_test.go:767
↓ 3 callersFunctioncomputeAdminUserStatus
computeAdminUserStatus derives the at-a-glance status pill from the underlying fields. Precedence is intentional: a disabled user with no workspace is
internal/store/users.go:344
↓ 3 callersMethodconnect
()
web/src/lib/collab/wsProvider.svelte.ts:653
↓ 3 callersFunctioncountParentLinks
countParentLinks returns how many `parent` link rows an item is the source of. The invariant is that a well-behaved item has at most one — the DELETE-
internal/store/parent_link_concurrency_test.go:30
↓ 3 callersFunctioncountUAChangeEvents
countUAChangeEvents returns the number of session_ua_changed rows in the audit log.
internal/server/middleware_session_ua_test.go:47
↓ 3 callersFunctioncreateLineageLink
(spec lineageLinkSpec, sourceRef, targetRef string)
cmd/pad/lineage.go:120
↓ 3 callersFunctioncredentialsPath
credentialsPath is retained for internal call sites.
internal/cli/credentials.go:83
↓ 3 callersFunctioncursorStorageKey
(itemID: string)
web/src/lib/collab/wsProvider.svelte.ts:133
↓ 3 callersFunctiondbName
(userId: string | null, ws: string)
web/src/lib/stores/localIndexPersistence.ts:83
↓ 3 callersFunctiondecodeJSONWithLimit
decodeJSONWithLimit is the size-configurable variant. Use this for endpoints that accept large payloads (e.g. bulk-import) where the default cap is to
internal/server/server.go:1847
↓ 3 callersFunctiondecodeUserGrantsResponse
decodeUserGrantsResponse requires a 200 and decodes the body, failing the test otherwise.
internal/server/handlers_grant_visibility_test.go:879
↓ 3 callersFunctiondeleteLineageLink
(spec lineageLinkSpec, sourceRef, targetRef string)
cmd/pad/lineage.go:150
↓ 3 callersMethoddestroy
Cleanly close the WS, unbind doc/awareness handlers, and * prevent further reconnect attempts. Safe to call more than * once; idempotent.
web/src/lib/collab/wsProvider.svelte.ts:617
↓ 3 callersFunctiondialWSContentSeq
dialWSContentSeq appends `?content_seq=<seq>` so the test exercises the BUG-2264 stale-seed force_refresh fence.
internal/collab/manager_test.go:349
↓ 3 callersFunctiondirExists
(parts ...string)
internal/cli/detect.go:208
↓ 3 callersFunctiondispatch
( api: Api, wsSlug: string, _isReadOnlyAction: (toolName: string, action: string) => boolean | undefined,
web/src/lib/webmcp/dispatch.ts:611
↓ 3 callersFunctiondoBrowserLogin
doBrowserLogin implements the browser-based CLI auth flow. It creates a pending session, prints the auth URL, and polls until approved.
cmd/pad/cmd_auth.go:402
↓ 3 callersFunctiondoMetricsRequest
(srv *Server, remoteAddr, authHeader string)
internal/server/metrics_auth_test.go:31
↓ 3 callersFunctiondocsCollection
docsCollection returns the standard Docs collection shared across templates.
internal/collections/templates.go:138
↓ 3 callersMethoddoneFieldKey
doneFieldKey resolves the select field whose value represents a collection's workflow/done state (CollectionSettings.BoardGroupBy, else "status"). Use
internal/store/status_transitions_backfill.go:68
↓ 3 callersFunctiondurationsByCollection
durationsByCollection turns per-collection samples into median+count entries, ordered by count desc then slug.
internal/store/reports.go:967
↓ 3 callersMethodemailConfigured
emailConfigured reports whether this instance can actually SEND an emailed link — a sender is wired AND the public base URL is usable. This is the DR-
internal/server/server.go:670
↓ 3 callersFunctionemitRealPadJSON
emitRealPadJSON builds the real pad cobra tree and emits its JSON representation with a static (no-resolver, no live-workspace) configuration. Tests t
cmd/pad/cmdhelp_real_test.go:20
↓ 3 callersFunctionenableTOTPForDeleteUser
enableTOTPForDeleteUser turns on 2FA for a bootstrapped delete-test user using a known secret, mirroring the real SetTOTPSecret → EnableTOTP flow, and
internal/server/handlers_account_test.go:400
↓ 3 callersFunctionenc
(obj: Record<string, unknown>)
web/e2e/lib/demo-seed.ts:24
↓ 3 callersFunctionendDrag
()
web/src/lib/components/editor/block-drag-handle.ts:752
↓ 3 callersMethodenqueue
enqueue tries to push one entry without blocking. Returns true on success; on a full queue, increments the drop counter and returns false. The MCP mid
internal/server/middleware_mcp_audit.go:120
↓ 3 callersFunctionenvelopeFrom
envelopeFrom reads the ErrorEnvelope back out of an MCP error result's structured content. Used by classifyHTTPStatus's 404 workspace path so we can l
internal/mcp/errors.go:320
↓ 3 callersFunctionequalBytes
(a, b []byte)
internal/server/handlers_attachments_download_test.go:328
↓ 3 callersFunctionescapeHtml
* Escape HTML-significant characters so user-controlled strings can be * safely interpolated into attribute values and text nodes. Local copy so * t
web/src/lib/markdown/attachments.ts:106
↓ 3 callersFunctionescapeTable
escapeTable replaces newlines and pipes so a value can sit in a markdown table cell without breaking the table grid.
internal/cmdhelp/md.go:298
↓ 3 callersFunctionextractFieldFromJSON
(fieldsJSON, key string)
cmd/pad/cmd_workspace.go:1014
↓ 3 callersFunctionextractFieldValue
extractFieldValue extracts a string value from a JSON fields string.
internal/server/handlers_dashboard.go:1092
↓ 3 callersFunctionextractHash
extractHash pulls the hash component out of an "fs:<hash>" key and validates it. We require the canonical 64-char lowercase-hex sha256 form on every p
internal/attachments/fs_store.go:71
↓ 3 callersFunctionextractUnknownWorkspaceSlug
extractUnknownWorkspaceSlug pulls the slug from a CLI stderr like "workspace 'foo' does not exist" so the envelope can name it. Returns empty string i
internal/mcp/errors.go:568
↓ 3 callersFunctionfetchAttachmentMetadata
( workspaceSlug: string, uuid: string, getDownloadUrl: AttachmentUrlBuilder )
web/src/lib/components/editor/attachment-metadata.ts:41
↓ 3 callersFunctionfieldString
fieldString parses an item's fields JSON and returns the string value at key (or "" if absent).
internal/server/handlers_artifact_test.go:564
↓ 3 callersFunctionfilterWorkspacesByTokenAllowlist
filterWorkspacesByTokenAllowlist returns the subset of wss the request's OAuth consent allow-list permits, or wss unchanged when no per-slug gate appl
internal/server/handlers_workspaces.go:26
↓ 3 callersFunctionfindItemByRef
(items: Item[], ref: string)
web/src/lib/utils/markdown.ts:461
↓ 3 callersFunctionfindMatchingLinkID
(links []models.ItemLink, linkType, sourceID, targetID string)
cmd/pad/lineage.go:185
↓ 3 callersFunctionfirstLine
firstLine returns the first line of s with surrounding whitespace trimmed. Useful for collapsing a multi-line Long string into a Summary.
internal/cmdhelp/json.go:504
↓ 3 callersMethodgetAPIToken
getAPIToken retrieves a single API token by ID.
internal/store/api_tokens.go:269
↓ 3 callersFunctiongetItem
---- helpers ----
internal/server/handlers_artifact_test.go:551
↓ 3 callersMethodgetJSON
getJSON serves a GET in-process and returns the response body, mapping any 4xx/5xx to a Go error (the resource protocol surfaces these as JSON-RPC err
internal/mcp/resources_http.go:257
↓ 3 callersMethodgetTokenExpirySettings
getTokenExpirySettings reads platform settings for token expiry policy.
internal/server/handlers_tokens.go:20
↓ 3 callersFunctionglobalAgents
globalAgents returns the agents that target a stable per-user config file — i.e. everything except CWDBased (project-local) agents. It's the iteration
internal/mcp/install.go:105
↓ 3 callersFunctionhasGraphEdge
(resp GraphResponse, source, target, typ string)
internal/server/handlers_graph_test.go:32
↓ 3 callersFunctionhideDropLine
()
web/src/lib/components/editor/block-drag-handle.ts:655
↓ 3 callersFunctionipInCIDRs
(ip net.IP, cidrs []*net.IPNet)
internal/server/middleware_realip.go:134
↓ 3 callersFunctionisCrossWorkspaceHref
True when `href` is (or resolves to) the cross-workspace resolver route.
web/src/lib/collections/paneTarget.ts:61
↓ 3 callersFunctionisPrivateIP
isPrivateIP returns true if the IP is in a private, reserved, or otherwise non-routable range. It covers loopback (127.0.0.0/8, ::1), RFC1918 (10/8, 1
internal/webhooks/validate.go:66
↓ 3 callersFunctionisServerHealthy
(host string, port int)
internal/cli/server.go:113
↓ 3 callersFunctionitemOpenTestHandler
(ref string, item models.Item)
cmd/pad/item_open_test.go:35
↓ 3 callersFunctionitemUrlId
(item: Item)
web/src/lib/types/index.ts:1697
↓ 3 callersFunctionjsonEqualString
jsonEqualString compares two JSON strings tolerantly of insignificant whitespace differences that emerge from JSONB ↔ TEXT round-trips.
internal/store/items_views_jsonb_test.go:245
↓ 3 callersFunctionkeys
(m interface{})
internal/cmdhelp/json_test.go:671
↓ 3 callersFunctionlinkChild
linkChild wires child -> parent via a `parent` link (the shape GetChildItems / GetChildItemsForParents walk).
internal/store/dashboard_batch_test.go:11
↓ 3 callersMethodlistItemLinks
listItemLinks issues an in-handler GET against api/v1/workspaces/{ws}/items/{slug}/links and decodes the response into models.ItemLink so the un-* dis
internal/mcp/dispatch_http_links.go:672
↓ 3 callersFunctionloadFixture
(t *testing.T, name string)
internal/urlimport/generic_test.go:10
↓ 3 callersFunctionloadJSONConfig
loadJSONConfig reads path as a JSON object. A missing or whitespace-only file is treated as an empty config (so AddPadEntry can populate from scratch
internal/mcp/install.go:323
↓ 3 callersFunctionloadSchemaForTest
loadSchemaForTest is a test-only wrapper around FindAndCompileSchema that fails the test on error and starts the walk from the test's CWD.
internal/cmdhelp/schema_test.go:14
↓ 3 callersFunctionloadTOMLConfig
loadTOMLConfig reads path as a TOML document into a map. A missing or whitespace-only file is an empty config. Parse errors on a non-empty file propag
internal/mcp/install.go:501
↓ 3 callersMethodlogActivityWithMeta
logActivityWithMeta logs activity with optional JSON metadata. For "updated" actions, uses debouncing to coalesce rapid successive saves (e.g., autosa
internal/server/handlers_documents.go:302
↓ 3 callersMethodlogActivityWithMetaReturningID
logActivityWithMetaReturningID is like logActivityWithMeta but returns the activity ID. The ID is either newly created or the coalesced existing activ
internal/server/handlers_documents.go:308
↓ 3 callersMethodlogWorkspaceAuditEvent
logWorkspaceAuditEvent logs a workspace-scoped audit event (e.g. member invited). Best-effort: errors are silently ignored.
internal/server/handlers_documents.go:368
↓ 3 callersFunctionmapItemStarred
mapItemStarred dispatches `pad item starred [--all]`. GET /api/v1/workspaces/{ws}/starred?include_terminal=true when --all is set. Without --all the
internal/mcp/dispatch_http_routes.go:671
↓ 3 callersFunctionmapKeys
mapKeys returns the keys of m, in arbitrary order. Used only by test failure messages where order doesn't matter.
internal/mcp/meta_test.go:146
↓ 3 callersFunctionmapRoleCreate
mapRoleCreate dispatches `pad role create <name> [--description ...] [--icon ...] [--tools ...]`. POST /api/v1/workspaces/{ws}/agent-roles with body
internal/mcp/dispatch_http_routes.go:849
↓ 3 callersFunctionmapWebhookCreate
mapWebhookCreate dispatches `pad webhook create <url> [--events ...] [--secret ...]`. POST /api/v1/workspaces/{ws}/webhooks with body matching models
internal/mcp/dispatch_http_routes.go:896
↓ 3 callersFunctionmapWorkspaceAuditLog
mapWorkspaceAuditLog dispatches `pad workspace audit-log [--days N] [--actor X] [--action X] [--limit N]`. GET /api/v1/audit-log (NOT workspace-scope
internal/mcp/dispatch_http_routes.go:1004
↓ 3 callersFunctionmapWorkspaceCreate
mapWorkspaceCreate dispatches `pad workspace create <name> [--slug X] [--template X]`. POST /api/v1/workspaces with body {name, slug?, template?} — m
internal/mcp/dispatch_http_routes.go:1039
↓ 3 callersFunctionmapWorkspaceInvite
mapWorkspaceInvite dispatches `pad workspace invite <email> [--role X]`. POST /api/v1/workspaces/{ws}/members/invite with body {email, role?}. Defaul
internal/mcp/dispatch_http_routes.go:1091
← previousnext →1,001–1,100 of 6,412, ranked by callers