Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/bunkerlab-net/mempalace
/ functions
Functions
2,248 in github.com/bunkerlab-net/mempalace
⨍
Functions
2,248
◇
Types & classes
117
↓ 3 callers
Function
http_post_json
POST JSON to `url` and return the parsed response body as a [`Value`]. Sets `Content-Type: application/json` and any `extra_headers`. Maps ureq trans
src/llm/client.rs:569
↓ 3 callers
Method
is_filed
Return `true` if `source_file` chunk `chunk_index` is already in the palace. Callers use this to skip re-extraction of content that has not changed.
src/sources/context.rs:55
↓ 3 callers
Function
layer0
Layer 0: Identity text from `$XDG_DATA_HOME/mempalace/identity.txt`.
src/palace/layers.rs:30
↓ 3 callers
Function
make_detected_dict
( people: &[&str], uncertain: &[&str], )
src/palace/entity_detect.rs:1959
↓ 3 callers
Function
maybe_migrate_move_file
Move a single file, trying rename first, falling back to copy + delete. Rename is fast and atomic on the same filesystem. Copy + delete handles cross
src/config.rs:586
↓ 3 callers
Function
mine_convos_print_header
Print the mine-convos progress header to stdout.
src/palace/convo_miner.rs:436
↓ 3 callers
Function
mine_extract_entities_for_metadata
Extract entity names from a file for per-drawer metadata annotation. Called by `mine_process_file_one` to surface named entities (people and projects
src/palace/miner.rs:399
↓ 3 callers
Function
mine_get_mtime
Read the modification time of `filepath` as seconds since the Unix epoch. Called by `mine_process_file_one` to stamp all chunks from the same file wi
src/palace/miner.rs:382
↓ 3 callers
Function
mine_shell_quote
Wrap a path in single quotes for safe shell re-use in a resume hint. Single quotes in the path itself are escaped via `'"'"'`. Called by `mine_proces
src/palace/miner.rs:516
↓ 3 callers
Function
normalize_name
(name: &str)
src/palace/room_detect.rs:112
↓ 3 callers
Method
on_item_start
(&mut self, _source_file: &str)
src/sources/context.rs:29
↓ 3 callers
Function
onboarding_ask_projects
Collect project names from stdin until the user enters an empty line. Returns up to `PROJECTS_LIMIT` project name strings.
src/cli/onboarding.rs:264
↓ 3 callers
Function
onboarding_prompt_detected
Prompt the user to add auto-detected candidates to the people list. Shows each candidate's name and confidence, then asks (p)erson or (s)kip.
src/cli/onboarding.rs:412
↓ 3 callers
Function
onboarding_scan_directory
Scan `directory` for entity candidates not already in `known_people`. Returns only candidates whose confidence meets `DETECT_CONFIDENCE_MIN`.
src/cli/onboarding.rs:376
↓ 3 callers
Function
onboarding_seed_registry
Merge people and projects into the global known-entities registry. Returns the path written so the caller can display it to the user.
src/cli/onboarding.rs:493
↓ 3 callers
Function
onboarding_warn_ambiguous
Return people whose names clash with common English words. Used to surface an ambiguity warning so the user understands the risk.
src/cli/onboarding.rs:478
↓ 3 callers
Function
onboarding_write_aaak_entities_file
Write `aaak_entities.md` — the AAAK entity code registry.
src/cli/onboarding.rs:660
↓ 3 callers
Function
onboarding_write_critical_facts_file
Write `critical_facts.md` — the pre-palace facts bootstrap.
src/cli/onboarding.rs:724
↓ 3 callers
Function
open_file_db
Open a file-backed turso database at `path`, apply the schema, and return `(Database, Connection)`. `repair::run` requires a real filesystem path bec
src/cli/repair.rs:132
↓ 3 callers
Function
parse_go_mod
Parse a `go.mod` and return the last path segment of the `module` directive. For `module github.com/owner/my-project` this returns `"my-project"`.
src/palace/project_scanner.rs:319
↓ 3 callers
Function
parse_pyproject_toml
Parse a `pyproject.toml` and return the project name. Checks `project.name` (PEP 621) first, then `tool.poetry.name` as a fallback.
src/palace/project_scanner.rs:279
↓ 3 callers
Function
parse_results_nonzero
Parse `--results` for `WakeUp`, rejecting zero as invalid.
src/cli/mod.rs:375
↓ 3 callers
Function
query_entity_row_to_fact
Extract a Fact from a query row (columns: subject, predicate, object, `valid_from`, `valid_to`, confidence, `joined_name`).
src/kg/query.rs:49
↓ 3 callers
Function
query_stats
Return aggregated palace statistics without printing anything. Callers such as `cli::status::run` and MCP tools use this instead of issuing direct da
src/palace/stats.rs:144
↓ 3 callers
Function
rebuild_index
Rebuild the full-text inverted word index from all drawer content. Wraps the full operation in a `BEGIN IMMEDIATE` transaction. Returns the number of
src/palace/repair.rs:108
↓ 3 callers
Function
refine_entities_collect_candidates
Collect `(name, entity_type)` pairs from all three categories of `detected`. Called by [`refine_entities`] to build the batching input.
src/llm/refine.rs:230
↓ 3 callers
Method
research
Research an unknown word, optionally via a Wikipedia outbound request. By default this is **local-only**: checks the wiki cache and returns `"unknown
src/palace/entity_registry.rs:434
↓ 3 callers
Function
run
Run the compress command: compress drawers into AAAK dialect format.
src/cli/compress.rs:163
↓ 3 callers
Function
run_compress_row
Compress one drawer row and persist or preview it. Returns `(original_bytes, compressed_bytes, original_tokens, compressed_tokens)`. Token counts are
src/cli/compress.rs:89
↓ 3 callers
Function
run_detect_corpus_origin
Run Pass 0 corpus-origin detection on the project directory. Tier 1 (heuristic) always runs. Tier 2 (LLM) runs only when `llm_opts` is enabled, a pro
src/cli/init.rs:185
↓ 3 callers
Function
run_detect_corpus_origin_llm
Optionally upgrade a heuristic result with LLM-tier detection, then merge. Merges field-by-field: `likely_ai_dialogue`/`confidence` from heuristic; `
src/cli/init.rs:226
↓ 3 callers
Function
run_discover_entities
Discover entities from manifest files, git history, and Claude Code sessions. Returns the raw `ProjectInfo` list (for wing-name derivation) and the m
src/cli/init.rs:282
↓ 3 callers
Function
run_git
Run `git -C <cwd> <args>` and return stdout on success, or an empty string on error. No hard timeout is enforced: `std::process::Command` is synchron
src/palace/project_scanner.rs:364
↓ 3 callers
Function
run_load_dialect
Load dialect from an optional config file, or return an empty dialect.
src/cli/compress.rs:8
↓ 3 callers
Function
run_persist_lang
Persist `lang` codes to the global `MempalaceConfig::entity_languages`. Called by [`run`] when `--lang` is provided. Failures are non-fatal: a full-d
src/cli/init.rs:730
↓ 3 callers
Function
run_status
Handle the `status` sub-command — opens the palace if it exists. `palace_override` takes priority over env vars and config, matching the `--palace` C
src/app.rs:421
↓ 3 callers
Function
run_to_writer
Write the L0/L1 (and optional L2/L3) wake-up layers to `out`. Extracted so tests can capture the rendered text. The caller is responsible for flushin
src/cli/wakeup.rs:36
↓ 3 callers
Function
sanitized
(clean_query: String, original_length: usize, method: &'static str)
src/palace/query_sanitizer.rs:110
↓ 3 callers
Function
scan
Scan `root` for projects (via manifests and git repos) and people (via git authors). Returns `(projects, people)` sorted by relevance — own projects
src/palace/project_scanner.rs:898
↓ 3 callers
Function
scan_no_git_fallback
Handle the no-git-repo case: scan `root` directly for manifests. Called by [`scan`] to keep that function within the 70-line limit.
src/palace/project_scanner.rs:864
↓ 3 callers
Function
score_entity
Compute person and project signal scores for `name` against `text` and `lines`. `pronoun_re` is the locale pronoun regex from `detect_entities_build_
src/palace/entity_detect.rs:635
↓ 3 callers
Function
score_entity_person_pronoun_score
Called by `score_entity_person` to keep that function within the 70-line limit. Scan `lines` for lines containing `name` and count how many have a pr
src/palace/entity_detect.rs:487
↓ 3 callers
Function
score_markers
Score pre-lowercased text against pre-compiled regex markers. Callers must pass an already-lowercased string; this function does not lowercase intern
src/extract/mod.rs:141
↓ 3 callers
Function
search_expand_neighbors
Fetch adjacent chunks from the same source file for context expansion. Returns drawers whose `source_file` matches `source_path` and whose `chunk_ind
src/palace/search.rs:122
↓ 3 callers
Function
search_memories_apply_closet_boost
Apply per-source-file closet rank boosts to `results` in place. Called by [`search_memories`] when [`closets::search_closet_boost`] returns a non-emp
src/palace/search.rs:636
↓ 3 callers
Function
search_memories_compute_idf
( candidates: &[Candidate], tf_data: &HashMap<String, HashMap<String, i64>>, words: &[String], )
src/palace/search.rs:348
↓ 3 callers
Function
seed_graph
(connection: &Connection)
src/palace/graph.rs:965
↓ 3 callers
Method
source_summary
(&self, _source: &SourceRef)
src/sources/registry.rs:124
↓ 3 callers
Function
split_file_write_session_cap_subject
Truncate `subject` so its byte length does not exceed `byte_cap`. Walks characters to avoid splitting a multi-byte UTF-8 sequence that byte-slicing w
src/cli/split.rs:226
↓ 3 callers
Function
stop_words
Common stop words to exclude from topic extraction.
src/dialect/topics.rs:16
↓ 3 callers
Function
sweep_directory
Sweep every `.jsonl` file in a directory tree into the palace. Individual file failures are logged to stderr and do not abort the sweep — a partial f
src/palace/sweeper.rs:465
↓ 3 callers
Function
sweep_load_cursors
Query the set of drawer IDs already swept for each session in `session_ids`. Drawer IDs for swept messages follow the pattern `"sweep_{session_id}_{u
src/palace/sweeper.rs:271
↓ 3 callers
Function
t
Translate a key using the active locale, with `{name}` variable interpolation. Key format: `"section.subkey"` (e.g. `"cli.mine_start"`) or a bare sub
src/i18n/mod.rs:214
↓ 3 callers
Function
tail_guard
Return the last [`QUERY_LEN_MAX`] chars of `text`.
src/palace/query_sanitizer.rs:122
↓ 3 callers
Function
temporal_start_key
Return the comparable instant for a `valid_from`-style temporal value. Date-only inputs are widened to the start of the day so a date-only `valid_fro
src/kg/mod.rs:35
↓ 3 callers
Function
tool_check_duplicate
Check whether content is a near-duplicate of an existing drawer.
src/mcp/tools.rs:569
↓ 3 callers
Function
tool_check_facts
Check `text` for entity confusion and KG contradictions. Returns `issues` — a list of detected problems — or an empty list when clean. Each issue has
src/mcp/tools.rs:1791
↓ 3 callers
Function
tool_definitions
()
src/mcp/protocol.rs:34
↓ 3 callers
Function
tool_delete_drawer
Delete a drawer and its inverted-index entries by ID.
src/mcp/tools.rs:702
↓ 3 callers
Function
tool_find_tunnels
Find rooms that bridge two wings, optionally filtering by wing names.
src/mcp/tools.rs:1372
↓ 3 callers
Function
tool_follow_tunnels
Return all explicit tunnel connections from a given wing and room.
src/mcp/tools.rs:1500
↓ 3 callers
Function
tool_get_taxonomy
Return the full wing → room → drawer-count taxonomy tree.
src/mcp/tools.rs:480
↓ 3 callers
Function
tool_graph_stats
Return aggregate statistics about the palace graph (room count, tunnel count, etc.).
src/mcp/tools.rs:1389
↓ 3 callers
Function
tool_hook_settings
Get or set the hook behavior settings (`hook_silent_save`, `hook_desktop_toast`). Call with no arguments to read current settings. Pass one or both b
src/mcp/tools.rs:1680
↓ 3 callers
Function
tool_kg_invalidate
End-date a knowledge-graph triple by setting its `valid_to` field.
src/mcp/tools.rs:1276
↓ 3 callers
Function
tool_kg_stats
Return aggregate statistics for the knowledge graph (entity count, triple count, etc.).
src/mcp/tools.rs:1350
↓ 3 callers
Function
tool_list_rooms
Return rooms and their drawer counts, optionally filtered by wing.
src/mcp/tools.rs:443
↓ 3 callers
Function
tool_list_wings
Return all wings with their drawer counts.
src/mcp/tools.rs:420
↓ 3 callers
Function
tool_reconnect
Confirm palace database connectivity and return the current drawer count. On turso/SQLite there is no in-memory HNSW index to invalidate, so this too
src/mcp/tools.rs:1771
↓ 3 callers
Function
tool_status
Return a summary of all wings, rooms, and total drawer count.
src/mcp/tools.rs:384
↓ 3 callers
Function
tool_traverse
BFS-traverse the palace graph from a starting room up to `max_hops` hops.
src/mcp/tools.rs:1358
↓ 3 callers
Function
topic_tunnels_for_wing
Compute topic tunnels involving a single wing only. Used by the miner to incrementally update tunnels for the wing that just finished mining without
src/palace/graph.rs:906
↓ 3 callers
Function
utf8_replace_invalid
Replace invalid UTF-8 byte sequences with the Unicode replacement character (U+FFFD). Valid UTF-8 input is returned unchanged. Adapters should apply
src/sources/transforms.rs:15
↓ 3 callers
Function
validate_content
Validate that `content` is non-empty after the standard RFC-002 §1.4 transforms. Returns `Err(TransformationViolation(...))` if the content would be
src/sources/transforms.rs:86
↓ 3 callers
Function
wake_up
Generate full wake-up text (L0 + L1).
src/palace/layers.rs:239
↓ 3 callers
Function
walk_dir
(directory: &Path, files: &mut Vec<PathBuf>)
src/palace/miner.rs:172
↓ 2 callers
Function
add_to_known_entities_load
Load the existing registry as a JSON object, or return an empty object. Returns an empty `Map` if the file is absent, unreadable, malformed, or not a
src/palace/known_entities.rs:175
↓ 2 callers
Method
api_key_source
(&self)
src/cli/closet_llm.rs:161
↓ 2 callers
Function
apply_classifications_route_entity
Route a single entity to the correct output bucket based on the LLM decision. Entities without a matching decision retain their original category. Ca
src/llm/refine.rs:521
↓ 2 callers
Function
available_languages
Return all available locale language codes. Codes are the canonical lowercase stems used in `get_entity_patterns` and `t`, e.g. `"en"`, `"de"`, `"pt-
src/i18n/mod.rs:167
↓ 2 callers
Method
browse
Return on-demand L2 drawer recall scoped to `wing` and/or `room`.
src/palace/stack.rs:44
↓ 2 callers
Function
build_user_prompt
Build the user prompt for one batch. Lists each candidate with its detected type and corpus context snippets. Called by [`refine_entities_batch`].
src/llm/refine.rs:277
↓ 2 callers
Function
chunk_by_exchange_floor_char_boundary
Return the largest byte index ≤ `index` that is a UTF‑8 char boundary in `s`. Slicing `text` by a raw byte offset is unsafe when the string contains
src/palace/convo_miner.rs:172
↓ 2 callers
Function
collect_manifest_names
Return `(manifest_filename, project_name, dir)` triples for manifests within `repo_root`. Does not descend into nested git repositories. Results are
src/palace/project_scanner.rs:579
↓ 2 callers
Function
detect_entities_sort_and_truncate
Called by `detect_entities` to keep that function within the 70-line limit. Sort each result list by descending confidence (people, projects) or desc
src/palace/entity_detect.rs:192
↓ 2 callers
Function
detect_origin_heuristic_count_terms
Count occurrences of each term (case-insensitive) in `combined`. Called by [`detect_origin_heuristic`] separately for unambiguous and ambiguous term
src/palace/corpus_origin.rs:202
↓ 2 callers
Function
diary_ingest_file_purge_drawer
Called by `diary_ingest_file` when `--force` is set so `add_drawer` (INSERT OR IGNORE) refreshes existing diary content instead of silently no-op'ing
src/palace/diary_ingest.rs:480
↓ 2 callers
Function
diary_ingest_file_purge_orphans
Called by `diary_ingest_file` to delete drawers for sections that no longer exist in the source file. Iterates the open range `current_count..previou
src/palace/diary_ingest.rs:448
↓ 2 callers
Function
drawer_count
Count all rows in the `drawers` table without touching the word index. Returns `None` when the query fails (schema drift, closed connection). Callers
src/palace/repair.rs:25
↓ 2 callers
Function
emotion_signals
Keyword → emotion code signals for plain-text detection.
src/dialect/emotions.rs:54
↓ 2 callers
Function
entity_registry_path
Returns the path to `entity_registry.json` in the mempalace config directory. Respects `MEMPALACE_DIR` and XDG conventions via [`config_dir`].
src/palace/entity_registry.rs:332
↓ 2 callers
Function
entity_registry_path_in
Resolve the registry path inside `dir`, mirroring `entity_registry_path()` under a `MEMPALACE_DIR` override.
src/palace/entity_registry.rs:1435
↓ 2 callers
Function
export_group_by_room
Group drawer rows into a `BTreeMap<(wing, room), Vec<(filed_at, content)>>`.
src/palace/exporter.rs:211
↓ 2 callers
Function
file_already_mined
Check whether a file has already been mined *and is unchanged* since it was last filed. Returns `false` (triggering a re-mine) when: - No drawer for
src/palace/drawer.rs:138
↓ 2 callers
Function
file_mtime
Return the modification time of a file as seconds since the Unix epoch. Returns `None` when the file cannot be stat-ed or the platform does not suppo
src/palace/drawer.rs:121
↓ 2 callers
Function
find_git_repos
Return all git repository roots under `root` (including `root` itself if it is a repo). Nested repos (submodules, monorepo children) are discovered b
src/palace/project_scanner.rs:498
↓ 2 callers
Function
find_tunnels
( connection: &Connection, wing_a: Option<&str>, wing_b: Option<&str>, )
src/palace/graph.rs:267
↓ 2 callers
Function
flag_signals
Keyword → flag signals for plain-text detection.
src/dialect/emotions.rs:82
↓ 2 callers
Function
get_entity_patterns_merge_section
Merge one locale's entity section into the running accumulator.
src/i18n/mod.rs:276
↓ 2 callers
Function
get_entity_patterns_resolve_locale
Resolve a language code (case-insensitive) to its raw JSON string, if found.
src/i18n/mod.rs:267
← previous
next →
301–400 of 2,248, ranked by callers