slife2 0.1.0__tar.gz

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.
Files changed (162) hide show
  1. slife2-0.1.0/.gitignore +200 -0
  2. slife2-0.1.0/DESIGN.md +3662 -0
  3. slife2-0.1.0/LICENSE +21 -0
  4. slife2-0.1.0/PKG-INFO +1183 -0
  5. slife2-0.1.0/README.md +1148 -0
  6. slife2-0.1.0/pyproject.toml +279 -0
  7. slife2-0.1.0/sdd.md +1046 -0
  8. slife2-0.1.0/slife2/__init__.py +480 -0
  9. slife2-0.1.0/slife2/__main__.py +5 -0
  10. slife2-0.1.0/slife2/clients/__init__.py +7 -0
  11. slife2-0.1.0/slife2/clients/embedder.py +160 -0
  12. slife2-0.1.0/slife2/clients/gateway.py +677 -0
  13. slife2-0.1.0/slife2/clients/model.py +241 -0
  14. slife2-0.1.0/slife2/clients/toolclient.py +305 -0
  15. slife2-0.1.0/slife2/helpers/__init__.py +4 -0
  16. slife2-0.1.0/slife2/helpers/clock.py +43 -0
  17. slife2-0.1.0/slife2/helpers/timeouts.py +369 -0
  18. slife2-0.1.0/slife2/helpers/timeutil.py +257 -0
  19. slife2-0.1.0/slife2/libs/__init__.py +4 -0
  20. slife2-0.1.0/slife2/libs/harness/__init__.py +4 -0
  21. slife2-0.1.0/slife2/libs/harness/async_tasks.py +594 -0
  22. slife2-0.1.0/slife2/libs/harness/handover.py +279 -0
  23. slife2-0.1.0/slife2/libs/harness/markers.py +46 -0
  24. slife2-0.1.0/slife2/libs/host/__init__.py +4 -0
  25. slife2-0.1.0/slife2/libs/host/config.py +2534 -0
  26. slife2-0.1.0/slife2/libs/host/configfile.py +678 -0
  27. slife2-0.1.0/slife2/libs/host/launcher.py +916 -0
  28. slife2-0.1.0/slife2/libs/host/paths.py +317 -0
  29. slife2-0.1.0/slife2/libs/host/runtime.py +1055 -0
  30. slife2-0.1.0/slife2/libs/model/__init__.py +5 -0
  31. slife2-0.1.0/slife2/libs/model/base.py +130 -0
  32. slife2-0.1.0/slife2/libs/model/wire.py +121 -0
  33. slife2-0.1.0/slife2/libs/plugin/__init__.py +4 -0
  34. slife2-0.1.0/slife2/libs/plugin/audience.py +180 -0
  35. slife2-0.1.0/slife2/libs/plugin/family.py +1024 -0
  36. slife2-0.1.0/slife2/libs/plugin/protocol.py +593 -0
  37. slife2-0.1.0/slife2/libs/store/__init__.py +4 -0
  38. slife2-0.1.0/slife2/libs/store/catalogue.py +1946 -0
  39. slife2-0.1.0/slife2/libs/store/db.py +1601 -0
  40. slife2-0.1.0/slife2/libs/store/index.py +845 -0
  41. slife2-0.1.0/slife2/libs/store/textindex.py +202 -0
  42. slife2-0.1.0/slife2/libs/turn/__init__.py +4 -0
  43. slife2-0.1.0/slife2/libs/turn/attachments.py +316 -0
  44. slife2-0.1.0/slife2/libs/turn/context.py +580 -0
  45. slife2-0.1.0/slife2/libs/turn/events.py +359 -0
  46. slife2-0.1.0/slife2/libs/turn/loop.py +546 -0
  47. slife2-0.1.0/slife2/libs/turn/messages.py +307 -0
  48. slife2-0.1.0/slife2/libs/turn/prompt.py +100 -0
  49. slife2-0.1.0/slife2/libs/turn/templates/a2a_orphans.j2 +9 -0
  50. slife2-0.1.0/slife2/libs/turn/templates/agent_task.j2 +19 -0
  51. slife2-0.1.0/slife2/libs/turn/templates/recall.j2 +108 -0
  52. slife2-0.1.0/slife2/libs/turn/templates/schedule.j2 +15 -0
  53. slife2-0.1.0/slife2/libs/turn/templates/system.j2 +3 -0
  54. slife2-0.1.0/slife2/libs/turn/tokens.py +229 -0
  55. slife2-0.1.0/slife2/libs/turn/tools.py +452 -0
  56. slife2-0.1.0/slife2/plugins/__init__.py +11 -0
  57. slife2-0.1.0/slife2/plugins/a2a/__init__.py +34 -0
  58. slife2-0.1.0/slife2/plugins/a2a/broker.py +352 -0
  59. slife2-0.1.0/slife2/plugins/a2a/inbound_store.py +321 -0
  60. slife2-0.1.0/slife2/plugins/a2a/mesh.py +1421 -0
  61. slife2-0.1.0/slife2/plugins/a2a/server.py +1086 -0
  62. slife2-0.1.0/slife2/plugins/a2a/task_store.py +155 -0
  63. slife2-0.1.0/slife2/plugins/agent/__init__.py +1 -0
  64. slife2-0.1.0/slife2/plugins/agent/server.py +2535 -0
  65. slife2-0.1.0/slife2/plugins/agent_task/__init__.py +1 -0
  66. slife2-0.1.0/slife2/plugins/agent_task/server.py +1016 -0
  67. slife2-0.1.0/slife2/plugins/cabinet/__init__.py +1 -0
  68. slife2-0.1.0/slife2/plugins/cabinet/server.py +1006 -0
  69. slife2-0.1.0/slife2/plugins/cabinet/store.py +1591 -0
  70. slife2-0.1.0/slife2/plugins/cli/__init__.py +1 -0
  71. slife2-0.1.0/slife2/plugins/cli/server.py +397 -0
  72. slife2-0.1.0/slife2/plugins/context/__init__.py +1 -0
  73. slife2-0.1.0/slife2/plugins/context/server.py +874 -0
  74. slife2-0.1.0/slife2/plugins/file_tunnel/__init__.py +14 -0
  75. slife2-0.1.0/slife2/plugins/file_tunnel/providers.py +1460 -0
  76. slife2-0.1.0/slife2/plugins/file_tunnel/server.py +637 -0
  77. slife2-0.1.0/slife2/plugins/llm/__init__.py +44 -0
  78. slife2-0.1.0/slife2/plugins/llm/anthropic_server.py +558 -0
  79. slife2-0.1.0/slife2/plugins/llm/embeddings_server.py +358 -0
  80. slife2-0.1.0/slife2/plugins/llm/openai_responses_server.py +574 -0
  81. slife2-0.1.0/slife2/plugins/llm/openai_server.py +366 -0
  82. slife2-0.1.0/slife2/plugins/llm/server_common.py +616 -0
  83. slife2-0.1.0/slife2/plugins/mcp_tools/__init__.py +1 -0
  84. slife2-0.1.0/slife2/plugins/mcp_tools/server.py +293 -0
  85. slife2-0.1.0/slife2/plugins/media/__init__.py +10 -0
  86. slife2-0.1.0/slife2/plugins/media/adapters.py +821 -0
  87. slife2-0.1.0/slife2/plugins/media/server.py +396 -0
  88. slife2-0.1.0/slife2/plugins/restapi/__init__.py +1 -0
  89. slife2-0.1.0/slife2/plugins/restapi/server.py +324 -0
  90. slife2-0.1.0/slife2/plugins/schedule/__init__.py +1 -0
  91. slife2-0.1.0/slife2/plugins/schedule/expressions.py +185 -0
  92. slife2-0.1.0/slife2/plugins/schedule/server.py +1044 -0
  93. slife2-0.1.0/slife2/plugins/schedule/store.py +640 -0
  94. slife2-0.1.0/slife2/plugins/skills/__init__.py +2 -0
  95. slife2-0.1.0/slife2/plugins/skills/playbooks.py +643 -0
  96. slife2-0.1.0/slife2/plugins/skills/server.py +404 -0
  97. slife2-0.1.0/slife2/plugins/toolhub/__init__.py +1 -0
  98. slife2-0.1.0/slife2/plugins/toolhub/server.py +2900 -0
  99. slife2-0.1.0/slife2/plugins/tui/__init__.py +4 -0
  100. slife2-0.1.0/slife2/plugins/tui/server.py +529 -0
  101. slife2-0.1.0/slife2/plugins/wechat/__init__.py +1 -0
  102. slife2-0.1.0/slife2/plugins/wechat/ilink.py +637 -0
  103. slife2-0.1.0/slife2/plugins/wechat/server.py +1630 -0
  104. slife2-0.1.0/slife2/tui/__init__.py +14 -0
  105. slife2-0.1.0/slife2/tui/app.py +1047 -0
  106. slife2-0.1.0/slife2/tui/app.tcss +159 -0
  107. slife2-0.1.0/slife2/tui/client.py +645 -0
  108. slife2-0.1.0/slife2/tui/notes.py +83 -0
  109. slife2-0.1.0/slife2/tui/restore.py +263 -0
  110. slife2-0.1.0/slife2/tui/theme.py +74 -0
  111. slife2-0.1.0/slife2/tui/widgets.py +1689 -0
  112. slife2-0.1.0/slife2.yaml +851 -0
  113. slife2-0.1.0/tests/clients/test_gateway.py +571 -0
  114. slife2-0.1.0/tests/clients/test_mcp_backend.py +244 -0
  115. slife2-0.1.0/tests/clients/test_toolclient.py +469 -0
  116. slife2-0.1.0/tests/conftest.py +220 -0
  117. slife2-0.1.0/tests/e2e/test_a_turn_over_the_real_stack.py +401 -0
  118. slife2-0.1.0/tests/fakes.py +611 -0
  119. slife2-0.1.0/tests/helpers/test_timeutil.py +280 -0
  120. slife2-0.1.0/tests/libs/harness/test_markers.py +102 -0
  121. slife2-0.1.0/tests/libs/host/test_config.py +1226 -0
  122. slife2-0.1.0/tests/libs/host/test_configfile.py +582 -0
  123. slife2-0.1.0/tests/libs/host/test_launcher.py +960 -0
  124. slife2-0.1.0/tests/libs/host/test_paths.py +152 -0
  125. slife2-0.1.0/tests/libs/host/test_runtime.py +887 -0
  126. slife2-0.1.0/tests/libs/model/test_wire.py +261 -0
  127. slife2-0.1.0/tests/libs/plugin/test_protocol.py +234 -0
  128. slife2-0.1.0/tests/libs/store/test_db.py +614 -0
  129. slife2-0.1.0/tests/libs/store/test_db_search.py +646 -0
  130. slife2-0.1.0/tests/libs/store/test_textindex.py +150 -0
  131. slife2-0.1.0/tests/libs/store/test_toolsdb.py +1123 -0
  132. slife2-0.1.0/tests/libs/turn/test_attachments.py +237 -0
  133. slife2-0.1.0/tests/libs/turn/test_loop.py +612 -0
  134. slife2-0.1.0/tests/libs/turn/test_tokens.py +173 -0
  135. slife2-0.1.0/tests/libs/turn/test_tool_params.py +641 -0
  136. slife2-0.1.0/tests/libs/turn/test_tools.py +84 -0
  137. slife2-0.1.0/tests/plugins/a2a/test_a2a.py +1961 -0
  138. slife2-0.1.0/tests/plugins/agent/test_model_tools.py +417 -0
  139. slife2-0.1.0/tests/plugins/agent/test_server.py +2215 -0
  140. slife2-0.1.0/tests/plugins/agent_task/test_agent_task.py +914 -0
  141. slife2-0.1.0/tests/plugins/cabinet/test_cabinet.py +911 -0
  142. slife2-0.1.0/tests/plugins/cli/test_cli_server.py +404 -0
  143. slife2-0.1.0/tests/plugins/context/test_context_server.py +954 -0
  144. slife2-0.1.0/tests/plugins/file_tunnel/test_file_tunnel.py +766 -0
  145. slife2-0.1.0/tests/plugins/file_tunnel/test_file_tunnel_providers.py +861 -0
  146. slife2-0.1.0/tests/plugins/llm/test_embeddings_server.py +299 -0
  147. slife2-0.1.0/tests/plugins/llm/test_llm_servers.py +2116 -0
  148. slife2-0.1.0/tests/plugins/mcp_tools/test_mcp_tools.py +349 -0
  149. slife2-0.1.0/tests/plugins/media/test_media.py +757 -0
  150. slife2-0.1.0/tests/plugins/restapi/test_restapi_tools.py +389 -0
  151. slife2-0.1.0/tests/plugins/schedule/test_schedule.py +1290 -0
  152. slife2-0.1.0/tests/plugins/skills/test_skills.py +452 -0
  153. slife2-0.1.0/tests/plugins/skills/test_skills_server.py +348 -0
  154. slife2-0.1.0/tests/plugins/skills/test_skills_tools.py +357 -0
  155. slife2-0.1.0/tests/plugins/toolhub/test_toolhub.py +2498 -0
  156. slife2-0.1.0/tests/plugins/tui/test_tui_control.py +489 -0
  157. slife2-0.1.0/tests/plugins/wechat/test_wechat.py +1488 -0
  158. slife2-0.1.0/tests/test_no_magic_timeouts.py +431 -0
  159. slife2-0.1.0/tests/test_smoke.py +360 -0
  160. slife2-0.1.0/tests/tui/test_approval.py +209 -0
  161. slife2-0.1.0/tests/tui/test_tui.py +2665 -0
  162. slife2-0.1.0/tests/tui/test_tui_client.py +516 -0
