unaiverse 0.1.6__cp313-cp313-macosx_10_13_x86_64.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.

Potentially problematic release.


This version of unaiverse might be problematic. Click here for more details.

Files changed (50) hide show
  1. unaiverse/__init__.py +19 -0
  2. unaiverse/agent.py +2008 -0
  3. unaiverse/agent_basics.py +1846 -0
  4. unaiverse/clock.py +191 -0
  5. unaiverse/dataprops.py +1209 -0
  6. unaiverse/hsm.py +1880 -0
  7. unaiverse/modules/__init__.py +18 -0
  8. unaiverse/modules/cnu/__init__.py +17 -0
  9. unaiverse/modules/cnu/cnus.py +536 -0
  10. unaiverse/modules/cnu/layers.py +261 -0
  11. unaiverse/modules/cnu/psi.py +60 -0
  12. unaiverse/modules/hl/__init__.py +15 -0
  13. unaiverse/modules/hl/hl_utils.py +411 -0
  14. unaiverse/modules/networks.py +1509 -0
  15. unaiverse/modules/utils.py +680 -0
  16. unaiverse/networking/__init__.py +16 -0
  17. unaiverse/networking/node/__init__.py +18 -0
  18. unaiverse/networking/node/connpool.py +1261 -0
  19. unaiverse/networking/node/node.py +2223 -0
  20. unaiverse/networking/node/profile.py +446 -0
  21. unaiverse/networking/node/tokens.py +79 -0
  22. unaiverse/networking/p2p/__init__.py +198 -0
  23. unaiverse/networking/p2p/go.mod +127 -0
  24. unaiverse/networking/p2p/go.sum +548 -0
  25. unaiverse/networking/p2p/golibp2p.py +18 -0
  26. unaiverse/networking/p2p/golibp2p.pyi +135 -0
  27. unaiverse/networking/p2p/lib.go +2714 -0
  28. unaiverse/networking/p2p/lib.go.sha256 +1 -0
  29. unaiverse/networking/p2p/lib_types.py +312 -0
  30. unaiverse/networking/p2p/message_pb2.py +63 -0
  31. unaiverse/networking/p2p/messages.py +265 -0
  32. unaiverse/networking/p2p/mylogger.py +77 -0
  33. unaiverse/networking/p2p/p2p.py +929 -0
  34. unaiverse/networking/p2p/proto-go/message.pb.go +616 -0
  35. unaiverse/networking/p2p/unailib.cpython-313-darwin.so +0 -0
  36. unaiverse/streamlib/__init__.py +15 -0
  37. unaiverse/streamlib/streamlib.py +210 -0
  38. unaiverse/streams.py +770 -0
  39. unaiverse/utils/__init__.py +16 -0
  40. unaiverse/utils/ask_lone_wolf.json +27 -0
  41. unaiverse/utils/lone_wolf.json +19 -0
  42. unaiverse/utils/misc.py +305 -0
  43. unaiverse/utils/sandbox.py +293 -0
  44. unaiverse/utils/server.py +435 -0
  45. unaiverse/world.py +175 -0
  46. unaiverse-0.1.6.dist-info/METADATA +365 -0
  47. unaiverse-0.1.6.dist-info/RECORD +50 -0
  48. unaiverse-0.1.6.dist-info/WHEEL +6 -0
  49. unaiverse-0.1.6.dist-info/licenses/LICENSE +43 -0
  50. unaiverse-0.1.6.dist-info/top_level.txt +1 -0
