hypermind 0.11.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- hmctl/__init__.py +7 -0
- hmctl/cli.py +947 -0
- hypermind/__init__.py +208 -0
- hypermind/_deprecations.py +108 -0
- hypermind/agent.py +2896 -0
- hypermind/agent_card.py +127 -0
- hypermind/api/__init__.py +32 -0
- hypermind/api/app.py +686 -0
- hypermind/capability.py +923 -0
- hypermind/consult.py +493 -0
- hypermind/consult_bias.py +112 -0
- hypermind/contract_net.py +219 -0
- hypermind/crypto/__init__.py +21 -0
- hypermind/crypto/cose_encrypt.py +126 -0
- hypermind/crypto/dkg.py +246 -0
- hypermind/crypto/domain.py +59 -0
- hypermind/crypto/frost.py +771 -0
- hypermind/crypto/hashing.py +38 -0
- hypermind/crypto/hlc.py +163 -0
- hypermind/crypto/hpke.py +277 -0
- hypermind/crypto/kms.py +196 -0
- hypermind/crypto/kms_backends/__init__.py +56 -0
- hypermind/crypto/kms_backends/aws.py +128 -0
- hypermind/crypto/kms_backends/azure.py +114 -0
- hypermind/crypto/kms_backends/gcp.py +97 -0
- hypermind/crypto/kms_backends/vault.py +120 -0
- hypermind/crypto/namespace_root.py +204 -0
- hypermind/crypto/pq.py +152 -0
- hypermind/crypto/room_epoch.py +97 -0
- hypermind/crypto/signing.py +245 -0
- hypermind/deliberation.py +355 -0
- hypermind/did_web.py +256 -0
- hypermind/dispute.py +858 -0
- hypermind/errors.py +218 -0
- hypermind/eval/__init__.py +49 -0
- hypermind/eval/calibration.py +307 -0
- hypermind/eval/comparison.py +251 -0
- hypermind/eval/replay.py +202 -0
- hypermind/eval/swarm_iq.py +718 -0
- hypermind/knowledge/__init__.py +17 -0
- hypermind/knowledge/citation_graph.py +141 -0
- hypermind/knowledge/correlated_agreement.py +167 -0
- hypermind/knowledge/embedding_registry.py +115 -0
- hypermind/knowledge/kernel_store.py +197 -0
- hypermind/knowledge/rekor.py +173 -0
- hypermind/knowledge/reputation.py +364 -0
- hypermind/knowledge/swarm_memory.py +523 -0
- hypermind/knowledge/transparency.py +409 -0
- hypermind/mcp/__init__.py +60 -0
- hypermind/mcp/bridge.py +151 -0
- hypermind/mcp/client.py +142 -0
- hypermind/mcp/provenance.py +214 -0
- hypermind/mcp/relata_tools.py +152 -0
- hypermind/mcp/server.py +248 -0
- hypermind/mcp/transport.py +206 -0
- hypermind/mind/__init__.py +150 -0
- hypermind/mind/active.py +234 -0
- hypermind/mind/belief.py +369 -0
- hypermind/mind/deliberator.py +625 -0
- hypermind/mind/diversity.py +144 -0
- hypermind/mind/evolve.py +184 -0
- hypermind/mind/federation.py +154 -0
- hypermind/mind/goals.py +117 -0
- hypermind/mind/integration.py +190 -0
- hypermind/mind/mediator.py +74 -0
- hypermind/mind/memory_store.py +129 -0
- hypermind/mind/policy.py +307 -0
- hypermind/mind/records.py +260 -0
- hypermind/mind/roles.py +190 -0
- hypermind/mind/sybil_guard.py +41 -0
- hypermind/mind/world_model.py +166 -0
- hypermind/namespace.py +515 -0
- hypermind/namespace_policy.py +254 -0
- hypermind/observability/__init__.py +25 -0
- hypermind/observability/asgi.py +214 -0
- hypermind/observability/cost.py +277 -0
- hypermind/observability/otel_export.py +200 -0
- hypermind/observability/recorder.py +344 -0
- hypermind/observability/swarm_trace.py +438 -0
- hypermind/pin_policy.py +116 -0
- hypermind/py.typed +0 -0
- hypermind/responders/__init__.py +87 -0
- hypermind/responders/anthropic.py +159 -0
- hypermind/responders/base.py +162 -0
- hypermind/responders/openai.py +199 -0
- hypermind/responders/router.py +254 -0
- hypermind/responders/structured.py +287 -0
- hypermind/responders/tools.py +444 -0
- hypermind/revocation.py +270 -0
- hypermind/rule_ids.py +135 -0
- hypermind/schemas/encrypted_statement.cddl +28 -0
- hypermind/schemas/namespace_accept.cddl +20 -0
- hypermind/schemas/namespace_create.cddl +25 -0
- hypermind/schemas/namespace_founding_attest.cddl +30 -0
- hypermind/schemas/namespace_invite.cddl +22 -0
- hypermind/schemas/wire-v0.1.cddl +73 -0
- hypermind/simlab/__init__.py +15 -0
- hypermind/simlab/_persona_registry.py +93 -0
- hypermind/simlab/_scenario_impl.py +2778 -0
- hypermind/simlab/app.py +2538 -0
- hypermind/simlab/backends/__init__.py +27 -0
- hypermind/simlab/backends/anchor.py +88 -0
- hypermind/simlab/backends/local.py +32 -0
- hypermind/simlab/backends/server.py +79 -0
- hypermind/simlab/cli_command.py +108 -0
- hypermind/simlab/config.py +106 -0
- hypermind/simlab/deployment.py +26 -0
- hypermind/simlab/knowledge.py +716 -0
- hypermind/simlab/learning.py +295 -0
- hypermind/simlab/modes/__init__.py +115 -0
- hypermind/simlab/modes/_eval_real_llm.py +373 -0
- hypermind/simlab/modes/aar.py +611 -0
- hypermind/simlab/modes/backtest.py +610 -0
- hypermind/simlab/modes/binary_forecast.py +69 -0
- hypermind/simlab/modes/conformance.py +1869 -0
- hypermind/simlab/modes/evaluation.py +2271 -0
- hypermind/simlab/modes/governance.py +648 -0
- hypermind/simlab/modes/redteam.py +534 -0
- hypermind/simlab/modes/tabletop.py +797 -0
- hypermind/simlab/modes/tournament.py +448 -0
- hypermind/simlab/modes/whatif.py +523 -0
- hypermind/simlab/namespace.py +125 -0
- hypermind/simlab/personas.py +477 -0
- hypermind/simlab/prompt_generator.py +172 -0
- hypermind/simlab/question_sets/geopolitics_q20.json +122 -0
- hypermind/simlab/question_sets/governance_q5.json +67 -0
- hypermind/simlab/question_sets/msft_outlook_q10.json +62 -0
- hypermind/simlab/question_sets/whatif_q3.json +38 -0
- hypermind/simlab/registry.py +325 -0
- hypermind/simlab/runner.py +239 -0
- hypermind/simlab/scenario.py +147 -0
- hypermind/simlab/swarms.py +180 -0
- hypermind/simlab/tool_handlers/__init__.py +4 -0
- hypermind/simlab/tool_handlers/alpha_vantage.py +39 -0
- hypermind/simlab/tool_handlers/brave.py +46 -0
- hypermind/simlab/tool_handlers/newsapi.py +50 -0
- hypermind/simlab/tool_handlers/openweather.py +46 -0
- hypermind/simlab/tool_handlers/pinecone.py +52 -0
- hypermind/simlab/tool_handlers/qdrant.py +57 -0
- hypermind/simlab/tool_handlers/query_knowledge_base.py +21 -0
- hypermind/simlab/tool_handlers/relata_recall.py +61 -0
- hypermind/simlab/tool_handlers/retrieve_document.py +21 -0
- hypermind/simlab/tool_handlers/serper.py +46 -0
- hypermind/simlab/tool_handlers/tavily.py +53 -0
- hypermind/simlab/tool_handlers/weaviate.py +65 -0
- hypermind/simlab/tool_handlers/wikipedia.py +64 -0
- hypermind/simlab/tool_handlers/wolfram.py +48 -0
- hypermind/simlab/tool_handlers/yahoo_finance.py +49 -0
- hypermind/simlab/tool_registry.py +568 -0
- hypermind/simlab/topic_adapter.py +338 -0
- hypermind/simlab/topic_questions.py +259 -0
- hypermind/storage/__init__.py +69 -0
- hypermind/storage/backend.py +71 -0
- hypermind/storage/relata.py +245 -0
- hypermind/storage/sqlite.py +258 -0
- hypermind/sync.py +191 -0
- hypermind/tal.py +175 -0
- hypermind/tasks.py +334 -0
- hypermind/testing.py +16 -0
- hypermind/tools/__init__.py +32 -0
- hypermind/tools/registry.py +61 -0
- hypermind/transport/__init__.py +22 -0
- hypermind/transport/anti_entropy.py +708 -0
- hypermind/transport/bus.py +206 -0
- hypermind/transport/knows_delta.py +204 -0
- hypermind/transport/libp2p.py +298 -0
- hypermind/transport/placement.py +58 -0
- hypermind/transport/tcp.py +797 -0
- hypermind/transport/tls_profile.py +417 -0
- hypermind/types.py +59 -0
- hypermind/uncertainty.py +222 -0
- hypermind/wire.py +897 -0
- hypermind/workflow/__init__.py +72 -0
- hypermind/workflow/engine.py +655 -0
- hypermind/workflow/plan.py +182 -0
- hypermind/workflow/repair.py +203 -0
- hypermind-0.11.0.dist-info/METADATA +524 -0
- hypermind-0.11.0.dist-info/RECORD +181 -0
- hypermind-0.11.0.dist-info/WHEEL +4 -0
- hypermind-0.11.0.dist-info/entry_points.txt +2 -0
- hypermind-0.11.0.dist-info/licenses/LICENSE +201 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"""Tiny in-process registry: (sim_id, agent_name) → persona metadata.
|
|
2
|
+
|
|
3
|
+
Used by the SSE event stream to enrich live records with persona +
|
|
4
|
+
emoji so the frontend Activity canvas can color-cluster bubbles by
|
|
5
|
+
persona without a second round-trip. Populated by ``_scenario_impl``
|
|
6
|
+
when AgentProfiles are constructed; read by ``app._handle_sim_events_stream``.
|
|
7
|
+
|
|
8
|
+
Bounded: cleared on sim completion via ``forget_sim`` to avoid leaking
|
|
9
|
+
across long-running servers. If the registry grows past the soft cap
|
|
10
|
+
(default 4096 entries) the oldest sims are evicted.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
|
|
15
|
+
from collections import OrderedDict
|
|
16
|
+
from threading import RLock
|
|
17
|
+
|
|
18
|
+
_LOCK = RLock()
|
|
19
|
+
_REGISTRY: OrderedDict[str, dict[str, dict[str, str]]] = OrderedDict()
|
|
20
|
+
_MAX_SIMS = 64 # keep last 64 sims around for late event tails
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def remember(
|
|
24
|
+
sim_id: str,
|
|
25
|
+
agent_name: str,
|
|
26
|
+
*,
|
|
27
|
+
persona: str,
|
|
28
|
+
persona_emoji: str = "",
|
|
29
|
+
display_name: str = "",
|
|
30
|
+
role: str = "",
|
|
31
|
+
) -> None:
|
|
32
|
+
"""Record a (sim_id, agent_name) → persona/role mapping.
|
|
33
|
+
|
|
34
|
+
``agent_name`` may be either the agent's friendly name (e.g.
|
|
35
|
+
``"analyst-01"``) or its kid hex; both are typically registered
|
|
36
|
+
pointing at the same metadata so the SSE handler can look up by
|
|
37
|
+
whichever identifier the underlying event carries.
|
|
38
|
+
|
|
39
|
+
``role`` (S5): one of scout/sceptic/synthesist/mediator/oracle/
|
|
40
|
+
generalist (or "" for unknown). Drives the canvas role-ring colour.
|
|
41
|
+
"""
|
|
42
|
+
if not sim_id or not agent_name:
|
|
43
|
+
return
|
|
44
|
+
with _LOCK:
|
|
45
|
+
bucket = _REGISTRY.get(sim_id)
|
|
46
|
+
if bucket is None:
|
|
47
|
+
bucket = {}
|
|
48
|
+
_REGISTRY[sim_id] = bucket
|
|
49
|
+
while len(_REGISTRY) > _MAX_SIMS:
|
|
50
|
+
_REGISTRY.popitem(last=False)
|
|
51
|
+
_REGISTRY.move_to_end(sim_id)
|
|
52
|
+
existing = bucket.get(agent_name, {})
|
|
53
|
+
bucket[agent_name] = {
|
|
54
|
+
"persona": persona,
|
|
55
|
+
"persona_emoji": persona_emoji or "",
|
|
56
|
+
"display_name": display_name or agent_name,
|
|
57
|
+
# Preserve existing role if not overridden — _scenario_impl
|
|
58
|
+
# registers personas first, then sets oracle role later.
|
|
59
|
+
"role": role or existing.get("role", ""),
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def set_role(sim_id: str, agent_name: str, role: str) -> None:
|
|
64
|
+
"""Late-binding role update. Used after _scenario_impl assigns oracle
|
|
65
|
+
and any other post-construction roles."""
|
|
66
|
+
if not sim_id or not agent_name:
|
|
67
|
+
return
|
|
68
|
+
with _LOCK:
|
|
69
|
+
bucket = _REGISTRY.get(sim_id)
|
|
70
|
+
if not bucket or agent_name not in bucket:
|
|
71
|
+
return
|
|
72
|
+
bucket[agent_name]["role"] = role
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def lookup(sim_id: str, agent_name: str) -> dict[str, str] | None:
|
|
76
|
+
if not sim_id or not agent_name:
|
|
77
|
+
return None
|
|
78
|
+
with _LOCK:
|
|
79
|
+
bucket = _REGISTRY.get(sim_id)
|
|
80
|
+
if not bucket:
|
|
81
|
+
return None
|
|
82
|
+
return bucket.get(agent_name)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
def forget_sim(sim_id: str) -> None:
|
|
86
|
+
with _LOCK:
|
|
87
|
+
_REGISTRY.pop(sim_id, None)
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
def reset() -> None:
|
|
91
|
+
"""Test-only: clear all entries."""
|
|
92
|
+
with _LOCK:
|
|
93
|
+
_REGISTRY.clear()
|