@@ -0,0 +1,200 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py.cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # Pipfile.lock
93
+
94
+ # UV
95
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
96
+ # uv.lock
97
+
98
+ # poetry
99
+ # poetry.lock
100
+ # poetry.toml
101
+
102
+ # pdm
103
+ .pdm-python
104
+ .pdm-build/
105
+
106
+ # pixi
107
+ .pixi
108
+
109
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
110
+ __pypackages__/
111
+
112
+ # Celery stuff
113
+ celerybeat-schedule
114
+ celerybeat.pid
115
+
116
+ # Redis
117
+ *.rdb
118
+ *.aof
119
+ *.pid
120
+
121
+ # RabbitMQ
122
+ mnesia/
123
+ rabbitmq/
124
+ rabbitmq-data/
125
+
126
+ # ActiveMQ
127
+ activemq-data/
128
+
129
+ # SageMath parsed files
130
+ *.sage.py
131
+
132
+ # Environments
133
+ .env
134
+ .envrc
135
+ .venv
136
+ env/
137
+ venv/
138
+ ENV/
139
+ env.bak/
140
+ venv.bak/
141
+
142
+ # Spyder project settings
143
+ .spyderproject
144
+ .spyproject
145
+
146
+ # Rope project settings
147
+ .ropeproject
148
+
149
+ # mkdocs documentation
150
+ /site
151
+
152
+ # mypy
153
+ .mypy_cache/
154
+ .dmypy.json
155
+ dmypy.json
156
+
157
+ # Pyre type checker
158
+ .pyre/
159
+
160
+ # pytype static type analyzer
161
+ .pytype/
162
+
163
+ # Cython debug symbols
164
+ cython_debug/
165
+
166
+ # PyCharm
167
+ # .idea/
168
+
169
+ # Abstra
170
+ .abstra/
171
+
172
+ # Visual Studio Code
173
+ # .vscode/
174
+ tempCodeRunnerFile.py
175
+
176
+ # Ruff stuff:
177
+ .ruff_cache/
178
+
179
+ # PyPI configuration file
180
+ .pypirc
181
+
182
+ # Marimo
183
+ marimo/_static/
184
+ marimo/_lsp/
185
+ __marimo__/
186
+
187
+ # Streamlit
188
+ .streamlit/secrets.toml
189
+
190
+ # slife2's data directory, when it is the checkout itself.
191
+ #
192
+ # A checkout keeps its data beside itself so the checked-in slife2.yaml is the
193
+ # one in use and agents/ is a directory you can open. That puts generated
194
+ # state in the working tree, which is exactly what this keeps out of it:
195
+ # runtime/ is a daemon's bookkeeping and agents/ is where a conversation, a
196
+ # cabinet and a WeChat login live, and none of them belongs in a commit. slife2.yaml and skills/ are deliberately NOT ignored —
197
+ # both are written by a person rather than produced by a run, and neither holds
198
+ # a secret, so both are the file the whole arrangement exists to read.
199
+ runtime/
200
+ agents/