MCPcopy Create free account

hub / github.com/aaronjmars/MiroShark / functions

Functions3,647 in github.com/aaronjmars/MiroShark

↓ 6 callersMethod_record_trace
Record an action in the trace table.
backend/wonderwall/simulations/base.py:215
↓ 6 callersFunction_safe_str
Stripped string; ``None`` ⇒ empty.
backend/app/services/agent_export.py:161
↓ 6 callersFunction_safe_str
Coerce ``value`` to a stripped string; ``None`` ⇒ empty.
backend/app/services/lineage_service.py:77
↓ 6 callersFunction_scale_x
Map a round number into a pixel x-coordinate inside the plot area. ``max_round`` is the largest round in the trajectory (not the count of rou
backend/app/services/chart_svg.py:86
↓ 6 callersFunction_set_webhook_secret
Set / clear ``WEBHOOK_SECRET`` for the duration of the block.
backend/tests/test_unit_webhook_signature.py:41
↓ 6 callersFunction_sql_quote
(value: str)
backend/app/services/demographic_sampler.py:54
↓ 6 callersFunction_truncate
Single-byte ``…`` truncation that preserves a trailing ellipsis. Strips whitespace and trims with a one-character margin so the final string
backend/app/services/watch_renderer.py:58
↓ 6 callersMethodafter_round
Call after env.step() each round to update beliefs and inject context. Args: db_path: Path to the platform's SQLite database.
backend/scripts/belief_integration.py:189
↓ 6 callersFunctionbanner
(title)
backend/scripts/test_full_pipeline.py:57
↓ 6 callersMethodbuild_digest
Build a text digest of an agent's recent activity on OTHER platforms. Args: agent_id: The agent to build the digest for.
backend/scripts/cross_platform_digest.py:101
↓ 6 callersFunctioncanonical_json
Return the canonical JSON encoding of ``payload`` as UTF-8 bytes. Locked encoding: - ``sort_keys=True`` so two identical dicts produce ide
backend/app/services/signed_result.py:79
↓ 6 callersMethodclear
Clear all recorded actions.
backend/scripts/cross_platform_digest.py:190
↓ 6 callersFunctiondominant_stance
Pick the dominant stance label from a split — or ``None``. Returns ``"bullish"`` / ``"neutral"`` / ``"bearish"`` when one stance leads the ru
backend/app/services/thread_formatter.py:88
↓ 6 callersMethodenrich_if_needed
Check if enrichment is needed, and if so, research via LLM. Returns a formatted context string, or "" if not needed or failed.
backend/app/services/web_enrichment.py:114
↓ 6 callersFunctionget_active_agents_for_round
Determine which Agents to activate this round based on time and configuration
backend/scripts/run_parallel_simulation.py:1260
↓ 6 callersMethodget_current_time
Get the current simulation time.
backend/wonderwall/simulations/base.py:228
↓ 6 callersMethodget_report
Get report
backend/app/services/report_agent.py:3546
↓ 6 callersFunctioninject_cross_platform_context
Inject a cross-platform digest into an agent's system message. Appends (or replaces) the cross-platform section at the end of the agent'
backend/scripts/cross_platform_digest.py:199
↓ 6 callersFunctioninject_director_event_context
Inject a breaking event into an agent's system message. Uses the same marker-replace pattern as inject_cross_platform_context. Args:
backend/scripts/director_events.py:211
↓ 6 callersMethodlog_simulation_start
Log simulation start
backend/scripts/action_logger.py:93
↓ 6 callersFunctionmask_url
Show only the scheme + host of a webhook URL. The full URL often carries an opaque secret in the path (``hooks.slack.com/services/T0…/B0…/abc
backend/app/services/webhook_service.py:257
↓ 6 callersMethodpoll
Wait up to timeout seconds, then drain all buffered events.
backend/app/utils/event_logger.py:293
↓ 6 callersFunctionread_surface_stats
Return ``{key: count, ..., total: sum}`` for the sim's stats file. Every key in ``SURFACE_KEYS`` is present (zero-defaulted) plus a synthetic
backend/app/services/surface_stats.py:224
↓ 6 callersFunctionrender_replay_gif
Render an animated GIF from the embed-summary payload. Always returns valid GIF bytes — a missing trajectory renders a single-frame "Belief t
backend/app/services/replay_gif.py:429
↓ 6 callersMethodsave_project
Save project metadata
backend/app/models/project.py:186
↓ 6 callersMethodsearch_graph
Graph semantic search (hybrid: vector + BM25 via Neo4j) Args: graph_id: Graph ID query: Search query
backend/app/services/graph_tools.py:490
↓ 6 callersMethodto_dict
(self)
backend/app/services/report_agent.py:478
↓ 5 callersFunction_cache_header
Cache-Control value shared by both endpoints. 60 seconds matches the cache TTL on ``compute_platform_stats`` and the per-sim ``/badge.svg`` r
backend/app/api/stats.py:51
↓ 5 callersFunction_code_cell
Build an nbformat 4 code cell with no outputs and no execution count. Unexecuted code cells are the standard distribution form — the user's o
backend/app/services/notebook_export.py:133
↓ 5 callersFunction_compact_posts_for_agent
(posts: list)
backend/lib/env_compact.py:115
↓ 5 callersFunction_empty_stats
Return a dict with every key in ``SURFACE_KEYS`` set to zero. The dict is fresh on every call — callers mutate the result without affecting s
backend/app/services/surface_stats.py:121
↓ 5 callersMethod_ensure_report_folder
Ensure report folder exists and return path
backend/app/services/report_agent.py:3018
↓ 5 callersFunction_finalize_dimension
(dim_buckets, preferred_order=None)
backend/app/api/simulation.py:11264
↓ 5 callersMethod_get_project_dir
Get project directory path
backend/app/models/project.py:130
↓ 5 callersFunction_in_clause
(column: str, values: List[Any])
backend/app/services/demographic_sampler.py:209
↓ 5 callersFunction_load_admin_token
Read ``MIROSHARK_ADMIN_TOKEN`` from the environment at *call* time. Resolved per-request rather than module-import time so tests can monkeypa
backend/app/api/simulation.py:71
↓ 5 callersFunction_make_state
Lightweight stand-in for SimulationState — only the attributes the gallery helper reads.
backend/tests/test_unit_public_gallery.py:37
↓ 5 callersFunction_normalize_for_comparison
Trim trailing slashes for comparison (Flask treats them equivalently).
backend/tests/test_unit_openapi.py:234
↓ 5 callersFunction_post
(url: str, body: dict, timeout: float = 30.0)
backend/tests/test_integration_endpoints.py:26
↓ 5 callersFunction_read_json
Best-effort JSON load — returns ``None`` on any failure.
backend/app/services/webhook_service.py:713
↓ 5 callersFunction_render_landing_html
Build the static HTML returned to scrapers + browsers. Keep this small and dependency-free — the page exists purely to expose Open Graph tags
backend/app/api/share.py:54
↓ 5 callersFunction_resolve_base_url
Same proxy-aware base URL resolution the share-landing route uses — ``X-Forwarded-Proto`` + ``X-Forwarded-Host`` first, then ``request.host_ur
backend/app/api/watch.py:204
↓ 5 callersFunction_trending_strip_localname
Strip XML namespace prefix from a tag name: '{ns}foo' → 'foo'.
backend/app/api/simulation.py:941
↓ 5 callersFunction_truncate
(value: str, limit: int)
backend/app/services/email_notify.py:203
↓ 5 callersFunction_write_config
Drop a simulation_config.json with the LLM-generated shape.
backend/tests/test_unit_clone_service.py:70
↓ 5 callersFunction_write_trajectory
Write a ``trajectory.json`` whose final round produces ``final_split`` via the standard ±0.2 stance threshold. ``rounds`` controls how many s
backend/tests/test_unit_batch_status.py:99
↓ 5 callersFunctionbanner
(title)
backend/scripts/test_market_generation.py:36
↓ 5 callersFunctionbanner
(title)
backend/scripts/test_3platform_interconnected.py:41
↓ 5 callersFunctionbucket_snapshots
Reduce trajectory snapshots to a final bullish/neutral/bearish split. For each snapshot, average every agent's per-topic belief positions, then
backend/app/utils/belief.py:10
↓ 5 callersFunctionclose_truncated_json
Re-close a JSON string that was truncated mid-structure. When an LLM hits its ``max_tokens`` limit the response often ends partway through a
backend/app/utils/json_repair.py:22
↓ 5 callersFunctioncreate_model
Create LLM model Supports dual LLM configuration for faster parallel simulation: - General config: LLM_API_KEY, LLM_BASE_URL, LLM_MODEL_
backend/scripts/run_parallel_simulation.py:1080
↓ 5 callersMethodcreate_task
Create a new task Args: task_type: Task type metadata: Additional metadata Returns: Tas
backend/app/models/task.py:73
↓ 5 callersFunctionfilter_openai_messages_for_api
Prepare CAMEL memory messages for an OpenAI-compatible chat call. Gemini rejects assistant/user turns whose ``content`` is empty (INVALID_ARG
backend/app/utils/llm_message_filter.py:12
↓ 5 callersMethodget_all_nodes
Get all nodes in the graph
backend/app/services/graph_tools.py:666
↓ 5 callersMethodget_report_by_simulation
Get report by simulation ID
backend/app/services/report_agent.py:3599
↓ 5 callersFunctionget_surfaces_catalog
Return a freshly-copied list of every catalogued surface. Each call returns a new outer list and a new inner dict per entry so a caller mutat
backend/app/services/surfaces_catalog.py:477
↓ 5 callersFunctioninject_market_context
Inject market prices into a social media agent's system message.
backend/scripts/market_media_bridge.py:294
↓ 5 callersFunctioninjection_prefix_for_round
Return a prompt-ready prefix for agents this round, or "". The prefix is an ALL-CAPS banner plus the injection text, so LLM agents reliably t
backend/scripts/counterfactual_loader.py:51
↓ 5 callersMethodlist_simulations
List all simulations
backend/app/services/simulation_manager.py:559
↓ 5 callersFunctionload_trajectory_for_chart
Read the trajectory rows the chart needs. Reuses ``trajectory_export.build_rows`` so a single change to the underlying ``trajectory.json`` sc
backend/app/services/chart_svg.py:161
↓ 5 callersFunctionparse_tool_calls
Extract up to max_calls ``<mcp_call .../>`` blocks from agent output. Malformed ``args`` JSON is tolerated (empty dict). Returns [] if none.
backend/scripts/mcp_agent_bridge.py:72
↓ 5 callersFunctionrender_share_card
Render a summary dict into a 1200x630 PNG. Always returns valid PNG bytes — missing fields render as a stripped-down "Setup" card instead of e
backend/app/services/share_card.py:233
↓ 5 callersFunctionsave_json
(name, data)
backend/scripts/test_full_pipeline.py:45
↓ 5 callersMethodsave_report
Save report metadata and complete report
backend/app/services/report_agent.py:3526
↓ 5 callersMethodsave_trajectory
Persist this platform's trajectory and refresh the merged view. Writes ``trajectory_<platform>.json`` (authoritative per-platform rec
backend/scripts/belief_integration.py:251
↓ 5 callersFunctionstats_etag
Build a short ETag from the cheap inputs. ``total_sims`` + ``newest_sim_id`` is enough to detect material change without re-reading the corpu
backend/app/services/project_stats.py:354
↓ 5 callersFunctionstats_etag
Build a short ETag from the cheap inputs. ``total_sims`` + ``newest_sim_id`` is enough to detect material change without re-reading the corpu
backend/app/services/platform_stats.py:284
↓ 5 callersMethodto_dict
(self)
backend/app/services/graph_tools.py:62
↓ 5 callersMethodto_text
Convert to text format
backend/app/services/graph_tools.py:71
↓ 4 callersMethod_append
( self, kind: str, content: str, iteration: int = 0, tool_name: Option
backend/app/storage/reasoning_trace.py:126
↓ 4 callersFunction_atomic_write_json
Write JSON atomically via temp file + rename.
backend/scripts/director_events.py:27
↓ 4 callersFunction_build_meta_description
Compose the ``<meta name="description">`` + ``og:description`` string from an embed-summary payload. Goes ``"Round N · Bullish X% · Neutral Y
backend/app/services/watch_renderer.py:96
↓ 4 callersFunction_cache_header
``Cache-Control`` value for both catalog endpoints. One hour matches the underlying catalog cadence — both catalogues only change when a new
backend/app/api/surfaces.py:48
↓ 4 callersMethod_compute_convergence
Measure how much opinions converged or diverged per topic.
backend/wonderwall/social_agent/round_analyzer.py:106
↓ 4 callersFunction_draw_pill
Draw a rounded-rect pill, return (right_x, bottom_y) for chaining.
backend/app/services/share_card.py:177
↓ 4 callersMethod_emit_llm_event
Emit an llm_call observability event (best-effort, never raises).
backend/app/utils/llm_client.py:215
↓ 4 callersFunction_empty_entry
Return the ``found: false`` envelope. The same shape is emitted for an unknown id and for a private id — a caller cannot distinguish the two
backend/app/services/batch_status.py:174
↓ 4 callersFunction_entry_id
Stable Atom entry id — must not change across feed fetches. Anchoring on the share landing URL gives us a globally unique URI per simulation
backend/app/services/feed.py:206
↓ 4 callersFunction_extract_bearer_token
Pull the token from the ``Authorization: Bearer <token>`` header. Returns the empty string when the header is missing or malformed — the call
backend/app/api/simulation.py:82
↓ 4 callersFunction_format_date
Convert ``2026-04-22`` (or full ISO timestamp) to ``Apr 22, 2026``. Returns the input untouched if parsing fails.
backend/app/services/share_card.py:148
↓ 4 callersFunction_format_pct
(value: Any)
backend/app/services/email_notify.py:265
↓ 4 callersFunction_get
(url: str, timeout: float = 15.0)
backend/tests/test_integration_endpoints.py:46
↓ 4 callersFunction_get_post_info
Get post information Args: cursor: Database cursor post_id: Post ID agent_names: agent_id -> agent_name mapping
backend/scripts/run_parallel_simulation.py:953
↓ 4 callersMethod_get_project_files_dir
Get project file storage directory
backend/app/models/project.py:141
↓ 4 callersMethod_get_report_markdown_path
Get complete report Markdown file path
backend/app/services/report_agent.py:3030
↓ 4 callersMethod_get_simulation_dir
Find the simulation directory (tries multiple locations).
backend/app/services/report_agent.py:1690
↓ 4 callersFunction_isoformat_z
Coerce a datetime-ish value to RFC3339 / ISO8601 ``Z`` form. Atom requires ``updated`` and ``published`` in RFC3339; RSS 2.0 requires RFC822
backend/app/services/feed.py:70
↓ 4 callersFunction_join
(items, sep, conj, quote=True)
backend/app/utils/i18n.py:147
↓ 4 callersFunction_load_profile_names
``user_id → display name`` lookup for the simulation's agents. Reads ``reddit_profiles.json`` first (every run produces it), then ``polymarke
backend/app/services/transcript.py:72
↓ 4 callersFunction_mock_llm
(response="- bullet one\n- bullet two\n- enough chars to pass the floor")
backend/tests/test_unit_web_enrichment.py:26
↓ 4 callersMethod_node_to_dict
Convert Neo4j node to the standard node dict format.
backend/app/storage/neo4j_storage.py:888
↓ 4 callersFunction_optional_str
Stripped string or ``None`` when empty — preserves null vs blank distinction the JSON consumer expects.
backend/app/services/agent_export.py:171
↓ 4 callersFunction_private_preview_not_found
Single 404 for every preview-resolution miss. Unknown token / revoked token / expired token / malformed token all return the same response so
backend/app/api/share.py:523
↓ 4 callersMethod_read_actions_from_file
Read actions from a single action file Args: file_path: Action log file path default_platform: Default platf
backend/app/services/simulation_runner.py:911
↓ 4 callersFunction_read_log
(sim_dir: Path)
backend/tests/test_unit_webhook_log.py:50
↓ 4 callersFunction_read_share_api
()
backend/tests/test_unit_oembed.py:174
↓ 4 callersFunction_request
Issue one DKG daemon HTTP call. Returns ``(ok, status_code, payload)``: * ``ok`` — True for 2xx, False otherwise. * ``status_code`` —
backend/app/services/dkg_publisher.py:194
↓ 4 callersFunction_reset_cache_for_tests
Clear the module cache (only for tests that mutate locale files).
backend/app/prompts/registry.py:153
↓ 4 callersFunction_resolve_webhook_url
()
backend/app/services/slack_notify.py:85
↓ 4 callersFunction_safe_str
Coerce to a stripped string; never raise.
backend/app/services/notebook_export.py:97
← previousnext →201–300 of 3,647, ranked by callers