Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/aaronjmars/MiroShark
/ functions
Functions
3,647 in github.com/aaronjmars/MiroShark
⨍
Functions
3,647
◇
Types & classes
172
↳
Endpoints
175
↓ 1 callers
Function
_trending_parse_pubdate
Best-effort parse of RSS/Atom date strings into a UTC datetime. Handles RFC 822 (RSS pubDate), RFC 3339 / ISO 8601 (Atom updated/published),
backend/app/api/simulation.py:908
↓ 1 callers
Function
_trending_rate_limited
Sliding-window per-IP rate limit, mirroring scenario-suggest's pattern.
backend/app/api/simulation.py:898
↓ 1 callers
Function
_trending_url_allowed
Reject URLs that aren't http(s) or target private/loopback hosts. First line of defense against using this endpoint as an SSRF proxy via the
backend/app/api/simulation.py:850
↓ 1 callers
Function
_truncate_scenario
Truncate ``text`` with a trailing ellipsis when it exceeds ``limit``.
backend/app/services/clone_service.py:127
↓ 1 callers
Function
_truncate_title
Trim the chart title to ``TITLE_MAX_CHARS`` with an ellipsis.
backend/app/services/chart_svg.py:150
↓ 1 callers
Function
_truncate_title
Trim to ``limit`` characters with a trailing ellipsis on overflow. Empty / falsy values pass through as the empty string — callers treat that
backend/app/services/frame_metadata.py:101
↓ 1 callers
Function
_truncate_title
Collapse a scenario prompt into an oEmbed ``title`` ≤ ``_TITLE_MAX``. Falls back to a generic title when the scenario is empty (a published s
backend/app/services/oembed_service.py:143
↓ 1 callers
Method
_try_fix_config_json
Try to recover a config object from corrupted/truncated LLM JSON. Delegates to the shared salvage pipeline, returning ``None`` (rather
backend/app/services/simulation_config_generator.py:532
↓ 1 callers
Method
_try_fix_json
Try to recover a profile from corrupted/truncated LLM JSON. First runs the shared best-effort salvage; if that can't produce a parsea
backend/app/services/wonderwall_profile_generator.py:721
↓ 1 callers
Function
_try_import_hf
()
backend/app/services/demographic_sampler.py:46
↓ 1 callers
Function
_ttl_long_literal
Render ``value`` as a Turtle triple-quoted string literal. Returns ``\"\"\"escaped\"\"\"``. Empty / None becomes ``\"\"`` so the caller can s
backend/app/services/dkg_publisher.py:287
↓ 1 callers
Method
_validate_and_clean
Validate and normalize LLM output.
backend/app/storage/ner_extractor.py:126
↓ 1 callers
Method
_validate_and_process
Validate and post-process results
backend/app/services/ontology_generator.py:117
↓ 1 callers
Function
_validate_project_id
Reject project_id values that could escape PROJECTS_DIR.
backend/app/models/project.py:20
↓ 1 callers
Function
_validate_url
Validate scheme/host and check resolved IP. Returns the hostname.
backend/app/utils/url_fetcher.py:42
↓ 1 callers
Method
_verify_claude_installed
Check that the claude CLI is available.
backend/app/utils/claude_code_client.py:39
↓ 1 callers
Method
_write
Create Community nodes + MEMBER_OF edges.
backend/app/storage/community_builder.py:346
↓ 1 callers
Function
_write_citation
Persist the citation atomically via tempfile + os.replace. Mirrors surface_stats / webhook_log on-disk atomic-write pattern. Never raises — a
backend/app/services/dkg_publisher.py:457
↓ 1 callers
Function
_write_polymarket_profiles
(sim_dir: Path, profiles: list[dict])
backend/tests/test_unit_agent_export.py:56
↓ 1 callers
Function
_write_profiles
(sim_dir: Path, profiles: list[dict])
backend/tests/test_unit_agent_sparklines.py:46
↓ 1 callers
Function
_write_record
Persist the submission record atomically via tempfile + os.replace. Mirrors the dkg-citation on-disk atomic-write pattern.
backend/app/services/waybackclaw_publisher.py:300
↓ 1 callers
Function
_yes_probability
Return the YES-side probability for a Polymarket binary market. Direction-aware: a Bullish swarm predicts YES with the bullish cohort's stren
backend/app/services/polymarket_service.py:106
↓ 1 callers
Method
add_action
Add action to recent actions list
backend/app/services/simulation_run_state.py:131
↓ 1 callers
Method
add_activity
Add an agent activity to queue
backend/app/services/graph_memory_updater.py:251
↓ 1 callers
Method
add_activity_from_dict
Add activity from dict data
backend/app/services/graph_memory_updater.py:261
↓ 1 callers
Function
all_pairs_synonyms
Return True if every distinct pair of EN strings in `ens` is a synonym. Used to suppress C2 false positives when the same FR legitimately covers
scripts/scan_i18n.py:279
↓ 1 callers
Function
allowed_file
Check if the file extension is allowed
backend/app/api/graph.py:28
↓ 1 callers
Function
analyze
()
backend/scripts/test_3platform_interconnected.py:182
↓ 1 callers
Method
analyze_graph_structure
[Graph Structure Analysis] Runs degree centrality, community detection, and bridge entity identification. Returns a structur
backend/app/services/graph_tools.py:1893
↓ 1 callers
Function
analyze_market_results
Analyze final market state and compare to initial prices.
backend/scripts/test_market_generation.py:190
↓ 1 callers
Function
analyze_results
Analyze all platform outputs.
backend/scripts/test_pipeline_twitter_polymarket.py:221
↓ 1 callers
Method
assemble_full_report
Assemble complete report Assemble complete report from saved section files and clean headings
backend/app/services/report_agent.py:3372
↓ 1 callers
Function
available_locales
Discover locale subdirectories under ``locales/``. Returns directory names converted back to locale codes (``zh_CN`` → ``zh-CN``). Cached on
backend/app/prompts/registry.py:56
↓ 1 callers
Method
branch_counterfactual
Fork a simulation and schedule a counterfactual injection at trigger_round. Semantics (runner-contract): 1. Forks the parent → ne
backend/app/services/simulation_manager.py:603
↓ 1 callers
Method
browse_clusters
"Zoom out" tool — return LLM-summarized community clusters over the graph. Behaviour: - If no communities exist yet, auto-
backend/app/services/graph_tools.py:417
↓ 1 callers
Method
browse_markets
Browse active prediction markets with current prices. Returns: dict: A dictionary with 'success' and 'markets' containing a
backend/wonderwall/simulations/polymarket/actions.py:23
↓ 1 callers
Method
build
Full rebuild: cluster → summarize → replace existing communities. Idempotent: deletes existing :Community nodes for the graph, then
backend/app/storage/community_builder.py:65
↓ 1 callers
Function
build_archive_zip
Encode ``surfaces`` + ``manifest.json`` as a single ZIP byte stream. The ZIP is built with ``ZIP_DEFLATED`` (default zlib compression) — shar
backend/app/services/archive_service.py:402
↓ 1 callers
Function
build_chart_svg
Assemble the SVG root element for the trajectory chart. The root is a complete SVG 1.1 document with explicit ``viewBox`` so it scales cleanl
backend/app/services/chart_svg.py:375
↓ 1 callers
Method
build_context
Build the full memory context string for injection. Returns a prompt section with: 1. Ancient summary (batched compaction of very old
backend/scripts/round_memory.py:213
↓ 1 callers
Function
build_example_curl
Build a one-line ``curl`` invocation re-creating this sim. Uses the literal placeholder ``https://your-host`` so a copy-paste of the example
backend/app/services/clone_service.py:261
↓ 1 callers
Function
build_html_body
Render the ``text/html`` part. Single ``<table>`` layout so Outlook / Gmail / Apple Mail render it consistently — modern email clients still
backend/app/services/email_notify.py:408
↓ 1 callers
Function
build_manifest
Compose the manifest dict from a list of ``(filename, bytes)``. ``generated_at`` overrides the timestamp on the returned manifest — exposed s
backend/app/services/archive_service.py:350
↓ 1 callers
Function
build_parser
()
backend/cli.py:329
↓ 1 callers
Function
build_plain_body
Render the ``text/plain`` part. Designed to read cleanly in mutt / Apple Mail / Outlook list-view previews — the leading lines carry the high
backend/app/services/email_notify.py:310
↓ 1 callers
Function
build_subject
Subject line: ``[MiroShark] <Direction>: <Scenario>``. Direction is one of ``Bullish`` / ``Neutral`` / ``Bearish`` / ``Failed`` so a recipien
backend/app/services/email_notify.py:285
↓ 1 callers
Function
build_submission
Compose the WaybackClaw snapshot submission body. Returns ``(body, reproduce_sha256)``. The hash is the citation key — a verifier fetches ``m
backend/app/services/waybackclaw_publisher.py:355
↓ 1 callers
Method
build_system_prompt
Build the system prompt for an agent given its user info.
backend/wonderwall/simulations/base.py:352
↓ 1 callers
Function
build_turtle
Compose the Turtle RDF for one simulation's Knowledge Asset. Returns ``(turtle_text, reproduce_sha256)``. The hash is the citation key — a ve
backend/app/services/dkg_publisher.py:327
↓ 1 callers
Function
calculate_hot_score
Compute the hot score for a post. Args: num_likes (int): Number of likes. num_dislikes (int): Number of dislikes. cr
backend/wonderwall/social_platform/recsys.py:168
↓ 1 callers
Function
calculate_like_similarity
(liked_vectors, target_vectors)
backend/wonderwall/social_platform/recsys.py:389
↓ 1 callers
Method
call_tool
(self, name: str, args: Dict[str, Any], timeout: float)
backend/scripts/mcp_agent_bridge.py:187
↓ 1 callers
Function
card_builder
(state, sim_dir)
backend/tests/test_unit_feed.py:477
↓ 1 callers
Function
catalog_count
Number of ecosystem entries currently catalogued.
backend/app/services/ecosystem_catalog.py:233
↓ 1 callers
Method
chat
Send a chat request via Claude Code CLI. Args: messages: List of messages (OpenAI format) temperature: Ignor
backend/app/utils/claude_code_client.py:81
↓ 1 callers
Function
claim_retry_slot
Reserve a retry slot for ``simulation_id``. Returns ``None`` if the call is allowed (caller may proceed); returns the number of seconds remai
backend/app/services/webhook_service.py:208
↓ 1 callers
Function
clamp_limit
Clamp ``value`` into ``[MIN_LIMIT, MAX_LIMIT]``. Non-numeric, missing, ``None``, or ``bool`` inputs fall back to ``DEFAULT_LIMIT``. Numeric i
backend/app/services/activity_feed.py:238
↓ 1 callers
Method
cleanup_all_simulations
Clean up all running simulation processes Called when server shuts down to ensure all child processes are terminated
backend/app/services/simulation_runner.py:1328
↓ 1 callers
Method
cleanup_simulation_logs
Clean up simulation run logs (for forcing a fresh restart) Will delete the following files: - run_state.json
backend/app/services/simulation_runner.py:1233
↓ 1 callers
Function
cleanup_synthetic_data
Clean up synthetic test data
scripts/synthetic_seed.py:66
↓ 1 callers
Method
close
r"""Stop the platform and close the environment.
backend/wonderwall/environment/env.py:273
↓ 1 callers
Method
close_simulation_env
Close simulation environment (without stopping the simulation process) Send close environment command to the simulation, all
backend/app/services/simulation_runner.py:1752
↓ 1 callers
Function
coarse_filtering
Coarse filtering posts and return selected elements with their indices.
backend/wonderwall/social_platform/recsys.py:403
↓ 1 callers
Method
compact_previous_round
Compact round N-2 (the round before the previous one). Called at the end of each round. Runs the LLM call in a background thread so i
backend/scripts/round_memory.py:289
↓ 1 callers
Function
compute_signature
Return the HMAC-SHA256 hex digest of ``canonical`` under ``secret``. Symmetric with ``webhook_service.compute_signature`` (which prefixes ``s
backend/app/services/signed_result.py:120
↓ 1 callers
Function
compute_volatility
Collapse the per-round list into the volatility summary. ``rounds`` is the projection produced by ``peak_round.load_trajectory_rounds`` (one
backend/app/services/volatility_service.py:142
↓ 1 callers
Function
connect_platform_channel
( channel: Channel, agent_graph: AgentGraph | None = None, )
backend/wonderwall/social_agent/agents_generator.py:538
↓ 1 callers
Method
create_agent
(self, agent_id: int)
backend/wonderwall/social_agent/agent_graph.py:37
↓ 1 callers
Method
create_project
Create a new project Args: name: Project name Returns: Newly created Project object
backend/app/models/project.py:151
↓ 1 callers
Method
create_simulation
Create a new simulation Args: project_id: Project ID graph_id: Graph ID enable_twitter: Whether
backend/app/services/simulation_manager.py:245
↓ 1 callers
Function
create_synthetic_data
Create synthetic test data in Neo4j
scripts/synthetic_seed.py:14
↓ 1 callers
Function
create_test_data
Create minimal test profiles and config.
backend/scripts/test_polymarket.py:36
↓ 1 callers
Method
create_updater
Create a graph memory updater for a simulation. Args: simulation_id: Simulation ID graph_id: Graph ID
backend/app/services/graph_memory_updater.py:423
↓ 1 callers
Method
delete_agent
(self, agent_id: int)
backend/wonderwall/social_agent/agent_graph.py:41
↓ 1 callers
Method
delete_project
Delete project and all its files Args: project_id: Project ID Returns: Whether deletion was success
backend/app/models/project.py:240
↓ 1 callers
Method
delete_report
Delete report (entire folder)
backend/app/services/report_agent.py:3647
↓ 1 callers
Method
detect_contradictions
[Contradiction Detector] Finds entity pairs connected by edges with opposing sentiments. Contradictions reveal tension point
backend/app/services/graph_tools.py:2005
↓ 1 callers
Function
disable_wonderwall_logging
Disable verbose log output from the Wonderwall library Wonderwall logs are too verbose (logging each agent's observations and actions); we us
backend/scripts/run_parallel_simulation.py:133
↓ 1 callers
Method
dispatch_calls
Run each call against its server. Never raises — failures become ok=False.
backend/scripts/mcp_agent_bridge.py:267
↓ 1 callers
Function
documented_paths
Return every path key declared in ``openapi.yaml``. Used by ``test_unit_openapi`` to verify documented paths line up with Flask routes regist
backend/app/api/docs.py:255
↓ 1 callers
Function
dominant_stance
Return ``"bullish" | "neutral" | "bearish"`` for the card, or ``None`` when no consensus is computable yet (in-progress sims, empty trajectory
backend/app/services/gallery_filters.py:166
↓ 1 callers
Function
drawHeader
(ctx)
frontend/src/utils/chartExport.js:51
↓ 1 callers
Method
extract
Extract entities and relations from text, guided by ontology. Args: text: Input text chunk ontology: Dict wi
backend/app/storage/ner_extractor.py:26
↓ 1 callers
Method
extract_from_multiple
Extract text from multiple files and merge Args: file_paths: List of file paths Returns: Merged tex
backend/app/utils/file_parser.py:123
↓ 1 callers
Function
fetch_rec_table_as_matrix
(cursor: sqlite3.Cursor)
backend/wonderwall/social_platform/database.py:189
↓ 1 callers
Method
filter
(self, record)
backend/scripts/run_reddit_simulation.py:93
↓ 1 callers
Function
filter_cards
Return the subset of ``cards`` that satisfy every supplied filter. All filters combine with logical AND. An empty / ``None`` filter is a no-o
backend/app/services/gallery_filters.py:245
↓ 1 callers
Function
find_call_end
Find the index after the matching close paren, skipping strings (single, double, and backtick-quoted).
scripts/scan_i18n.py:75
↓ 1 callers
Method
find_causal_path
[Causal Path Finder] Traces the shortest relationship path between two entities. Each step is annotated with the edge fact,
backend/app/services/graph_tools.py:1973
↓ 1 callers
Function
find_children
Return the public children whose ``parent_simulation_id`` matches. Walks ``data_dir`` once, loading each sim's state.json. A sim is a child w
backend/app/services/lineage_service.py:265
↓ 1 callers
Method
from_dict
(cls, data: Dict[str, Any])
backend/app/services/simulation_ipc.py:54
↓ 1 callers
Function
generate
()
backend/app/api/observability.py:76
↓ 1 callers
Function
generate_custom_agents
( channel: Channel, agent_graph: AgentGraph | None = None, )
backend/wonderwall/social_agent/agents_generator.py:548
↓ 1 callers
Function
generate_post_vector_openai
Generate embeddings using OpenAI API Args: texts: List of texts to process batch_size: Size of each batch
backend/wonderwall/social_platform/process_recsys_posts.py:49
↓ 1 callers
Function
getActivityFeedUrl
(limit, origin)
frontend/src/api/simulation.js:1338
↓ 1 callers
Function
getAgentSparklinesUrl
(simulationId, origin)
frontend/src/api/simulation.js:964
↓ 1 callers
Function
getAgentsJsonUrl
(simulationId, origin)
frontend/src/api/simulation.js:1010
↓ 1 callers
Function
getArchiveZipUrl
(simulationId, origin)
frontend/src/api/simulation.js:1085
↓ 1 callers
Function
getCloneJsonUrl
(simulationId, origin)
frontend/src/api/simulation.js:821
↓ 1 callers
Function
getEcosystemUrl
(origin)
frontend/src/api/simulation.js:1230
← previous
next →
1,101–1,200 of 3,647, ranked by callers