@@ -0,0 +1,135 @@
1
+ from typing import List
2
+
3
+
4
+ class GoLibP2P:
5
+ def InitializeLibrary(self, max_instances: int, max_num_channels: int, max_queue_per_channel: int, max_msg_size: int, enable_logging: int) -> None:
6
+ """
7
+ InitializeLibrary(max_instances: int, max_queue_per_channel: int, max_num_channels: int, max_msg_size: int, enable_logging: int) -> bytes
8
+
9
+ Configures the P2P library.
10
+ """
11
+ ...
12
+
13
+ def CreateNode(self, instance: int, identity_dir: str, port: int, ips: List[str], enable_relay_client: int, enable_relay_service: int, knows_is_public: int, max_connections: int, enable_tls: int, domain_name: str, tls_cert_path: str, tls_key_path: str) -> bytes:
14
+ """
15
+ CreateNode(instance: int, identity_dir: str, port: int, ips: List[str], enable_relay_client: int, enable_relay_service: int, knows_is_public: int, max_connections: int, enable_tls: int, domain_name: str, tls_cert_path: str, tls_key_path: str) -> bytes
16
+
17
+ Creates a node in the P2P network and returns a JSON string with node information.
18
+ """
19
+ ...
20
+
21
+ def ConnectTo(self, instance: int, multiaddrs_json: bytes) -> bytes:
22
+ """
23
+ ConnectTo(instance: int, multiaddrs_json: bytes) -> bytes
24
+
25
+ Connects to a peer using the provided multiaddress. Returns a JSON string with the result.
26
+ """
27
+ ...
28
+
29
+ def ReserveOnRelay(self, instance: int, relay_peer_id: bytes) -> bytes:
30
+ """
31
+ ReserveOnRelay(instance: int, relay_peer_id: bytes) -> bytes
32
+
33
+ Reserves a relay port on the network. Returns a JSON result.
34
+ """
35
+ ...
36
+
37
+ def DisconnectFrom(self, instance: int, peer_id: bytes) -> bytes:
38
+ """
39
+ DisconnectFrom(instance: int, peer_id: bytes) -> bytes
40
+
41
+ Disconnects from the given peer id. Returns a JSON result.
42
+ """
43
+ ...
44
+
45
+ def GetConnectedPeers(self, instance: int) -> bytes:
46
+ """
47
+ GetConnectedPeers(instance: int) -> bytes
48
+
49
+ Returns a JSON string listing connected peers.
50
+ """
51
+ ...
52
+
53
+ def GetRendezvousPeers(self, instance: int) -> bytes:
54
+ """
55
+ GetRendezvousPeers(instance: int) -> bytes
56
+
57
+ Returns a JSON string listing rendezvous peers.
58
+ """
59
+ ...
60
+
61
+ def GetNodeAddresses(self, instance: int, arg: bytes) -> bytes:
62
+ """
63
+ GetNodeAddresses(instance: int, arg: bytes) -> bytes
64
+
65
+ Returns the node addresses in a JSON string.
66
+ """
67
+ ...
68
+
69
+ def SendMessageToPeer(
70
+ self,
71
+ instance: int,
72
+ channel: bytes,
73
+ data: bytes,
74
+ data_len: int,
75
+ ) -> bytes:
76
+ """
77
+ SendMessageToPeer(instance: int, channel: bytes, data: bytes, data_len: int) -> bytes
78
+ """
79
+ ...
80
+
81
+ def SubscribeToTopic(self, instance: int, topic_composite_key: bytes) -> bytes:
82
+ """
83
+ SubscribeToTopic(instance: int, topic_composite_key: bytes) -> bytes
84
+
85
+ Subscribes to a topic and returns a JSON string with the result.
86
+ """
87
+ ...
88
+
89
+ def UnsubscribeFromTopic(self, instance: int, topic_composite_key: bytes) -> bytes:
90
+ """
91
+ UnsubscribeFromTopic(instance: int, topic_composite_key: bytes) -> bytes
92
+
93
+ Unsubscribe from a topic and returns a JSON string with the result.
94
+ """
95
+ ...
96
+
97
+ def MessageQueueLength(self, instance: int) -> int:
98
+ """
99
+ MessageQueueLength(instance: int) -> int
100
+
101
+ Returns the current length of the message queue.
102
+ """
103
+ ...
104
+
105
+ def PopMessages(self, instance: int) -> bytes:
106
+ """
107
+ PopNMessages(instance: int) -> bytes
108
+
109
+ Pops the first message in each channel queue and returns them as a list.
110
+ """
111
+ ...
112
+
113
+ def CloseNode(self, instance: int) -> bytes:
114
+ """
115
+ CloseNode(instance: int) -> bytes
116
+
117
+ Closes the node and frees all resources.
118
+ """
119
+ ...
120
+
121
+ def FreeString(self, arg: bytes) -> None:
122
+ """
123
+ FreeString(arg: bytes) -> None
124
+
125
+ Frees a string previously allocated by the shared library.
126
+ """
127
+ ...
128
+
129
+ def FreeInt(self, arg: int) -> None:
130
+ """
131
+ FreeInt(arg: int) -> None
132
+
133
+ Frees an integer previously allocated by the shared library.
134
+ """
135
+ ...