Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/PerpetualSoftware/pad
/ functions
Functions
6,005 in github.com/PerpetualSoftware/pad
⨍
Functions
6,005
◇
Types & classes
763
↓ 3 callers
Function
extractFieldFromJSON
(fieldsJSON, key string)
cmd/pad/cmd_workspace.go:1014
↓ 3 callers
Function
extractFieldValue
extractFieldValue extracts a string value from a JSON fields string.
internal/server/handlers_dashboard.go:1092
↓ 3 callers
Function
extractHash
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 callers
Function
extractUnknownWorkspaceSlug
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 callers
Function
fetchAttachmentMetadata
( workspaceSlug: string, uuid: string, getDownloadUrl: AttachmentUrlBuilder )
web/src/lib/components/editor/attachment-metadata.ts:41
↓ 3 callers
Function
fieldString
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 callers
Function
findItemByRef
(items: Item[], ref: string)
web/src/lib/utils/markdown.ts:461
↓ 3 callers
Function
findMatchingLinkID
(links []models.ItemLink, linkType, sourceID, targetID string)
cmd/pad/lineage.go:185
↓ 3 callers
Function
firstLine
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 callers
Method
getAPIToken
getAPIToken retrieves a single API token by ID.
internal/store/api_tokens.go:266
↓ 3 callers
Function
getItem
---- helpers ----
internal/server/handlers_artifact_test.go:551
↓ 3 callers
Method
getTokenExpirySettings
getTokenExpirySettings reads platform settings for token expiry policy.
internal/server/handlers_tokens.go:20
↓ 3 callers
Function
globalAgents
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 callers
Function
hasGraphEdge
(resp GraphResponse, source, target, typ string)
internal/server/handlers_graph_test.go:32
↓ 3 callers
Function
hideDropLine
()
web/src/lib/components/editor/block-drag-handle.ts:618
↓ 3 callers
Function
ipInCIDRs
(ip net.IP, cidrs []*net.IPNet)
internal/server/middleware_realip.go:134
↓ 3 callers
Function
isPrivateIP
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 callers
Function
isServerHealthy
(host string, port int)
internal/cli/server.go:113
↓ 3 callers
Function
itemOpenTestHandler
(ref string, item models.Item)
cmd/pad/item_open_test.go:35
↓ 3 callers
Function
jsonEqualString
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 callers
Function
keys
(m interface{})
internal/cmdhelp/json_test.go:671
↓ 3 callers
Function
linkChild
linkChild wires child -> parent via a `parent` link (the shape GetChildItems / GetChildItemsForParents walk).
internal/store/dashboard_batch_test.go:11
↓ 3 callers
Method
listItemLinks
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 callers
Function
loadFixture
(t *testing.T, name string)
internal/urlimport/generic_test.go:10
↓ 3 callers
Function
loadJSONConfig
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 callers
Function
loadSchemaForTest
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 callers
Function
loadTOMLConfig
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 callers
Method
logActivityWithMeta
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 callers
Method
logActivityWithMetaReturningID
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 callers
Method
logWorkspaceAuditEvent
logWorkspaceAuditEvent logs a workspace-scoped audit event (e.g. member invited). Best-effort: errors are silently ignored.
internal/server/handlers_documents.go:368
↓ 3 callers
Function
mapItemStarred
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 callers
Function
mapKeys
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 callers
Function
mapRoleCreate
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 callers
Function
mapWebhookCreate
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 callers
Function
mapWorkspaceAuditLog
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 callers
Function
mapWorkspaceCreate
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 callers
Function
mapWorkspaceInvite
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
↓ 3 callers
Function
markEventForUnmarkTest
markEventForUnmarkTest is a helper that POSTs stripe-event-processed and returns the processed_at token the response hands back. Keeps the setup of th
internal/server/cloud_admin_gate_test.go:272
↓ 3 callers
Function
mergeActivityMeta
mergeActivityMeta combines two activity metadata JSON strings, accumulating the "changes" field. If both contain changes, they are joined with "; ". O
internal/store/activities.go:82
↓ 3 callers
Function
mergeAllowedWorkspaces
mergeAllowedWorkspaces computes the effective workspace allow-list for an OAuth-authenticated MCP request, OR-merging the two sources described in han
internal/server/middleware_mcp_auth.go:447
↓ 3 callers
Function
needsPRMetadataRefresh
(item *models.Item, livePR *GitHubPR)
cmd/pad/reconcile.go:372
↓ 3 callers
Function
newCloudEmailServer
newCloudEmailServer returns a cloud-mode server with a usable base URL and a capturing email sink, bootstrapped with one admin. This is the configurat
internal/server/handlers_verify_email_test.go:92
↓ 3 callers
Function
newCommentBearerGateFixture
(t *testing.T)
internal/server/handlers_comments_bearer_gate_test.go:36
↓ 3 callers
Function
newMailSink
newMailSink stands up a fake Maileroo v2 endpoint that records every outgoing email onto a channel, and returns a Sender wired to it. Mirrors the http
internal/server/handlers_verify_email_test.go:35
↓ 3 callers
Function
newSharedLeakEnv
BUG-1865: the cloud /mcp transport used to resolve the target workspace from a SINGLE process-global *mcp.WorkspaceState shared across every OAuth use
internal/mcp/bug1865_test.go:50
↓ 3 callers
Function
outputJSON
(v interface{})
cmd/pad/main.go:252
↓ 3 callers
Function
padTomlURLFor
padTomlURLFor returns the URL to write into .pad.toml for the given client config. Local-mode workspaces get the empty string (the default loopback se
cmd/pad/init.go:353
↓ 3 callers
Function
parseFields
(item: Item)
web/src/lib/types/index.ts:1571
↓ 3 callers
Function
parseItemRef
parseItemRef parses "PREFIX-123" into ("PREFIX", 123, true). Returns false if the string is not a valid item ref. Case-insensitive: "task-5", "Task-5"
internal/store/items.go:590
↓ 3 callers
Function
parseMCPAuditPaging
parseMCPAuditPaging extracts limit + offset from the query string, applying sane caps. Bound limit at 200 — large enough for a "scan the recent audit"
internal/server/handlers_mcp_audit.go:84
↓ 3 callers
Function
parseMCPRequestBody
parseMCPRequestBody extracts (tool_name, args_hash) from the JSON-RPC envelope in body. Two cases: - method == "tools/call" → tool_name = params.name
internal/server/middleware_mcp_audit.go:372
↓ 3 callers
Function
parseSchema
(collection: Collection)
web/src/lib/types/index.ts:1607
↓ 3 callers
Function
paymentFailedAuditForUser
paymentFailedAuditForUser walks the audit log for a given user and returns every payment_failed_email_sent row's parsed metadata. Used by the send-pat
internal/server/cloud_admin_gate_test.go:728
↓ 3 callers
Method
positiveTerminalExpr
positiveTerminalExpr builds the "this transition is a positive completion" boolean: OR over collections of (st.collection_id = ? AND st.field_key = ?
internal/store/reports.go:800
↓ 3 callers
Function
printGroupedTemplates
printGroupedTemplates prints the visible templates to w, grouped by category in canonical order. Used by `--list-templates` and the "unknown template"
cmd/pad/templates_picker.go:23
↓ 3 callers
Function
printPostSetupNextStepsHint
printPostSetupNextStepsHint walks the freshly-bootstrapped admin to the next step that actually does something useful: creating a workspace. The IDEA-
cmd/pad/cmd_auth.go:318
↓ 3 callers
Function
printSetupRequiredHint
(cfg *config.Config)
cmd/pad/cmd_auth.go:693
↓ 3 callers
Function
promptAndBootstrap
promptAndBootstrap collects admin credentials from the terminal and creates the first admin account via /auth/bootstrap, retrying the password pair on
cmd/pad/cmd_auth.go:596
↓ 3 callers
Function
readPasswordFrom
readPasswordFrom reads a password without echo when stdin is a TTY, and otherwise falls back to reading a line from the supplied bufio.Reader. Caller
cmd/pad/cmd_auth.go:721
↓ 3 callers
Function
readWorkspaceContextInput
(filePath string, useStdin bool)
cmd/pad/workspace_context.go:102
↓ 3 callers
Method
reconfigureEmail
reconfigureEmail reads email settings from the platform_settings table and updates (or creates) the email sender. Called after admin settings change.
internal/server/server.go:920
↓ 3 callers
Method
recordOAuthFlow
registerOAuthRoutes mounts the OAuth endpoints on r. Called from setupRouter at the same level as the MCP routes. No-op when either cloud mode is off
internal/server/handlers_oauth.go:124
↓ 3 callers
Function
refreshIcon
()
web/src/lib/components/editor/attachment-chip.ts:289
↓ 3 callers
Function
removeGhost
()
web/src/lib/components/editor/block-drag-handle.ts:651
↓ 3 callers
Function
removePadEntryTOML
removePadEntryTOML deletes mcp_servers.pad while leaving other servers and top-level keys intact. Returns (true, nil) when an entry was removed, (fals
internal/mcp/install.go:447
↓ 3 callers
Function
renderPreview
()
web/src/lib/components/editor/extensions/htmlBlock.ts:314
↓ 3 callers
Function
renderUnsubPage
renderUnsubPage writes the unsubscribe status page with a strict CSP. The CSP denies scripts, inline event handlers, iframes, and remote resources out
internal/server/handlers_unsubscribe.go:102
↓ 3 callers
Method
reportSnapshotAsOf
reportSnapshotAsOf reconstructs the status-distribution and WIP snapshot as they stood at time t, from the status-transition history (PLAN-1628 / TASK
internal/store/reports.go:447
↓ 3 callers
Function
request
( path: string, options?: RequestInit, // Internal flag: true on the single automatic re-invocation after a
web/src/lib/api/client.ts:405
↓ 3 callers
Method
resolveItemRef
resolveItemRef does a GET /api/v1/workspaces/{ws}/items/{ref} and returns the resolved id+slug. Used by the link dispatchers to translate user-friendl
internal/mcp/dispatch_http_links.go:142
↓ 3 callers
Method
resolveLimit
resolveLimit resolves the limit for a feature using the three-tier resolution: user overrides → DB-stored plan defaults → hardcoded fallback.
internal/store/limits.go:152
↓ 3 callers
Method
resolveReportCollections
resolveReportCollections lists the workspace's collections (optionally filtered to the given slugs) and resolves each one's done field + positive term
internal/store/reports.go:653
↓ 3 callers
Method
rotateSessionsAfterCredentialChange
rotateSessionsAfterCredentialChange invalidates every existing session for the user (forcing sign-out on all other devices) and then re-issues a fresh
internal/server/handlers_auth.go:302
↓ 3 callers
Function
runApplierEcho
runApplierEcho spawns a goroutine that reads all incoming TextMessage frames on conn, looks for applier_request, and immediately responds with applier
internal/collab/applier_test.go:16
↓ 3 callers
Function
runBrowserSetup
runBrowserSetup drives the browser-based first-admin bootstrap and the CLI authorization in a SINGLE browser handoff. Before printing anything it crea
cmd/pad/cmd_auth.go:153
↓ 3 callers
Function
runConfigureFlow
(cfg *config.Config, values configureValues)
cmd/pad/configure.go:107
↓ 3 callers
Method
runDisconnectCleanup
* Cleanup shared by `onClose` and the paths that bypass it via * `closeSocket()` (which removes the close listener before calling * `ws.close()`):
web/src/lib/collab/wsProvider.svelte.ts:571
↓ 3 callers
Function
runHandshake
runHandshake spins up srv against in-memory pipes, drives the MCP client's Initialize, and returns the result + a cleanup that tears the goroutine dow
internal/mcp/server_test.go:191
↓ 3 callers
Function
runHeadlessSetup
runHeadlessSetup drives the output layer for `pad auth setup --email …`. It delegates the actual work to doHeadlessBootstrap and then prints the resul
cmd/pad/cmd_auth.go:279
↓ 3 callers
Function
sanitizeVersion
sanitizeVersion makes a build-version string safe as a filename suffix. Build versions can carry spaces/parens (e.g. "1.2.3 (abc1234)"); collapse anyt
internal/store/migration_guard.go:154
↓ 3 callers
Function
scanCollectionDoneFilters
scanCollectionDoneFilters consumes rows yielding (id, schema, settings) and resolves each into a collectionDoneFilter. When a collection's schema fai
internal/store/items.go:3366
↓ 3 callers
Function
scanMCPAuditRows
scanMCPAuditRows is the shared row-decoder for every list method. Pulls out the nullable workspace_id + error_kind into *string, parses the timestamp,
internal/store/mcp_audit.go:292
↓ 3 callers
Method
scheduleReconnect
()
web/src/lib/collab/wsProvider.svelte.ts:1092
↓ 3 callers
Method
send
(data: Uint8Array)
web/src/lib/collab/wsProvider.svelte.ts:1116
↓ 3 callers
Function
setSessionTimes
setSessionTimes backdates a session's expires_at (and optionally created_at) so renewal-threshold and absolute-cap paths can be exercised deterministi
internal/store/sessions_test.go:309
↓ 3 callers
Function
shellSplit
shellSplit tokenizes a command line in a POSIX-ish way: whitespace separates tokens, double-quotes group, single-quotes group (no expansion inside), b
internal/cmdhelp/example_validation.go:148
↓ 3 callers
Method
shutdown
shutdown signals the worker to drain + exit. Idempotent.
internal/server/middleware_mcp_audit.go:187
↓ 3 callers
Function
sliceContainsString
(v any, want string)
internal/server/handlers_oauth_test.go:137
↓ 3 callers
Function
startUpload
* Kick off an upload for a single file. Inserts the placeholder * immediately, then races the network. The placeholder's position is * mapped throug
web/src/lib/components/editor/attachment-upload.ts:151
↓ 3 callers
Function
stopAutoScroll
()
web/src/lib/components/editor/block-drag-handle.ts:684
↓ 3 callers
Method
stopTokenReaper
stopTokenReaper signals the loop to exit. Called from Server.Stop(). Safe to call when the loop never started.
internal/server/token_reaper.go:84
↓ 3 callers
Function
swapApplierTimeouts
(first, retry time.Duration)
internal/collab/applier_test.go:441
↓ 3 callers
Method
sweep
sweep walks the map, evicts entries older than ttl, and returns the eviction count. onChange fires once at the end with the new total — single observa
internal/server/middleware_mcp_session.go:146
↓ 3 callers
Function
timelineFixture
Regression coverage for BUG-1086. The timeline handler previously seeded `beforeID` with the literal byte "\xff" to act as a sentinel that "sorts aft
internal/store/timeline_pagination_test.go:27
↓ 3 callers
Function
toSkinny
* Strip a row down to the skinny shape. Defensive: discard `content` * if a caller passed a full `Item` rather than an `ItemIndexRow`. The * destruc
web/src/lib/stores/localIndex.svelte.ts:134
↓ 3 callers
Function
tokenAllowedWorkspaceMatches
tokenAllowedWorkspaceMatches reports whether the OAuth token's workspace allow-list (set at consent time, TASK-952) permits the given workspace slug.
internal/server/middleware_auth.go:1098
↓ 3 callers
Function
translateResourceToAudience
===================================================================== oauth/authorize — start auth-code flow =========================================
internal/server/handlers_oauth.go:492
↓ 3 callers
Function
uaBoundSession
uaBoundSession creates a user + a session bound to a fixed client IP and User-Agent, returning the raw session token. Tests drive requests through doG
internal/server/middleware_session_ua_test.go:15
↓ 3 callers
Function
uniqueNonEmpty
(values []string)
internal/cli/detect.go:367
↓ 3 callers
Method
uniqueSlugExcluding
uniqueSlugExcluding generates a unique slug, excluding a specific document ID from the collision check. Used during title renames.
internal/store/store.go:802
← previous
next →
1,001–1,100 of 6,005, ranked by callers