MCPcopy Create free account

hub / github.com/Einsia/OpenChronicle / functions

Functions450 in github.com/Einsia/OpenChronicle

Functionrecent_activity
**ALWAYS CALL** when the user references "yesterday / last week / earlier / 刚才 / 上周" etc. Newest-first cross-file feed of recent memory entri
src/openchronicle/mcp/server.py:411
Functionrecent_captures
Newest-first capture rows without keyword filtering — used by current_context.
src/openchronicle/store/fts.py:438
Functionreduce_all_pending
Unconditional catch-up: reduce every non-reduced ended/failed session. Called from the daily 23:55 safety-net. Covers ``ended`` rows whose as
src/openchronicle/writer/session_reducer.py:351
Functionreduce_session_async
Spawn a daemon thread that reduces the session. Fire-and-forget.
src/openchronicle/writer/session_reducer.py:296
Functionrender_file
( *, fm: dict[str, Any], entries: list[ParsedEntry], header_lines: list[str] | None = None )
src/openchronicle/store/files.py:237
Functionrender_heading
(*, timestamp: str, entry_id: str, tags: list[str])
src/openchronicle/store/files.py:232
Functionresume
Resume capture.
src/openchronicle/cli.py:185
Functionretry_due
Pick up any ``failed`` session rows whose ``next_retry_at`` has elapsed.
src/openchronicle/writer/session_reducer.py:330
Functionrun
(cfg: Config, *, capture_only: bool = False)
src/openchronicle/daemon.py:124
Functionrun
Reduce pending sessions, then classify each fresh event-daily entry.
src/openchronicle/writer/agent.py:31
Functionrun_async
Run the MCP server with the configured transport (for use inside the daemon).
src/openchronicle/mcp/server.py:608
Functionrun_check_cuts
Periodic check_cuts tick.
src/openchronicle/session/tick.py:129
Functionrun_classifier_tick
Periodic durable-fact classification for the active session. Every ``classifier.interval_minutes`` (min 5) checks for an active session and c
src/openchronicle/session/tick.py:176
Functionrun_daily_safety_net
Once per local day at HH:MM, force-end open session + retry failed.
src/openchronicle/session/tick.py:254
Functionrun_flush_tick
Incremental reducer tick for the active session. Every ``session.flush_minutes`` (min 5) checks for an active session and reduces any closed
src/openchronicle/session/tick.py:143
Functionrun_forever
Daemon task: every minute, materialise any closed windows.
src/openchronicle/timeline/tick.py:62
Functionrun_forever
Run the capture pipeline until cancelled. If ``cfg.event_driven`` is true, starts the watcher subprocess and routes events through the dispat
src/openchronicle/capture/scheduler.py:279
Functionrun_pending
(cfg: Config, conn: sqlite3.Connection)
src/openchronicle/writer/compact.py:188
Functionrun_stdio
Run the server on stdio. Blocks until the client disconnects.
src/openchronicle/mcp/server.py:602
Methodrunning
(self)
src/openchronicle/capture/watcher.py:89
Functionsearch
( conn: sqlite3.Connection, *, query: str, path_patterns: list[str] | None = None, since:
src/openchronicle/store/fts.py:280
Functionsearch
**ALWAYS CALL** before saying "I don't know" about something with a keyword in it. BM25 full-text search across every entry in COMPRESSED mem
src/openchronicle/mcp/server.py:373
Functionsearch_captures
BM25 + snippet search over capture S1 fields. The ``app_name`` filter is a case-insensitive substring match on the ``captures.app_name`` colu
src/openchronicle/store/fts.py:380
Functionsearch_captures
BM25 + snippet search over the S1 FTS index. Returns a list of light-weight hits — `file_stem` is the handle to follow up with `read_recent_c
src/openchronicle/mcp/captures.py:174
Functionsearch_captures
**ALWAYS CALL** (usually in parallel with `search`) when the user mentions a keyword they'd have typed or read on screen. Keyword search over
src/openchronicle/mcp/server.py:492
Functionset_classified_end
( conn: sqlite3.Connection, session_id: str, classified_end: datetime, )
src/openchronicle/session/store.py:160
Functionset_flush_end
( conn: sqlite3.Connection, session_id: str, flush_end: datetime, )
src/openchronicle/session/store.py:147
Functionset_needs_compact
(conn: sqlite3.Connection, path: str, value: bool)
src/openchronicle/store/fts.py:204
Functionsetup
(*, console: bool = True, verbose: bool = False)
src/openchronicle/logger.py:29
Functionstart
Start the OpenChronicle daemon.
src/openchronicle/cli.py:127
Functionstatus
Show daemon status + memory stats.
src/openchronicle/cli.py:193
Functionstop
Stop the daemon.
src/openchronicle/cli.py:165
Functionsupersede_entry
Mark old entry superseded and append the new one. Returns new entry id.
src/openchronicle/store/entries.py:148
Functionsupersede_worker
()
tests/test_store.py:267
Functiontest_api_key_precedence
(tmp_path: Path, monkeypatch)
tests/test_config.py:46
Functiontest_app_filter_and_time_window
(ac_root: Path)
tests/test_captures_fts.py:39
Functiontest_atomic_write_creates_parent_directory
(tmp_path: Path)
tests/test_store.py:152
Functiontest_atomic_write_preserves_existing_permissions
Overwriting must not silently downgrade an existing file's mode. ``tempfile.mkstemp`` creates files at 0o600 — without explicit chmod the ren
tests/test_store.py:158
Functiontest_atomic_write_preserves_original_on_replace_failure
Simulating a crash at the rename step must leave the file intact. A SIGKILL between ``write_text``'s first byte and last byte truncates the f
tests/test_store.py:121
Functiontest_atomic_write_round_trip_through_append_entry
End-to-end: append → read returns the new entry, file isn't corrupted.
tests/test_store.py:175
Functiontest_attach_drill_down_breadcrumb_unit
Direct unit test of the breadcrumb post-processor.
tests/test_session_reducer.py:21
Functiontest_build_manager_wires_reducer_end_to_end
on_event → auto session start → force_end → row persisted → reducer run.
tests/test_session_tick.py:77
Functiontest_check_cuts_noop_when_no_session
()
tests/test_session_manager.py:111
Functiontest_classifier_appends_durable_preference
(ac_root: Path, monkeypatch)
tests/test_classifier.py:58
Functiontest_classifier_empty_commit_when_nothing_classifiable
( ac_root: Path, monkeypatch, )
tests/test_classifier.py:136
Functiontest_classifier_rejects_event_write
(ac_root: Path, monkeypatch)
tests/test_classifier.py:105
Functiontest_classifier_skips_when_event_daily_missing
(ac_root: Path)
tests/test_classifier.py:159
Functiontest_clean_captures_removes_matching_index_rows
(ac_root)
tests/test_cli_captures_cleanup.py:8
Functiontest_cleanup_buffer_removes_fts_rows
Time-based delete pass should also drop matching FTS rows.
tests/test_capture_scheduler_fts.py:52
Functiontest_cleanup_eviction_also_drops_fts
Size-based eviction should also drop matching FTS rows.
tests/test_capture_scheduler_fts.py:90
Functiontest_compact_accepts_when_file_unchanged
(ac_root: Path)
tests/test_store.py:310
Functiontest_compact_skips_if_file_changes_during_llm_rewrite
Compaction must not overwrite entries appended while the LLM is running.
tests/test_store.py:337
Functiontest_concurrent_appends_lose_no_entries
N threads appending to the same file must all land. Without the per-path lock, ``append_entry`` is read-modify-write: each thread reads the s
tests/test_store.py:192
Functiontest_concurrent_supersede_then_append_serializes
A supersede + an append on the same file must both land cleanly. Without the per-path lock, supersede's two-write read-modify-write can inter
tests/test_store.py:248
Functiontest_create_append_search
(ac_root: Path)
tests/test_store.py:25
Functiontest_current_context_app_filter
(ac_root: Path)
tests/test_mcp_tools.py:166
Functiontest_current_context_shape
Headlines newest-first, fulltext deduped by (app,window), timeline blocks ordered.
tests/test_mcp_tools.py:117
Functiontest_daemon_uptime_running
Returns a human-readable uptime when PID file exists.
tests/test_cli_status.py:97
Functiontest_daemon_uptime_stopped_when_no_pid
Returns "stopped" when the daemon is not running.
tests/test_cli_status.py:92
Functiontest_defaults_when_no_file
(tmp_path: Path)
tests/test_config.py:6
Functiontest_delete_propagates_to_fts
(ac_root: Path)
tests/test_captures_fts.py:81
Functiontest_dispatch_append_and_commit
(ac_root: Path)
tests/test_writer_tools.py:8
Functiontest_dispatch_read_memory
(ac_root: Path)
tests/test_writer_tools.py:27
Functiontest_dispatch_search
(ac_root: Path)
tests/test_writer_tools.py:46
Functiontest_enrich_empty_ax_tree
()
tests/test_s1_parser.py:181
Functiontest_enrich_extracts_browser_url
()
tests/test_s1_parser.py:50
Functiontest_enrich_falls_back_to_first_app_when_no_frontmost
()
tests/test_s1_parser.py:189
Functiontest_enrich_no_focused_window_returns_empty_element
()
tests/test_s1_parser.py:155
Functiontest_enrich_non_browser_has_no_url
()
tests/test_s1_parser.py:104
Functiontest_enrich_noop_without_ax_tree
()
tests/test_s1_parser.py:10
Functiontest_enrich_picks_frontmost_app
()
tests/test_s1_parser.py:17
Functiontest_enrich_prefixes_bare_url
()
tests/test_s1_parser.py:78
Functiontest_enrich_visible_text_truncation
()
tests/test_s1_parser.py:130
Functiontest_flush_active_session_writes_partial_entry
( ac_root: Path, monkeypatch, )
tests/test_session_reducer.py:227
Functiontest_force_end_closes_session
()
tests/test_session_manager.py:99
Functiontest_frequent_switching_prevents_soft_cut
()
tests/test_session_manager.py:82
Functiontest_get_capture_visible_text
(ac_root: Path)
tests/test_captures_fts.py:109
Functiontest_get_schema
()
tests/test_mcp_tools.py:63
Functiontest_hard_cut_after_idle_gap
()
tests/test_session_manager.py:34
Functiontest_health_healthy
Timestamp within 5 minutes → "healthy", "green".
tests/test_cli_status.py:122
Functiontest_health_malformed_timestamp
Unparseable timestamps are handled gracefully.
tests/test_cli_status.py:144
Functiontest_health_running_no_captures
PID exists but no last timestamp → "running (no captures yet)", "yellow".
tests/test_cli_status.py:115
Functiontest_health_stale
Timestamp older than 5 minutes → "stale", "yellow".
tests/test_cli_status.py:129
Functiontest_health_stopped
(None, None) → "stopped", "red".
tests/test_cli_status.py:108
Functiontest_health_tz_aware_timestamp
Offset-aware timestamps don't cause TypeError in subtraction.
tests/test_cli_status.py:137
Functiontest_index_md_rebuild_runs
(ac_root: Path)
tests/test_store.py:108
Functiontest_insert_and_keyword_search
(ac_root: Path)
tests/test_captures_fts.py:18
Functiontest_invalid_prefix_rejected
(ac_root: Path)
tests/test_store.py:80
Functiontest_last_capture_finds_newest
Returns timestamp and app_name from the most recent buffer file.
tests/test_cli_status.py:158
Functiontest_last_capture_handles_corrupted_json
Corrupted JSON returns the filename stem as timestamp, None for app.
tests/test_cli_status.py:176
Functiontest_last_capture_none_when_dir_missing
No capture-buffer dir → (None, None).
tests/test_cli_status.py:151
Functiontest_list_memories
(ac_root: Path)
tests/test_mcp_tools.py:12
Functiontest_make_id_uniqueness
()
tests/test_store.py:20
Functiontest_no_hard_cut_below_threshold
()
tests/test_session_manager.py:49
Functiontest_ping_stage_failure_label_includes_class_and_message
A raised exception becomes 'ClassName: <first-line>' truncated to 80 chars.
tests/test_writer_llm_ping.py:60
Functiontest_ping_stage_failure_with_empty_message_falls_back_to_class
When str(exc) is empty, the error label is just the class name.
tests/test_writer_llm_ping.py:85
Functiontest_ping_stage_mock_env_returns_mocked
OPENCHRONICLE_LLM_MOCK=1 short-circuits before any litellm import.
tests/test_writer_llm_ping.py:20
Functiontest_ping_stage_success_records_latency
A normal litellm.completion return yields ok=True with a non-negative latency.
tests/test_writer_llm_ping.py:35
Functiontest_ping_stage_truncates_long_error_message
Error labels are capped so a verbose provider message can't blow up status output.
tests/test_writer_llm_ping.py:107
Functiontest_ping_stages_dedups_identical_configs
Stages with identical (model, base_url, api_key) only ping the network once. The default config gives every stage the same model, so a four-stage
tests/test_cli_status.py:31
← previousnext →301–400 of 450, ranked by callers