MCPcopy Create free account

hub / github.com/0xSero/pi-brain / functions

Functions123 in github.com/0xSero/pi-brain

↓ 13 callersFunctiondetectAll
( text: string, categories: ReadonlyArray<RedactionCategory>, customPatterns?: Readonly<Record<string, stri
core/privacy/detectors.ts:97
↓ 11 callersFunctionanonymize
( sessions: ReadonlyArray<SanitizedSession>, config?: AnonymizeConfig, )
core/privacy/anonymizer.ts:44
↓ 11 callersFunctionsanitize
( session: CanonicalSession, config?: PrivacyConfig, )
core/privacy/redactor.ts:50
↓ 10 callersFunctionmakeSession
()
tests/core/anonymizer.test.ts:22
↓ 9 callersFunctioncreateBundle
( sessions: ReadonlyArray<SanitizedSession>, config: Required<ExportConfig>, )
core/data-processing/bundle.ts:29
↓ 9 callersFunctionhome
()
plugins/helpers.ts:28
↓ 8 callersFunctionchunk
(text: string, maxTokens = 1000)
core/data-processing/chunker.ts:27
↓ 7 callersFunctioncanonicalize
(raw: unknown)
core/data-processing/canonicalize.ts:20
↓ 7 callersFunctionfindFiles
(dir: string, match: (name: string) => boolean)
plugins/helpers.ts:62
↓ 7 callersFunctionshowCommandResult
(ctx: ExtensionCommandContext, message: string, success: boolean)
plugins/pi/index.ts:849
↓ 6 callersFunctionparseJsonlString
(content: string)
plugins/helpers.ts:95
↓ 5 callersMethodlistSessions
List available session references.
core/index.ts:84
↓ 5 callersFunctionmakeSession
(messages: Array<{ role: string; content: string }>)
tests/core/redactor.test.ts:99
↓ 5 callersFunctionsessionIdFromPath
(filePath: string)
plugins/helpers.ts:113
↓ 4 callersFunctioncreateUiContext
(notifications: Notification[])
tests/plugins/pi-extension.test.ts:26
↓ 4 callersFunctiondirExists
(path: string)
plugins/helpers.ts:33
↓ 4 callersFunctionfileExists
(path: string)
plugins/helpers.ts:42
↓ 4 callersFunctionformat
( sessions: ReadonlyArray<SanitizedSession>, formatType: ExportFormat, )
core/data-processing/formatters.ts:27
↓ 4 callersMethodloadSession
Load a session by reference (file path, session ID, "current", etc.).
core/index.ts:82
↓ 4 callersFunctionmaybeFallbackToAllSessions
( ctx: ExtensionCommandContext, message: string, prompt: string, )
plugins/pi/index.ts:674
↓ 4 callersFunctionparseFormats
Parse export format list from user input.
plugins/pi/index.ts:798
↓ 4 callersFunctionqueryDb
* Run a sqlite3 query and return parsed JSON rows. * Uses `-json` output mode so each row is a JSON object.
plugins/opencode/index.ts:32
↓ 4 callersFunctionrunLocalExport
( args: string, currentSessionFile?: string, scopeOverride?: ExportScope, )
plugins/pi/index.ts:480
↓ 4 callersFunctionrunPublicExport
( args: string, currentSessionFile?: string, scopeOverride?: ExportScope, )
plugins/pi/index.ts:532
↓ 4 callersFunctiontokenize
(raw: string)
plugins/pi/index.ts:828
↓ 4 callersFunctionupload
(bundle: ExportBundle, config: UploadConfig)
core/uploads/uploader.ts:34
↓ 3 callersFunctionescapeSql
Escape a string for safe inclusion in a SQL literal.
plugins/opencode/index.ts:228
↓ 3 callersFunctionfindExistingDirs
(candidates: string[])
plugins/helpers.ts:54
↓ 3 callersFunctionloadFixtureSession
* Manually parse the Pi fixture since we can't import the plugin in tests * without the full module resolution chain.
tests/integration/pi.test.ts:13
↓ 3 callersFunctionmakeSessions
()
tests/core/formatters.test.ts:5
↓ 3 callersFunctionparseScopeFlag
(raw: string)
plugins/pi/index.ts:686
↓ 3 callersFunctionpostJson
( url: string, data: unknown, headers?: Record<string, string>, )
core/uploads/http-client.ts:23
↓ 3 callersFunctionqueryDb
(dbPath: string, sql: string)
plugins/hermes/index.ts:71
↓ 3 callersFunctionresolveExportScope
( rawArgs: string, ctx: ExtensionCommandContext, )
plugins/pi/index.ts:619
↓ 3 callersFunctionwriteBundle
(bundle: ExportBundle, outputDir: string)
core/data-processing/bundle.ts:60
↓ 2 callersFunctioncollectSanitizedPiSessions
( config: RuntimeConfig, scope: ExportScope, currentSessionFile?: string, )
plugins/pi/index.ts:591
↓ 2 callersFunctioncommit
()
core/uploads/uploader.ts:124
↓ 2 callersFunctionescapeSql
(value: string)
plugins/hermes/index.ts:243
↓ 2 callersFunctionformatExportMessage
( title: string, scope: ExportScope, sessions: ReadonlyArray<{ messages: ReadonlyArray<unknown> }>, sessio
plugins/pi/index.ts:775
↓ 2 callersFunctionfuzzTimestamp
* Fuzz a timestamp by a deterministic but unpredictable offset. * Uses a seed to ensure the same timestamp in the same session * gets the same fuzz
core/privacy/anonymizer.ts:215
↓ 2 callersFunctiongetDbPath
Path to the OpenCode SQLite database.
plugins/opencode/index.ts:23
↓ 2 callersFunctiongetDbPath
()
plugins/hermes/index.ts:66
↓ 2 callersFunctionnowTimestamp
()
plugins/pi/index.ts:845
↓ 2 callersFunctionprintHelp
()
cli.ts:189
↓ 2 callersFunctionreplaceAll
(text: string, search: string, replacement: string)
core/privacy/anonymizer.ts:229
↓ 2 callersFunctionresolveConfig
(partial?: PiBrainConfig)
core/configs/defaults.ts:72
↓ 2 callersFunctionresolveRuntimeConfig
()
plugins/pi/index.ts:744
↓ 2 callersFunctionrunDetector
Execute a single regex detector and collect all matches.
core/privacy/detectors.ts:127
↓ 2 callersFunctionsafeParse
Safely parse a JSON string, returning undefined on failure.
plugins/opencode/index.ts:233
↓ 2 callersFunctiontoIsoTimestamp
(value: number | null | undefined)
plugins/hermes/index.ts:237
↓ 1 callersFunctionanonymizePath
* Replace an absolute path with an anonymized version. * Strips home directory, username, and hostname components. * Preserves the last 2 path segme
core/privacy/anonymizer.ts:192
↓ 1 callersFunctionbuildStripList
* Build the list of strings to strip from all text fields. * Includes OS username, hostname, home directory, and any custom additions.
core/privacy/anonymizer.ts:149
↓ 1 callersFunctionclaudeEntriesToCanonical
(entries: unknown[], filePath: string)
plugins/claude/index.ts:103
↓ 1 callersFunctioncodexEntriesToCanonical
(entries: unknown[], filePath: string)
plugins/codex/index.ts:72
↓ 1 callersFunctionconvertAssistantMessage
* Convert an assistant message, extracting text from content blocks.
plugins/factory/index.ts:244
↓ 1 callersFunctionconvertUserMessage
* Convert a user message, splitting out any tool_result content blocks * into separate CanonicalMessages.
plugins/factory/index.ts:191
↓ 1 callersFunctioncreatePiApi
()
tests/plugins/pi-extension.test.ts:7
↓ 1 callersFunctiondeduplicateAndSort
* Remove overlapping spans (keep the earlier/longer one) and sort by start.
core/privacy/detectors.ts:152
↓ 1 callersFunctionestimateTokens
Estimate token count for a text (whitespace-split heuristic).
core/data-processing/chunker.ts:98
↓ 1 callersFunctionextractTextFromContent
* Extract text from a response_item content array. * Content blocks use {type: "input_text" | "output_text", text: string}.
plugins/codex/index.ts:60
↓ 1 callersFunctionfactoryEntriesToCanonical
* Convert Factory JSONL entries into a CanonicalSession. * Walks the entry tree from the leaf to the root to reconstruct * the active conversation b
plugins/factory/index.ts:83
↓ 1 callersFunctionfactoryMessageToCanonical
* Convert a single Factory message entry to one or more CanonicalMessages. * * Factory embeds tool results as content blocks inside user messages ra
plugins/factory/index.ts:172
↓ 1 callersFunctionfileNameToFormat
(fileName: string)
cli.ts:300
↓ 1 callersFunctionfindSplitPoint
* Find a good split point near `target` that doesn't break placeholders * or words when possible. Prefers paragraph > line > word boundaries.
core/data-processing/chunker.ts:63
↓ 1 callersFunctionformatChatMl
* ChatML format: tagged messages in a single text block per conversation. * Output is JSONL where each line has a "text" field with ChatML markup.
core/data-processing/formatters.ts:82
↓ 1 callersFunctionformatSessions
Sessions format: one full session object per JSONL line.
core/data-processing/formatters.ts:44
↓ 1 callersFunctionformatSftJsonl
* SFT-JSONL format: one conversation per line with a flat messages array. * Compatible with most fine-tuning frameworks (Unsloth, Axolotl, etc.)
core/data-processing/formatters.ts:57
↓ 1 callersFunctiongetClaudeProjectsDirs
()
plugins/claude/index.ts:47
↓ 1 callersFunctiongetCodexDirs
()
plugins/codex/index.ts:29
↓ 1 callersFunctiongetCursorExtractedDirs
()
plugins/cursor/index.ts:26
↓ 1 callersFunctiongetOS
()
plugins/helpers.ts:16
↓ 1 callersFunctiongetOrCreatePlaceholder
* Get an existing placeholder for a repeated value, or create a new one. * This ensures the same raw value always maps to the same placeholder * wit
core/privacy/redactor.ts:136
↓ 1 callersFunctionhashWithSalt
* Hash a value with a salt to produce a deterministic but unlinkable ID. * Output is 16 hex chars (64 bits) — enough uniqueness, not reversible.
core/privacy/anonymizer.ts:183
↓ 1 callersFunctionisSupportedFormat
(value: string)
plugins/pi/index.ts:824
↓ 1 callersFunctionloadSessionFromDb
(dbPath: string, sessionId: string)
plugins/opencode/index.ts:115
↓ 1 callersFunctionloadSessionFromDb
(dbPath: string, sessionId: string)
plugins/hermes/index.ts:109
↓ 1 callersFunctionmain
()
cli.ts:48
↓ 1 callersFunctionmain
()
scripts/run-harness.ts:20
↓ 1 callersFunctionnormalizeToolContent
(raw: string | null)
plugins/hermes/index.ts:225
↓ 1 callersFunctionparseExportAliasArgs
(raw: string)
plugins/pi/index.ts:700
↓ 1 callersFunctionparseExportArgs
Format and validate command arguments for `/dataset-export`.
plugins/pi/index.ts:225
↓ 1 callersFunctionparsePublicExportArgs
( raw: string, runtimeConfig: RuntimeConfig, )
plugins/pi/index.ts:329
↓ 1 callersFunctionparseToolCalls
(raw: string | null)
plugins/hermes/index.ts:215
↓ 1 callersFunctionparseUploadArgs
(args: string[])
cli.ts:207
↓ 1 callersFunctionpiEntriesToCanonical
* Convert Pi JSONL entries into a CanonicalSession. * Walks the entry tree from the leaf to the root to reconstruct * the active conversation branch
plugins/pi/index.ts:865
↓ 1 callersFunctionpiMessageToCanonical
Convert a single Pi message to CanonicalMessage.
plugins/pi/index.ts:928
↓ 1 callersFunctionpromptForExportMode
(ctx: ExtensionCommandContext)
plugins/pi/index.ts:658
↓ 1 callersFunctionreadBundle
(bundleDir: string)
cli.ts:261
↓ 1 callersFunctionregisterPiCommands
(pi: ExtensionAPI)
plugins/pi/index.ts:64
↓ 1 callersFunctionreplaceSpans
* Replace detected spans in text with stable placeholders. * Builds replacements right-to-left to preserve offsets.
core/privacy/redactor.ts:97
↓ 1 callersFunctionresolveExportAlias
( rawArgs: string, ctx: ExtensionCommandContext, )
plugins/pi/index.ts:640
↓ 1 callersFunctionresolveSessionId
* Resolve a bare session ID (UUID) to its JSONL file path. * First checks the sessions-index.json for a quick lookup, then falls * back to scanning
plugins/factory/index.ts:68
↓ 1 callersFunctionreview
( chunks: ReadonlyArray<TextChunk>, config: Required<ReviewerConfig>, )
core/privacy/reviewer.ts:45
↓ 1 callersFunctionreviewSingleChunk
Send a single chunk for review and parse the JSON response.
core/privacy/reviewer.ts:70
↓ 1 callersFunctionrunExport
(args: string[])
cli.ts:74
↓ 1 callersFunctionrunList
(args: string[])
cli.ts:165
↓ 1 callersFunctionrunUpload
(args: string[])
cli.ts:142
↓ 1 callersFunctionuploadMultipart
( url: string, fileName: string, content: string, fields?: Record<string, string>, headers?: Record<strin
core/uploads/http-client.ts:45
↓ 1 callersFunctionuploadToHttp
Upload to a generic HTTP endpoint.
core/uploads/uploader.ts:279
↓ 1 callersFunctionuploadToHuggingFace
Upload to a Hugging Face dataset repository.
core/uploads/uploader.ts:62
next →1–100 of 123, ranked by callers