MCPcopy Create free account

hub / github.com/bunkerlab-net/mempalace / functions

Functions2,248 in github.com/bunkerlab-net/mempalace

↓ 4 callersFunctiondedupe_people
Group commits by identity: two commits are the same person when they share a name OR email. Display name is the most-frequent name variant that `look
src/palace/project_scanner.rs:722
↓ 4 callersFunctiondedupe_vec
Remove duplicates from a list while preserving first-occurrence order.
src/i18n/mod.rs:303
↓ 4 callersMethoddescribe_schema
(&self)
src/sources/registry.rs:118
↓ 4 callersFunctiondetect_hall
Detect the "hall" — the top-level subdirectory within the project containing the file. Hall is the second-level grouping between wing (the whole proj
src/palace/miner.rs:221
↓ 4 callersFunctiondetect_rooms_from_folders
Detect rooms from the folder structure of a project directory.
src/palace/room_detect.rs:121
↓ 4 callersFunctiondiary_ingest_parse_sections
Split diary text on `## ` H2 headers. Returns a list of `(header_line, body)` pairs. If the file has no `## ` headers the entire text is returned as
src/palace/diary_ingest.rs:564
↓ 4 callersFunctionentity_registry_wikipedia_classify_entry
Build a `WikiCacheEntry` with the common fields pre-filled. All four classification paths in [`entity_registry_wikipedia_classify`] produce the same
src/palace/entity_registry.rs:1204
↓ 4 callersFunctionentity_registry_wikipedia_error
Build a `WikiCacheEntry` representing a network failure or parse error. Called by [`entity_registry_wikipedia_lookup`] for any non-404 error path.
src/palace/entity_registry.rs:1182
↓ 4 callersFunctionexport_palace
Export palace drawers to `output_dir`, one markdown file per wing/room. When `wing` is `Some`, only drawers in that wing are exported. When `dry_run`
src/palace/exporter.rs:103
↓ 4 callersFunctionextract_cwd_from_session
Read one JSONL session file and return the `cwd` field from the first record that has one. Returns `None` if the file cannot be opened, has no parsab
src/palace/session_scanner.rs:173
↓ 4 callersMethodextract_people_from_query
Extract known person names from a search query string. Uses word-boundary regex matching. Ambiguous names are only included when context patterns con
src/palace/entity_registry.rs:594
↓ 4 callersFunctionflatten_content
Normalise Claude Code message content to a plain string. User messages are plain strings; assistant messages are a list of content blocks (`text`, `t
src/palace/sweeper.rs:119
↓ 4 callersFunctionhandle_request_tools_call_respond
Build a sanitized JSON-RPC response from a raw tool dispatch result. Sanitize: only expose errors that tools explicitly mark as public. All other err
src/mcp/mod.rs:401
↓ 4 callersFunctionhook_count_messages
Count human messages in a JSONL transcript, skipping command-messages.
src/cli/hook.rs:453
↓ 4 callersFunctionhook_ingest_transcript_sync
Synchronously run `mempalace mine <transcript_parent> --mode convos`. Used by the precompact hook so the transcript ingest finishes BEFORE the harnes
src/cli/hook.rs:1008
↓ 4 callersFunctionhook_parse_input
Parse and sanitize hook input from the stdin JSON payload.
src/cli/hook.rs:130
↓ 4 callersFunctionhook_read_last_save
Read the last-save message count from the session state file.
src/cli/hook.rs:637
↓ 4 callersMethodingest
(&self, _source: &SourceRef)
src/sources/registry.rs:115
↓ 4 callersFunctioninvalid_iso_temporal
(field_name: &str, value: &str)
src/config.rs:266
↓ 4 callersFunctioninvalidate
Mark a relationship as ended (set `valid_to`). Invalidate (end-date) matching triples and return the date that was stored.
src/kg/mod.rs:883
↓ 4 callersFunctionis_hex_sha
Return `true` if every byte in `s` is an ASCII hex digit (`0-9`, `a-f`, `A-F`). Empty strings return `false`. Used to validate SHA strings so that ma
build.rs:61
↓ 4 callersFunctionlayer2_empty_label
Build a parenthetical filter label for the layer2 empty message.
src/palace/layers.rs:356
↓ 4 callersFunctionlayer3
Layer 3: Deep keyword search across the full palace. Delegates to the inverted-index search (`palace::search::search_memories`) and formats the resul
src/palace/layers.rs:369
↓ 4 callersFunctionmake_entity
(name: &str, entity_type: &str)
src/llm/refine.rs:618
↓ 4 callersFunctionmine_opts
(wing: Option<&str>)
src/palace/miner.rs:1683
↓ 4 callersFunctionmine_print_summary
( dry_run: bool, file_count: usize, files_skipped: usize, files_unreadable_or_too_short: usize
src/palace/miner.rs:274
↓ 4 callersFunctionmine_read_file
Read a file's content, falling back to lossy UTF-8 on binary files. Returns `None` if the file is unreadable or too short to be useful.
src/palace/miner.rs:363
↓ 4 callersFunctionmine_resume_command
Reconstruct the user's `mempalace mine` invocation from `opts` and `project_dir`, suitable for printing in the Ctrl-C resume hint. Only non-default f
src/palace/miner.rs:532
↓ 4 callersFunctionnewline_normalize
Normalize line endings to `\n` only. Converts CRLF (`\r\n`) and bare CR (`\r`) to LF (`\n`). Adapters should apply this early so downstream code can
src/sources/transforms.rs:38
↓ 4 callersFunctionnormalize_wing
Normalize a wing slug: trim whitespace, then apply the canonical slug rule. Callers that filter by wing name must normalize before querying so that "
src/palace/graph.rs:72
↓ 4 callersFunctiononboarding_ask_wings
Show the default wings for the selected mode and allow the user to override. The user may accept the defaults (enter) or type comma-separated names.
src/cli/onboarding.rs:292
↓ 4 callersFunctiononboarding_readline_yn
Print a yes/no prompt and return true for yes, false for no. The default answer is used when the user presses enter without input.
src/cli/onboarding.rs:838
↓ 4 callersFunctionparse_claude_jsonl_record
Parse one JSONL record into a `SweepMessage`, or `None` if not applicable. Non-message record types (progress, file-history-snapshot, system, queue-o
src/palace/sweeper.rs:147
↓ 4 callersFunctionprint_report
Pretty-print a `SyncReport` to stdout, matching the Python CLI banner shape.
src/cli/sync.rs:398
↓ 4 callersFunctionquery_relationship
Query all facts for a given subject and predicate across all object entities. Returns every triple (active and expired) where the subject entity matc
src/kg/query.rs:187
↓ 4 callersFunctionrebuild_index_insert_drawers
Add `count` minimal drawers to the connection, bypassing the normal `add_drawer` validation so tests can control the exact row count easily.
src/palace/repair.rs:247
↓ 4 callersFunctionregistry_path
Returns the path to the global known-entities registry file. Resolves via `config_dir()`, which respects `MEMPALACE_DIR` and XDG conventions.
src/palace/known_entities.rs:36
↓ 4 callersMethodresolve_url
Resolve the `/v1/chat/completions` URL from the raw endpoint string. Handles endpoints supplied with or without the `/v1` suffix and with or without
src/llm/client.rs:268
↓ 4 callersFunctionresume_opts
()
src/palace/miner.rs:1512
↓ 4 callersFunctionrun
Run the `sweep` subcommand. Sweeps a single `.jsonl` file or every `.jsonl` in a directory tree, inserting one drawer per user/assistant message that
src/cli/sweep.rs:19
↓ 4 callersFunctionrun
Run the `dedup` command. Reports stats whether or not `dry_run` is set. In dry-run mode no drawers are deleted.
src/cli/dedup.rs:16
↓ 4 callersFunctionrun_compute_total_bytes
Sum the byte sizes of every file in `files`, skipping those whose metadata cannot be read. Called by [`run`] to compute the size label shown in the i
src/cli/init.rs:536
↓ 4 callersFunctionrun_parse_request
Parse a JSON-RPC request from a trimmed line of text. Returns `Ok(Value)` on success, or `Err(Value)` containing a JSON-RPC parse-error response read
src/mcp/mod.rs:100
↓ 4 callersFunctionrun_setup_llm
Build an [`LlmProvider`] from `opts` and probe its availability. Returns `None` when the provider is disabled, unreachable, or declined by the privac
src/cli/init.rs:412
↓ 4 callersFunctionrun_write_response
Serialize `response` and write it as a newline-terminated frame to `stdout`.
src/mcp/mod.rs:112
↓ 4 callersFunctionsanitize_path_component
Sanitize a string for use as a path component. Replaces `/`, `\`, `:`, `*`, `?`, `"`, `<`, `>`, `|`, and control characters with underscores to produ
src/palace/exporter.rs:303
↓ 4 callersFunctionscore_entity_project
Score project-related signals for `escaped` against `text`: build/deploy verbs and versioned references.
src/palace/entity_detect.rs:585
↓ 4 callersFunctionsearch_closet_boost
Return a multiplicative closet rank-boost per source file. Queries the `compressed` table for entries whose `source_file` is in `source_paths` and wh
src/palace/closets.rs:120
↓ 4 callersFunctionsearch_memories_collect_sources
Collect unique, non-empty source paths from `results`. Called by [`search_memories`] to assemble the path list for [`closets::search_closet_boost`].
src/palace/search.rs:610
↓ 4 callersFunctionseed_drawer
(connection: &Connection)
src/cli/compress.rs:295
↓ 4 callersFunctionsplit_collect_txt_files
Collect `.txt` file paths from the top level of `directory`. When `respect_gitignore` is `true`, files excluded by `.gitignore` rules are omitted (sa
src/cli/split.rs:66
↓ 4 callersFunctionsplit_into_segments
Split `text` into segments for memory extraction.
src/extract/mod.rs:343
↓ 4 callersFunctionstrip_control_chars
Remove ASCII control characters except horizontal tab (`\t`) and newline (`\n`). All non-ASCII bytes are preserved so multi-byte UTF-8 sequences are
src/sources/transforms.rs:59
↓ 4 callersMethodsummary
Returns a human-readable summary of the registry contents.
src/palace/entity_registry.rs:640
↓ 4 callersFunctionsweep_make_drawer_id
Build the deterministic drawer ID for a swept message. Uses the full `session_id` (not a prefix) to avoid cross-session collision risk when session i
src/palace/sweeper.rs:244
↓ 4 callersFunctiont_resolve_key
Resolve a dotted-path key (`"section.subkey"` or bare `"subkey"`) against the string tables for the given locale. Returns `None` when the locale or k
src/i18n/mod.rs:314
↓ 4 callersFunctiontest_pronoun_re
Return a compiled English pronoun regex for use in tests that call `score_entity` directly. Production code builds this via `detect_entities_build_pr
src/palace/entity_detect.rs:860
↓ 4 callersFunctiontool_confirm_entity
Confirm a previously researched word as a specific entity type. When `entity_type` is `"person"`, the word is added to the people registry with `CONF
src/mcp/tools.rs:1863
↓ 4 callersFunctiontool_create_tunnel
Create an explicit (agent-annotated) tunnel linking two palace locations.
src/mcp/tools.rs:1397
↓ 4 callersFunctiontool_get_drawer
Fetch a single drawer by ID, returning its full content and metadata.
src/mcp/tools.rs:732
↓ 4 callersFunctiontool_kg_timeline
Return all knowledge-graph facts sorted by validity date, optionally filtered by entity.
src/mcp/tools.rs:1323
↓ 4 callersFunctiontool_list_tunnels
Return all explicit tunnels, optionally filtered to those involving a specific wing.
src/mcp/tools.rs:1466
↓ 4 callersFunctiontool_memories_filed_away
Acknowledge the latest silent-mode checkpoint written by the stop hook. Reads and deletes `hook_state/last_checkpoint`. Returns message count and tim
src/mcp/tools.rs:1722
↓ 4 callersFunctiontool_research_entity
Look up a word in the entity registry; optionally research it via Wikipedia. Checks the local registry first via [`EntityRegistry::lookup`]. Only que
src/mcp/tools.rs:1811
↓ 4 callersFunctionvalidate_schema_conformance
Validate that `record` satisfies all required fields declared in `schema` (RFC-002 §5.2). Returns `Err(SchemaConformance(...))` naming the first abse
src/sources/adapter.rs:135
↓ 3 callersFunctionassistant_record
Build a minimal valid Claude Code assistant record with a text block.
src/palace/sweeper.rs:552
↓ 3 callersFunctionavailable_adapters
Return a sorted list of all registered adapter names.
src/sources/registry.rs:69
↓ 3 callersFunctionbrand_pattern
Build a word-boundary-aware regex string for a brand term. Attaches `\b` only on edges where the term itself starts or ends with a word character (al
src/palace/corpus_origin.rs:178
↓ 3 callersFunctioncanonical_tunnel_id
Compute the canonical tunnel ID from two endpoints. Tunnels are undirected — sort the two endpoint strings before hashing so `canonical_tunnel_id(A,
src/palace/graph.rs:405
↓ 3 callersMethodcheck_available
(&self)
src/cli/closet_llm.rs:151
↓ 3 callersFunctioncheck_text
Check `text` for entity confusion and KG contradictions. Returns an empty vec when no issues are detected. The checker is deliberately conservative:
src/palace/fact_checker.rs:80
↓ 3 callersFunctioncheck_text_entity_confusion_pair
Called by `check_text_entity_confusion` to build a canonical dedup key for a name pair. Normalises order so (a, b) and (b, a) produce the same key, p
src/palace/fact_checker.rs:214
↓ 3 callersFunctionchunk_by_exchange_drain_ai_lines
Drain AI response lines from `lines` starting at `start_index`. Collects non-empty lines until a new user turn (`>`) or separator (`---`) is found.
src/palace/convo_miner.rs:191
↓ 3 callersFunctioncollect_contexts
Return up to [`MAX_CONTEXT_SNIPPETS`] trimmed lines from `corpus_lines` containing `name`. Matching is case-insensitive. Called by [`build_user_promp
src/llm/refine.rs:312
↓ 3 callersFunctioncollect_messages
Extract (role, text) pairs from a message list and return a transcript. Accepts both `"role"` (API format) and `"sender"` (privacy export) as the aut
src/normalize/claude_ai.rs:72
↓ 3 callersFunctionconfig_path
Path to the global config file.
src/config.rs:297
↓ 3 callersFunctionconfirm_entities_prompt_name
Print a single `[person|project] "<name>" Accept? [Y/n]` prompt and read the response. Returns `true` if the user accepts (blank line, `y`, or `yes`)
src/palace/entity_confirm.rs:142
↓ 3 callersMethodcount_filed
Return the number of chunks already filed for `source_file`. Adapters use this to detect partially-ingested sources before deciding whether to re-ing
src/sources/context.rs:81
↓ 3 callersFunctiondecode_slug_fallback
Best-effort project name from a slug when no session has a readable `cwd`. The slug is lossy (`/` and `-` both map to `-`). The last non-empty segmen
src/palace/session_scanner.rs:202
↓ 3 callersFunctiondefault_palace_path
()
src/config.rs:42
↓ 3 callersFunctiondelete_tunnel
Delete an explicit tunnel by ID. Returns `true` if a row was deleted.
src/palace/graph.rs:672
↓ 3 callersFunctiondetect_emotions
Detect emotions from plain text using keyword signals.
src/dialect/mod.rs:99
↓ 3 callersMethoddetect_entities
(&self, text: &str)
src/dialect/mod.rs:273
↓ 3 callersFunctiondetect_entities_build_pronoun_re
Called by `detect_entities` to build the pronoun proximity regex from locale patterns. Joins all pronoun patterns from `EntityPatterns` into a single
src/palace/entity_detect.rs:172
↓ 3 callersFunctiondetect_entities_load_text
Called by `detect_entities` to load and concatenate file content. Reads up to `files_max` files from `file_paths`, truncating each at 5 000 bytes on
src/palace/entity_detect.rs:118
↓ 3 callersFunctiondetect_flags
Detect importance flags from plain text using keyword signals.
src/dialect/mod.rs:115
↓ 3 callersFunctiondisambiguate
Disambiguate memory type using sentiment and resolution.
src/extract/mod.rs:157
↓ 3 callersFunctionempty_origin
()
src/palace/entity_detect.rs:1948
↓ 3 callersFunctionextract_json
Pull the first JSON object out of a possibly-messy LLM response. Attempts straight parse first; falls back to a balanced-brace scanner that finds the
src/palace/corpus_origin.rs:300
↓ 3 callersFunctionextract_json_block_by_braces
Scan `text` for the outermost `{...}` block using brace-depth counting. No recursion — uses a `usize` depth counter. Called by [`extract_json_block`]
src/llm/refine.rs:369
↓ 3 callersFunctionextract_prose
Extract only prose lines (skip code blocks and code-like lines).
src/extract/mod.rs:316
↓ 3 callersFunctionextract_subject
Extract a subject from the first meaningful user prompt.
src/cli/split.rs:186
↓ 3 callersFunctionfollow_tunnels
Follow explicit tunnels from a room — returns connections to linked rooms. Optionally fetches a short preview of the drawer at the connected end when
src/palace/graph.rs:691
↓ 3 callersFunctionget_regex
Return a regex pattern from the active locale's `regex` section. Falls back to English when the key is absent in the current locale. Returns `None` i
src/i18n/mod.rs:238
↓ 3 callersFunctionhandle_request_tools_call_validate
Validate `tools/call` params and extract `(tool_name, tool_args)`. Returns `Ok((name, args))` when the params are well-formed, or `Err(response)` wit
src/mcp/mod.rs:360
↓ 3 callersFunctionhas_git_marker
Return `true` if `path` contains a `.git` directory or file (bare repo marker).
src/palace/project_scanner.rs:488
↓ 3 callersFunctionhook_is_silent_mode
Return `true` if the config has `hook_silent_save = true` (the default).
src/cli/hook.rs:632
↓ 3 callersFunctionhook_maybe_auto_ingest
Background-mine `MEMPAL_DIR` (project files) if set. Transcript convos are ingested separately via `hook_ingest_transcript` in the hook handlers. Kee
src/cli/hook.rs:777
↓ 3 callersFunctionhook_save_diary
Write a diary checkpoint for `session_id` to the palace DB. Returns `(message_count, themes)` on success, `(0, [])` on failure. Opens the DB using th
src/cli/hook.rs:362
↓ 3 callersFunctionhook_try_desktop_toast
Write the hook response JSON to stdout. Hooks communicate back to the harness via a single JSON object on stdout. Using `println!` ensures the output
src/cli/hook.rs:1113
← previousnext →201–300 of 2,248, ranked by callers