MCPcopy Create free account

hub / github.com/aaronjmars/MiroShark / functions

Functions3,647 in github.com/aaronjmars/MiroShark

↓ 11 callersFunction_payload
(client)
backend/tests/test_unit_notifications_config.py:47
↓ 11 callersFunction_write_trajectory
(sim_dir: Path, snapshots: list[dict])
backend/tests/test_unit_agent_sparklines.py:40
↓ 11 callersFunctionapply_i18n
Recursively merge embedded ``i18n[locale]`` blocks into a JSON payload. Looks for an ``i18n`` mapping on each dict node — when present and the
backend/app/utils/i18n.py:170
↓ 11 callersFunctioncompute_platform_stats
Return platform-level aggregate statistics for every public, completed simulation under ``sim_root``. Result shape:: { "sc
backend/app/services/platform_stats.py:214
↓ 11 callersFunctioncompute_signature
Return ``sha256=<hex>`` for ``payload_bytes`` under ``secret``. ``secret`` defaults to the ``WEBHOOK_SECRET`` env var. A blank / missing secr
backend/app/services/webhook_service.py:646
↓ 11 callersFunctionfail
(msg)
backend/scripts/test_e2e_api.py:86
↓ 11 callersMethodget_project
Get project Args: project_id: Project ID Returns: Project object, or None if not found
backend/app/models/project.py:195
↓ 11 callersFunctionrepair_json
Parse malformed/truncated LLM JSON, recovering as much as possible. Two tiers, each best-effort: 1. Re-close anything a ``max_tokens`` cut-o
backend/app/utils/json_repair.py:89
↓ 11 callersMethodsearch
Hybrid search — returns results matching the scope. Args: as_of: ISO-8601 timestamp. If set, returns only edges that wer
backend/app/storage/neo4j_storage.py:594
↓ 11 callersFunctiont
Pick a translation for ``locale``, falling back to the English source. ``en`` is the canonical source string. ``zh`` (kept positional for the
backend/app/utils/i18n.py:123
↓ 10 callersMethod_get_simulation_dir
Get simulation data directory
backend/app/services/simulation_manager.py:182
↓ 10 callersFunction_md_yaml_value
Quote-safe, single-line YAML scalar for the front-matter block. Wraps strings in double quotes (escaping internal double quotes + backslashes
backend/app/services/transcript.py:312
↓ 10 callersFunction_render
(summary, simulation_id="sim_test")
backend/tests/test_unit_watch.py:102
↓ 10 callersMethod_save_run_state
Save run state to file
backend/app/services/simulation_runner.py:189
↓ 10 callersMethodchat
Chat with Report Agent In conversation, Agent can autonomously call retrieval tools to answer questions Args: m
backend/app/services/report_agent.py:2871
↓ 10 callersFunctioncreate_app
Flask application factory function
backend/app/__init__.py:37
↓ 10 callersMethodget_agents
( self, agent_ids: list[int] = None)
backend/wonderwall/social_agent/agent_graph.py:229
↓ 10 callersFunctionrender_atom
Render the public-gallery cards as an Atom 1.0 XML feed. ``feed_path`` is the request path that produced this feed (e.g. ``/api/feed.atom?ver
backend/app/services/feed.py:226
↓ 10 callersFunctionsave_json
(name, data)
backend/scripts/test_e2e_api.py:91
↓ 10 callersFunctionsummary_cache_key
Stable hash of the inputs that affect the rendered GIF. Two summaries with the same hash produce byte-identical GIFs (as long as the renderer
backend/app/services/replay_gif.py:491
↓ 10 callersFunctionvalidate_url
Return ``None`` if the URL is acceptable, else an error message. Empty string is valid (treated as "disable webhook").
backend/app/services/webhook_service.py:693
↓ 9 callersFunction_build_gallery_card_payload
Assemble the minimal card-friendly payload for the public gallery. Cheap reads only — no DB joins, no LLM calls. Walks the on-disk artifacts
backend/app/api/simulation.py:7938
↓ 9 callersFunction_clear_dkg
Reset the four DKG_* config attributes back to the unset shape. The notifications probe reads DKG state via ``dkg_publisher.is_configured()``
backend/tests/test_unit_notifications_config.py:55
↓ 9 callersFunction_env
(name: str)
backend/app/services/email_notify.py:134
↓ 9 callersFunction_escape_literal
Escape a Turtle string literal. Turtle backslash + quote escaping per https://www.w3.org/TR/turtle/#sec-escapes. We use the triple-double
backend/app/services/dkg_publisher.py:270
↓ 9 callersMethod_get_post_type
(self, post_id: int)
backend/wonderwall/social_platform/platform_utils.py:242
↓ 9 callersFunction_get_simulation_id_or_400
Extract and validate simulation_id from POST body. Returns (simulation_id, None) on success or (None, error_response) on failure.
backend/app/api/simulation.py:155
↓ 9 callersFunction_payload
(**overrides)
backend/tests/test_unit_slack_notify.py:98
↓ 9 callersFunction_read_outcome_file
Read ``<sim_dir>/outcome.json`` if it exists. Returns the parsed dict (with the public fields the gallery + embed surfaces care about) or ``N
backend/app/api/simulation.py:7898
↓ 9 callersFunction_safe_int
Coerce ``value`` to a non-negative int with a default fallback. Belief: every numeric field in the export is non-negative — agent count, roun
backend/app/services/repro_export.py:105
↓ 9 callersFunction_safe_str
Coerce ``value`` to a stripped string.
backend/app/services/repro_export.py:120
↓ 9 callersFunction_text_width
Measure pixel width — uses textbbox (Pillow 10+) which is accurate for both TTF and the bitmap fallback.
backend/app/services/share_card.py:97
↓ 9 callersFunctionbuild_platform_badge_svg
Render the flat platform-stats badge as an SVG string. Returns a complete SVG 1.1 document with the same dimensions, rounded clip path, font
backend/app/services/badge_service.py:375
↓ 9 callersFunctionbuild_rows
Read sim_dir on-disk artifacts and return the analyst row list. Reads ``trajectory.json`` (required — empty list when missing) and ``quality.
backend/app/services/trajectory_export.py:186
↓ 9 callersFunctionbuild_status_payload
Assemble the GET /api/mcp/status response body. Splitting this from the request handler keeps the unit tests Flask-free.
backend/app/api/mcp.py:267
↓ 9 callersMethodclose
(self)
backend/app/services/oracle_seed.py:111
↓ 9 callersMethodclose
(self)
backend/wonderwall/social_agent/agent_graph.py:260
↓ 9 callersMethodget_all_actions
Get complete action history for all platforms (no pagination limit) Args: simulation_id: Simulation ID platf
backend/app/services/simulation_runner.py:980
↓ 9 callersMethodlog_action
Log a single action
backend/scripts/action_logger.py:44
↓ 9 callersMethodlog_round_start
Log round start
backend/scripts/action_logger.py:69
↓ 9 callersMethodrecord
Record actions from one platform for a round. Call this after each platform steps, BEFORE the next platform steps, so that subsequent
backend/scripts/round_memory.py:201
↓ 9 callersMethodrun
(self)
backend/wonderwall/social_platform/platform.py:196
↓ 9 callersMethodsend_response
Send response
backend/scripts/run_parallel_simulation.py:353
↓ 9 callersMethodupdate_progress
Update report generation progress Frontend can get real-time progress by reading progress.json
backend/app/services/report_agent.py:3301
↓ 9 callersFunctionverify_signature
Constant-time verification helper for recipients. Returns ``True`` iff ``header_value`` is the signature this MiroShark instance would emit f
backend/app/services/webhook_service.py:669
↓ 8 callersFunction_bucket_with_pcts
Convert a counts dict into a ``{key, key_pct}``-flavoured dict. Percentages are rounded to one decimal and ``0.0`` when ``total == 0``. Same
backend/app/services/outcome_distribution.py:237
↓ 8 callersFunction_cell_text
(cell: dict)
backend/tests/test_unit_notebook_export.py:180
↓ 8 callersFunction_classify_stance
Bucket a continuous belief position into bullish/neutral/bearish. Mirrors the ±0.2 threshold used elsewhere — keeps the transcript's per-agen
backend/app/services/transcript.py:51
↓ 8 callersFunction_clear_email
Reset SMTP_* env vars so the email channel reads as unconfigured.
backend/tests/test_unit_notifications_config.py:70
↓ 8 callersFunction_clear_telegram
Reset TELEGRAM_* env vars so the channel reads as unconfigured.
backend/tests/test_unit_notifications_config.py:81
↓ 8 callersFunction_clear_waybackclaw
Reset ``WAYBACKCLAW_AGENT_TOKEN`` so the channel reads as unconfigured. ``is_configured()`` returns True iff the agent token is set, so this
backend/tests/test_unit_notifications_config.py:87
↓ 8 callersFunction_demo_bucket_accumulator
()
backend/app/api/simulation.py:11002
↓ 8 callersFunction_html_escape
(value: str)
backend/app/services/email_notify.py:388
↓ 8 callersFunction_load_font
(size: int, bold: bool = False)
backend/app/services/share_card.py:84
↓ 8 callersFunction_resolve_share_base_url
Same proxy-aware base URL the share / watch routes use. Honours ``X-Forwarded-Proto`` + ``X-Forwarded-Host`` for deployments behind a TLS-ter
backend/app/api/simulation.py:6731
↓ 8 callersFunction_response
(json_data=None, status=200, text="")
backend/tests/test_unit_searxng_client.py:18
↓ 8 callersFunction_suggested_market_title
Synthesise a Polymarket-shaped market title from the sim scenario. Polymarket titles start with ``"Will "`` and end with a single ``"?"``. We
backend/app/services/polymarket_service.py:130
↓ 8 callersFunction_text_width
(draw: ImageDraw.ImageDraw, text: str, font)
backend/app/services/replay_gif.py:104
↓ 8 callersFunction_write_trajectory
(sim_dir: Path, snapshots: list[dict])
backend/tests/test_unit_agent_export.py:62
↓ 8 callersFunctionbuild_thread
Assemble the full tweet-thread payload for a finished simulation. Returns ``{"tweets": [...], "total": N, "inflections_recorded": M, "truncat
backend/app/services/thread_formatter.py:352
↓ 8 callersMethodchat
Send a chat request Args: messages: List of messages temperature: Temperature parameter max_toke
backend/app/utils/llm_client.py:264
↓ 8 callersFunctiondistribution_etag
Build a short ETag from the cheap inputs. ``total_analyzed`` + the year-month prefix of ``newest_completed_at`` detects material change witho
backend/app/services/outcome_distribution.py:368
↓ 8 callersFunctionfetch_url_text
Fetch a URL and return its readable content. Uses Firecrawl (MIROSHARK_FIRECRAWL_BASE_URL) when configured, falling back to the web-sear
backend/app/utils/url_fetcher.py:166
↓ 8 callersMethodfilter_defined_entities
Filter and extract nodes with meaningful entity types. Filtering logic: - If a node's labels only include "Entity", it has n
backend/app/services/entity_reader.py:170
↓ 8 callersFunctioninject_belief_context
Inject belief state into an agent's system message. Follows the same pattern as ``inject_cross_platform_context``: appends (or replaces) a ma
backend/wonderwall/social_agent/belief_state.py:261
↓ 8 callersFunctionload_counterfactual
Read ``<sim_dir>/counterfactual_injection.json`` or return None.
backend/scripts/counterfactual_loader.py:29
↓ 8 callersMethodperform_action
Send an action through the channel to the platform.
backend/wonderwall/simulations/base.py:286
↓ 8 callersFunctionrender_feed
Render the feed in the requested format. Returns ``(body_bytes, mime_type)``. ``fmt`` accepts ``"atom"`` (the default) or ``"rss"`` — anythin
backend/app/services/feed.py:565
↓ 8 callersMethodsave
Save trajectory to JSON for the report agent.
backend/wonderwall/social_agent/round_analyzer.py:69
↓ 8 callersFunctionsummary_cache_key
Stable hash of the inputs that affect the rendered card. Two cards with the same hash are guaranteed byte-identical (as long as the renderer c
backend/app/services/share_card.py:472
↓ 8 callersMethodto_prompt_text
Convert belief state to natural language for LLM prompt injection.
backend/wonderwall/social_agent/belief_state.py:190
↓ 7 callersFunction_is_gif
GIF signature is GIF87a or GIF89a in the first 6 bytes.
backend/tests/test_unit_replay_gif.py:33
↓ 7 callersFunction_iso
Format ``epoch_seconds`` (UTC) as the naive-local shape ``simulation_runner`` writes into ``state.json``.
backend/tests/test_unit_platform_status.py:55
↓ 7 callersFunction_load_font
(size: int, bold: bool = False)
backend/app/services/replay_gif.py:91
↓ 7 callersFunction_report_prompt
Locale-aware lookup that falls back to module-level English constants. Lets us add Chinese variants in the registry without moving the sizabl
backend/app/services/report_agent.py:36
↓ 7 callersFunction_scale_y
Map a percentage (0–100) into a pixel y-coordinate. SVG y-axis is inverted — 0 is at the top. We invert the percentage so 100% maps to ``PAD_
backend/app/services/chart_svg.py:104
↓ 7 callersFunction_strip_embeddings
Drop raw embedding vectors from a result payload — they're noise for LLMs.
backend/mcp_server.py:233
↓ 7 callersFunction_surfaces_fixture
Three realistic surfaces with distinct, easy-to-verify content.
backend/tests/test_unit_archive_service.py:64
↓ 7 callersMethodadd_agent
(self, agent: SocialAgent)
backend/wonderwall/social_agent/agent_graph.py:199
↓ 7 callersFunctionbanner
(phase_num, title)
backend/scripts/test_e2e_api.py:68
↓ 7 callersFunctioncompute_stance_split
Bucket per-agent belief positions into bullish/neutral/bearish %. ``belief_positions`` is the snapshot field: ``{agent_id: {topic: float}}``.
backend/app/services/trajectory_export.py:65
↓ 7 callersFunctioncreate_smart_llm_client
Factory for intelligence-sensitive workflows (reports, ontology, graph reasoning). Uses SMART_* config when set, otherwise falls back to the
backend/app/utils/llm_client.py:92
↓ 7 callersFunctionextract_frames_from_summary
Pull per-round belief percentages out of the embed-summary payload. Returns a list of ``{round, bullish, neutral, bearish}`` dicts in round o
backend/app/services/replay_gif.py:154
↓ 7 callersFunctionrender_markdown
Render the transcript payload as Markdown. Layout: - YAML front-matter so Notion / Obsidian / Bear pick up the scenario, sim_id, a
backend/app/services/transcript.py:430
↓ 7 callersMethodsend_response
Send response
backend/scripts/run_twitter_simulation.py:201
↓ 7 callersMethodsend_response
Send response
backend/scripts/run_reddit_simulation.py:211
↓ 6 callersFunction_check_simulation_prepared
Check if the simulation has been prepared Conditions checked: 1. state.json exists and status is "ready" 2. Required files exist: re
backend/app/api/simulation.py:1626
↓ 6 callersFunction_compact_post_for_agent
Strip per-post fields that don't carry signal for agent decisions. CAMEL's ChatAgent accumulates env dumps across rounds, so each post's wire
backend/lib/env_compact.py:33
↓ 6 callersFunction_compute_influence_ranked
Compute agent influence scores from simulation action JSONL logs. Reads twitter/actions.jsonl, reddit/actions.jsonl, and polymarket/actions.
backend/app/api/simulation.py:3701
↓ 6 callersFunction_fail
Shape a daemon failure into the structured response. ``payload`` is whatever the daemon (or transport) returned. Trim long bodies so the resp
backend/app/services/dkg_publisher.py:650
↓ 6 callersFunction_gif_frame_count
Count frames by reading the GIF with Pillow. Avoids hand-parsing the GCT / image descriptor blocks — Pillow's iterator already knows how to w
backend/tests/test_unit_replay_gif.py:45
↓ 6 callersFunction_is_png
The PNG signature is fixed at 8 bytes: 89 50 4e 47 0d 0a 1a 0a.
backend/tests/test_unit_share_card.py:32
↓ 6 callersMethod_load_simulation_state
Load simulation state from file
backend/app/services/simulation_manager.py:201
↓ 6 callersFunction_load_spec
Load openapi.yaml as a dict — pyyaml is in the unit-test workflow.
backend/tests/test_unit_openapi.py:45
↓ 6 callersFunction_make_app
Tiny Flask app with one view gated by ``require_admin_token``. We can't import the full ``create_app`` factory here because it boots Neo4j an
backend/tests/test_unit_admin_auth.py:52
↓ 6 callersFunction_mask_key
Return only the last 4 characters of an API key.
backend/app/api/settings.py:25
↓ 6 callersMethod_maybe_cache_wrap_messages
Attach cache_control to the first system message (Anthropic-style). Leaves the input list untouched; returns a shallow copy with the system
backend/app/utils/llm_client.py:184
↓ 6 callersFunction_now_epoch
Integer Unix timestamp — single source for current-time arithmetic. Pulled into a helper so the test suite can monkey-patch one symbol rather
backend/app/services/share_link_service.py:143
↓ 6 callersFunction_open_zip
Open a ZIP from in-memory bytes for inspection.
backend/tests/test_unit_archive_service.py:59
↓ 6 callersMethod_read_action_log
Read action log file Args: log_path: Log file path position: Last read position state: Run state
backend/app/services/simulation_runner.py:614
← previousnext →101–200 of 3,647, ranked by callers