arcana-core 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 (128) hide show
  1. arcana_core-0.1.0/.gitignore +37 -0
  2. arcana_core-0.1.0/LICENSE +201 -0
  3. arcana_core-0.1.0/NOTICE +4 -0
  4. arcana_core-0.1.0/PKG-INFO +200 -0
  5. arcana_core-0.1.0/README.md +159 -0
  6. arcana_core-0.1.0/arcana/__init__.py +25 -0
  7. arcana_core-0.1.0/arcana/agents/__init__.py +5 -0
  8. arcana_core-0.1.0/arcana/agents/agent.py +275 -0
  9. arcana_core-0.1.0/arcana/agents/registry.py +150 -0
  10. arcana_core-0.1.0/arcana/agents/session_manager.py +86 -0
  11. arcana_core-0.1.0/arcana/automations/__init__.py +0 -0
  12. arcana_core-0.1.0/arcana/cards/__init__.py +0 -0
  13. arcana_core-0.1.0/arcana/cards/definitions/__init__.py +53 -0
  14. arcana_core-0.1.0/arcana/cards/definitions/chariot.py +58 -0
  15. arcana_core-0.1.0/arcana/cards/definitions/death.py +58 -0
  16. arcana_core-0.1.0/arcana/cards/definitions/devil.py +58 -0
  17. arcana_core-0.1.0/arcana/cards/definitions/emperor.py +58 -0
  18. arcana_core-0.1.0/arcana/cards/definitions/empress.py +58 -0
  19. arcana_core-0.1.0/arcana/cards/definitions/fool.py +57 -0
  20. arcana_core-0.1.0/arcana/cards/definitions/hanged_man.py +60 -0
  21. arcana_core-0.1.0/arcana/cards/definitions/hermit.py +63 -0
  22. arcana_core-0.1.0/arcana/cards/definitions/hierophant.py +60 -0
  23. arcana_core-0.1.0/arcana/cards/definitions/high_priestess.py +56 -0
  24. arcana_core-0.1.0/arcana/cards/definitions/judgement.py +60 -0
  25. arcana_core-0.1.0/arcana/cards/definitions/justice.py +58 -0
  26. arcana_core-0.1.0/arcana/cards/definitions/lovers.py +60 -0
  27. arcana_core-0.1.0/arcana/cards/definitions/magician.py +56 -0
  28. arcana_core-0.1.0/arcana/cards/definitions/moon.py +58 -0
  29. arcana_core-0.1.0/arcana/cards/definitions/star.py +61 -0
  30. arcana_core-0.1.0/arcana/cards/definitions/strength.py +58 -0
  31. arcana_core-0.1.0/arcana/cards/definitions/sun.py +58 -0
  32. arcana_core-0.1.0/arcana/cards/definitions/temperance.py +62 -0
  33. arcana_core-0.1.0/arcana/cards/definitions/tower.py +61 -0
  34. arcana_core-0.1.0/arcana/cards/definitions/wheel_of_fortune.py +58 -0
  35. arcana_core-0.1.0/arcana/cards/definitions/world.py +58 -0
  36. arcana_core-0.1.0/arcana/cards/engine.py +186 -0
  37. arcana_core-0.1.0/arcana/cards/registry.py +46 -0
  38. arcana_core-0.1.0/arcana/context/__init__.py +1 -0
  39. arcana_core-0.1.0/arcana/context/soul.py +16 -0
  40. arcana_core-0.1.0/arcana/evals/__init__.py +46 -0
  41. arcana_core-0.1.0/arcana/evals/fixtures/__init__.py +0 -0
  42. arcana_core-0.1.0/arcana/evals/fixtures/agent_configs.py +51 -0
  43. arcana_core-0.1.0/arcana/evals/fixtures/prompts.py +46 -0
  44. arcana_core-0.1.0/arcana/evals/harness.py +340 -0
  45. arcana_core-0.1.0/arcana/evals/judge.py +333 -0
  46. arcana_core-0.1.0/arcana/evals/suites/__init__.py +0 -0
  47. arcana_core-0.1.0/arcana/evals/suites/blending.py +72 -0
  48. arcana_core-0.1.0/arcana/evals/suites/cards.py +217 -0
  49. arcana_core-0.1.0/arcana/evals/types.py +241 -0
  50. arcana_core-0.1.0/arcana/models/__init__.py +75 -0
  51. arcana_core-0.1.0/arcana/models/adapters/__init__.py +29 -0
  52. arcana_core-0.1.0/arcana/models/adapters/anthropic.py +225 -0
  53. arcana_core-0.1.0/arcana/models/adapters/base.py +140 -0
  54. arcana_core-0.1.0/arcana/models/adapters/custom_api.py +282 -0
  55. arcana_core-0.1.0/arcana/models/adapters/embedding.py +60 -0
  56. arcana_core-0.1.0/arcana/models/adapters/ollama.py +212 -0
  57. arcana_core-0.1.0/arcana/models/adapters/openai_compat.py +248 -0
  58. arcana_core-0.1.0/arcana/models/connection_store.py +122 -0
  59. arcana_core-0.1.0/arcana/models/errors.py +36 -0
  60. arcana_core-0.1.0/arcana/models/gateway.py +538 -0
  61. arcana_core-0.1.0/arcana/models/pricing.py +105 -0
  62. arcana_core-0.1.0/arcana/observability/__init__.py +78 -0
  63. arcana_core-0.1.0/arcana/observability/audit.py +61 -0
  64. arcana_core-0.1.0/arcana/observability/events.py +105 -0
  65. arcana_core-0.1.0/arcana/observability/exporters/__init__.py +0 -0
  66. arcana_core-0.1.0/arcana/observability/exporters/file.py +56 -0
  67. arcana_core-0.1.0/arcana/observability/exporters/otlp.py +28 -0
  68. arcana_core-0.1.0/arcana/observability/metrics.py +99 -0
  69. arcana_core-0.1.0/arcana/observability/tracer.py +76 -0
  70. arcana_core-0.1.0/arcana/tools/__init__.py +5 -0
  71. arcana_core-0.1.0/arcana/tools/adapters/__init__.py +0 -0
  72. arcana_core-0.1.0/arcana/tools/registry.py +205 -0
  73. arcana_core-0.1.0/arcana/types/__init__.py +96 -0
  74. arcana_core-0.1.0/arcana/types/_utils.py +18 -0
  75. arcana_core-0.1.0/arcana/types/agent.py +66 -0
  76. arcana_core-0.1.0/arcana/types/card.py +111 -0
  77. arcana_core-0.1.0/arcana/types/memory.py +402 -0
  78. arcana_core-0.1.0/arcana/types/model.py +50 -0
  79. arcana_core-0.1.0/arcana/types/session.py +83 -0
  80. arcana_core-0.1.0/arcana/types/tool.py +109 -0
  81. arcana_core-0.1.0/arcana/types/workspace.py +25 -0
  82. arcana_core-0.1.0/arcana/types/world.py +59 -0
  83. arcana_core-0.1.0/examples/multi_card_blend.py +38 -0
  84. arcana_core-0.1.0/examples/research_agent.py +50 -0
  85. arcana_core-0.1.0/pyproject.toml +58 -0
  86. arcana_core-0.1.0/tests/__init__.py +0 -0
  87. arcana_core-0.1.0/tests/agents/__init__.py +0 -0
  88. arcana_core-0.1.0/tests/agents/conftest.py +60 -0
  89. arcana_core-0.1.0/tests/agents/test_agent.py +385 -0
  90. arcana_core-0.1.0/tests/agents/test_memory_integration.py +191 -0
  91. arcana_core-0.1.0/tests/agents/test_registry.py +266 -0
  92. arcana_core-0.1.0/tests/agents/test_session_manager.py +125 -0
  93. arcana_core-0.1.0/tests/cards/__init__.py +0 -0
  94. arcana_core-0.1.0/tests/cards/conftest.py +14 -0
  95. arcana_core-0.1.0/tests/cards/test_definitions.py +176 -0
  96. arcana_core-0.1.0/tests/cards/test_engine.py +206 -0
  97. arcana_core-0.1.0/tests/cards/test_registry.py +19 -0
  98. arcana_core-0.1.0/tests/context/__init__.py +0 -0
  99. arcana_core-0.1.0/tests/context/test_soul.py +35 -0
  100. arcana_core-0.1.0/tests/evals/__init__.py +0 -0
  101. arcana_core-0.1.0/tests/evals/conftest.py +41 -0
  102. arcana_core-0.1.0/tests/evals/suites/__init__.py +0 -0
  103. arcana_core-0.1.0/tests/evals/suites/test_suites.py +27 -0
  104. arcana_core-0.1.0/tests/evals/test_harness.py +274 -0
  105. arcana_core-0.1.0/tests/evals/test_judge.py +129 -0
  106. arcana_core-0.1.0/tests/evals/test_types.py +90 -0
  107. arcana_core-0.1.0/tests/models/__init__.py +0 -0
  108. arcana_core-0.1.0/tests/models/test_adapter_base.py +99 -0
  109. arcana_core-0.1.0/tests/models/test_anthropic.py +375 -0
  110. arcana_core-0.1.0/tests/models/test_custom_api.py +464 -0
  111. arcana_core-0.1.0/tests/models/test_gateway.py +1114 -0
  112. arcana_core-0.1.0/tests/models/test_ollama.py +267 -0
  113. arcana_core-0.1.0/tests/models/test_openai_compat.py +482 -0
  114. arcana_core-0.1.0/tests/observability/__init__.py +0 -0
  115. arcana_core-0.1.0/tests/observability/test_audit.py +189 -0
  116. arcana_core-0.1.0/tests/observability/test_events.py +137 -0
  117. arcana_core-0.1.0/tests/observability/test_integration.py +167 -0
  118. arcana_core-0.1.0/tests/tools/__init__.py +0 -0
  119. arcana_core-0.1.0/tests/tools/test_mcp_registry.py +241 -0
  120. arcana_core-0.1.0/tests/types/__init__.py +0 -0
  121. arcana_core-0.1.0/tests/types/test_agent.py +58 -0
  122. arcana_core-0.1.0/tests/types/test_card.py +137 -0
  123. arcana_core-0.1.0/tests/types/test_memory.py +223 -0
  124. arcana_core-0.1.0/tests/types/test_model.py +82 -0
  125. arcana_core-0.1.0/tests/types/test_session.py +133 -0
  126. arcana_core-0.1.0/tests/types/test_tool.py +176 -0
  127. arcana_core-0.1.0/tests/types/test_workspace.py +34 -0
  128. arcana_core-0.1.0/tests/types/test_world.py +65 -0
@@ -0,0 +1,37 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.pyo
5
+ .venv/
6
+ venv/
7
+ .env
8
+ *.egg-info/
9
+ dist/
10
+ build/
11
+ .mypy_cache/
12
+ .ruff_cache/
13
+ .pytest_cache/
14
+ htmlcov/
15
+ .coverage
16
+
17
+ # Arcana runtime
18
+ ~/.arcana/secrets/
19
+
20
+ # IDE
21
+ .vscode/
22
+ .idea/
23
+ *.swp
24
+
25
+ # OS
26
+ .DS_Store
27
+ Thumbs.db
28
+
29
+ # AI-related files
30
+ CLAUDE.md
31
+ .claude
32
+
33
+ # MkDocs build output
34
+ site/
35
+
36
+ # Release docs
37
+ RELEASING.md
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Priscila Power and the Arcana OS contributors
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,4 @@
1
+ Arcana OS
2
+ Copyright 2026 Priscila Power and the Arcana OS contributors
3
+
4
+ This product is licensed under the Apache License, Version 2.0 (see LICENSE).
@@ -0,0 +1,200 @@
1
+ Metadata-Version: 2.4
2
+ Name: arcana-core
3
+ Version: 0.1.0
4
+ Summary: The OS that gives your agents a soul — core library
5
+ License-Expression: Apache-2.0
6
+ License-File: LICENSE
7
+ License-File: NOTICE
8
+ Keywords: agents,ai,llm,mcp,ollama,tarot
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: Programming Language :: Python :: 3.11
12
+ Classifier: Programming Language :: Python :: 3.12
13
+ Classifier: Programming Language :: Python :: 3.13
14
+ Classifier: Programming Language :: Python :: 3.14
15
+ Requires-Python: >=3.11
16
+ Requires-Dist: aiosqlite>=0.20.0
17
+ Requires-Dist: anthropic>=0.28.0
18
+ Requires-Dist: httpx>=0.27.0
19
+ Requires-Dist: keyring>=25.0.0
20
+ Requires-Dist: mcp>=1.0.0
21
+ Requires-Dist: openai>=1.30.0
22
+ Requires-Dist: pydantic-settings>=2.3.0
23
+ Requires-Dist: pydantic>=2.7.0
24
+ Requires-Dist: rich>=13.7.0
25
+ Provides-Extra: all
26
+ Requires-Dist: opentelemetry-api>=1.20; extra == 'all'
27
+ Requires-Dist: opentelemetry-sdk>=1.20; extra == 'all'
28
+ Requires-Dist: qdrant-client>=1.9.0; extra == 'all'
29
+ Requires-Dist: sqlite-vec>=0.1.0; extra == 'all'
30
+ Requires-Dist: watchdog>=4.0.0; extra == 'all'
31
+ Provides-Extra: observability
32
+ Requires-Dist: opentelemetry-api>=1.20; extra == 'observability'
33
+ Requires-Dist: opentelemetry-sdk>=1.20; extra == 'observability'
34
+ Provides-Extra: obsidian
35
+ Requires-Dist: watchdog>=4.0.0; extra == 'obsidian'
36
+ Provides-Extra: qdrant
37
+ Requires-Dist: qdrant-client>=1.9.0; extra == 'qdrant'
38
+ Provides-Extra: vector
39
+ Requires-Dist: sqlite-vec>=0.1.0; extra == 'vector'
40
+ Description-Content-Type: text/markdown
41
+
42
+ <p align="center">
43
+ <picture>
44
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/priscilapower/arcana-os/main/docs/assets/arcana-logo-cyan-dark.svg">
45
+ <img alt="arcana-core" src="https://raw.githubusercontent.com/priscilapower/arcana-os/main/docs/assets/arcana-logo-cyan-light.svg" width="300">
46
+ </picture>
47
+ </p>
48
+
49
+ <p align="center">
50
+ <a href="https://github.com/priscilapower/arcana-os/blob/main/LICENSE"><img alt="License: Apache 2.0" src="https://img.shields.io/badge/license-Apache_2.0-0FB5C9?style=flat-square"></a>
51
+ <img alt="Python 3.11+" src="https://img.shields.io/badge/python-3.11%2B-0FB5C9?style=flat-square">
52
+ </p>
53
+
54
+ # arcana-core
55
+
56
+ The Python library at the heart of Arcana OS. Assign a tarot card to an agent: get a soul.
57
+
58
+ ```bash
59
+ pip install arcana-core
60
+ # or inside the monorepo:
61
+ uv sync --all-packages --all-extras
62
+ ```
63
+
64
+ ---
65
+
66
+ ## Quick start
67
+
68
+ Agents run through a `ModelGateway`. The gateway owns connections, routing, retries, and cost metering; the agent just names the model it wants.
69
+
70
+ ```python
71
+ from arcana import Agent, Card
72
+ from arcana.models import ConnectionStore, ModelGateway
73
+
74
+ async with ModelGateway(ConnectionStore()) as gw:
75
+ agent = Agent(
76
+ name="researcher",
77
+ card=Card.HERMIT,
78
+ gateway=gw,
79
+ model="ollama/hermes-3",
80
+ )
81
+
82
+ result = await agent.run("Summarise recent advances in RAG.")
83
+ print(result)
84
+
85
+ # Streaming
86
+ async for chunk in agent.stream("What is a vector index?"):
87
+ print(chunk, end="", flush=True)
88
+ ```
89
+
90
+ ---
91
+
92
+ ## How it works
93
+
94
+ Every agent is configured by a **tarot card**. The card encodes an archetype: personality and default temperature. The `CardEngine` blends one primary card with optional modifier cards into an `AgentConfig`, which the `Agent` wires together with the gateway.
95
+
96
+ ```
97
+ Card enum
98
+ → CardRegistry.get() → TarotCard (archetype, traits, prompt ingredients)
99
+ → CardEngine.resolve() → AgentConfig (system_prompt, temperature)
100
+ → Agent.__init__() ← wires gateway + model + AgentConfig together
101
+ → Agent.run() / Agent.stream()
102
+ ```
103
+
104
+ **Blending:** primary card = 70%, modifier cards = 30% split equally. Temperature is linearly blended. `CardEngine.check_compatibility()` reports how well a primary and its modifiers fit together.
105
+
106
+ ```python
107
+ agent = Agent(
108
+ name="creative-researcher",
109
+ card=Card.HERMIT, # 70 % — deep, methodical
110
+ modifier_cards=[Card.FOOL], # 30 % — curious, action-first
111
+ gateway=gw,
112
+ model="ollama/hermes-3",
113
+ )
114
+ ```
115
+
116
+ Each run records a `Session` (messages + token totals). Sessions are stateless in this release — multi-turn continuity within a session is supported; cross-session memory is not yet wired (see the roadmap).
117
+
118
+ ---
119
+
120
+ ## The 22 Major Arcana
121
+
122
+ | # | Card | Archetype | Default temp |
123
+ |---|------|-----------|-------------|
124
+ | 0 | The Fool | Explorer / Autonomous Agent | 0.95 |
125
+ | I | The Magician | Executor / Tool Master | 0.50 |
126
+ | II | The High Priestess | Archivist / Pattern Reader | 0.40 |
127
+ | III | The Empress | Creator / Generative Agent | 0.85 |
128
+ | IV | The Emperor | Orchestrator / System Agent | 0.30 |
129
+ | V | The Hierophant | Advisor / Domain Expert | 0.30 |
130
+ | VI | The Lovers | Collaborator / Communication | 0.70 |
131
+ | VII | The Chariot | Driver / Goal Agent | 0.40 |
132
+ | VIII | Strength | Coach / Long-Game Agent | 0.60 |
133
+ | IX | The Hermit | Researcher / Deep Analyst | 0.35 |
134
+ | X | Wheel of Fortune | Scheduler / Probabilistic | 0.65 |
135
+ | XI | Justice | Auditor / Evaluation Agent | 0.20 |
136
+ | XII | The Hanged Man | Reframer / Perspective | 0.80 |
137
+ | XIII | Death | Transformer / Refactor Agent | 0.40 |
138
+ | XIV | Temperance | Integrator / Synthesis | 0.55 |
139
+ | XV | The Devil | Shadow / Constraint Breaker | 0.75 |
140
+ | XVI | The Tower | Disruptor / Breakthrough | 0.85 |
141
+ | XVII | The Star | Companion / Wellbeing Agent | 0.70 |
142
+ | XVIII | The Moon | Interpreter / Ambiguity | 0.80 |
143
+ | XIX | The Sun | Amplifier / Output Agent | 0.75 |
144
+ | XX | Judgement | Reviewer / Reflection | 0.45 |
145
+ | XXI | The World | Meta-Agent *(reserved)* | 0.50 |
146
+
147
+ The World (XXI) is defined but reserved — it cannot be assigned to an agent yet.
148
+
149
+ ---
150
+
151
+ ## Module map
152
+
153
+ | Module | What's implemented |
154
+ |--------|--------------------|
155
+ | `arcana/types/` | All Pydantic models — always import from `arcana.types`. Covers cards, agents, sessions, and models. |
156
+ | `arcana/cards/definitions/` | One file per card, each exporting a `TarotCard` instance (all 22 present). |
157
+ | `arcana/cards/registry.py` | `CardRegistry` — `get(Card)`, `all()`. |
158
+ | `arcana/cards/engine.py` | `CardEngine` — blending, `resolve()` → `AgentConfig`, `check_compatibility()`. |
159
+ | `arcana/agents/agent.py` | `Agent` — `run()` / `stream()`, session recording. |
160
+ | `arcana/agents/registry.py` | `AgentRegistry` — CRUD for agent records persisted to `~/.arcana/agents/{id}/agent.json`; `build_runtime()`. |
161
+ | `arcana/agents/session_manager.py` | `SessionManager` — session lifecycle, persisted to disk. |
162
+ | `arcana/models/` | `ModelGateway` (routing, adapter pooling, retry/backoff, error normalization, cost metering), adapters for Ollama / Anthropic / OpenAI-compatible, `ConnectionStore` (keyring-backed secrets), pricing, and a normalized `ModelError` hierarchy. |
163
+
164
+ ### Types convention
165
+
166
+ All Pydantic models are re-exported from `arcana.types`. Always import from there:
167
+
168
+ ```python
169
+ from arcana.types import Card, AgentConfig # correct
170
+ from arcana.types.card import Card # avoid
171
+ ```
172
+
173
+ ---
174
+
175
+ ## Adding a new card
176
+
177
+ 1. Create `arcana/cards/definitions/<name>.py` following `fool.py` — export a single `TarotCard` instance.
178
+ 2. Import it in `arcana/cards/definitions/__init__.py` and add it to `all_cards()` in canonical order.
179
+ 3. Add the `Card` enum value to `arcana/types/card.py` if not already present.
180
+
181
+ ---
182
+
183
+ ## Development
184
+
185
+ ```bash
186
+ # Lint
187
+ uv run ruff check .
188
+
189
+ # Type check
190
+ uv run pyright packages/arcana-core/arcana
191
+
192
+ # Tests (no LLM calls)
193
+ uv run pytest packages/arcana-core/tests/ -v -m "not llm_eval"
194
+ ```
195
+
196
+ ---
197
+
198
+ ## Roadmap
199
+
200
+ This release ships the **Phase 1a MVP**: card-configured, stateless agents on the model gateway. The memory type system (`MemoryEntry`, `MemoryProfile`, `MemoryWeights`) is already modelled and the `Agent` has memory slots ready — federated memory backends, a tool/MCP gateway, and The World meta-agent land in Phase 1b as additive wiring, not a rewrite.
@@ -0,0 +1,159 @@
1
+ <p align="center">
2
+ <picture>
3
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/priscilapower/arcana-os/main/docs/assets/arcana-logo-cyan-dark.svg">
4
+ <img alt="arcana-core" src="https://raw.githubusercontent.com/priscilapower/arcana-os/main/docs/assets/arcana-logo-cyan-light.svg" width="300">
5
+ </picture>
6
+ </p>
7
+
8
+ <p align="center">
9
+ <a href="https://github.com/priscilapower/arcana-os/blob/main/LICENSE"><img alt="License: Apache 2.0" src="https://img.shields.io/badge/license-Apache_2.0-0FB5C9?style=flat-square"></a>
10
+ <img alt="Python 3.11+" src="https://img.shields.io/badge/python-3.11%2B-0FB5C9?style=flat-square">
11
+ </p>
12
+
13
+ # arcana-core
14
+
15
+ The Python library at the heart of Arcana OS. Assign a tarot card to an agent: get a soul.
16
+
17
+ ```bash
18
+ pip install arcana-core
19
+ # or inside the monorepo:
20
+ uv sync --all-packages --all-extras
21
+ ```
22
+
23
+ ---
24
+
25
+ ## Quick start
26
+
27
+ Agents run through a `ModelGateway`. The gateway owns connections, routing, retries, and cost metering; the agent just names the model it wants.
28
+
29
+ ```python
30
+ from arcana import Agent, Card
31
+ from arcana.models import ConnectionStore, ModelGateway
32
+
33
+ async with ModelGateway(ConnectionStore()) as gw:
34
+ agent = Agent(
35
+ name="researcher",
36
+ card=Card.HERMIT,
37
+ gateway=gw,
38
+ model="ollama/hermes-3",
39
+ )
40
+
41
+ result = await agent.run("Summarise recent advances in RAG.")
42
+ print(result)
43
+
44
+ # Streaming
45
+ async for chunk in agent.stream("What is a vector index?"):
46
+ print(chunk, end="", flush=True)
47
+ ```
48
+
49
+ ---
50
+
51
+ ## How it works
52
+
53
+ Every agent is configured by a **tarot card**. The card encodes an archetype: personality and default temperature. The `CardEngine` blends one primary card with optional modifier cards into an `AgentConfig`, which the `Agent` wires together with the gateway.
54
+
55
+ ```
56
+ Card enum
57
+ → CardRegistry.get() → TarotCard (archetype, traits, prompt ingredients)
58
+ → CardEngine.resolve() → AgentConfig (system_prompt, temperature)
59
+ → Agent.__init__() ← wires gateway + model + AgentConfig together
60
+ → Agent.run() / Agent.stream()
61
+ ```
62
+
63
+ **Blending:** primary card = 70%, modifier cards = 30% split equally. Temperature is linearly blended. `CardEngine.check_compatibility()` reports how well a primary and its modifiers fit together.
64
+
65
+ ```python
66
+ agent = Agent(
67
+ name="creative-researcher",
68
+ card=Card.HERMIT, # 70 % — deep, methodical
69
+ modifier_cards=[Card.FOOL], # 30 % — curious, action-first
70
+ gateway=gw,
71
+ model="ollama/hermes-3",
72
+ )
73
+ ```
74
+
75
+ Each run records a `Session` (messages + token totals). Sessions are stateless in this release — multi-turn continuity within a session is supported; cross-session memory is not yet wired (see the roadmap).
76
+
77
+ ---
78
+
79
+ ## The 22 Major Arcana
80
+
81
+ | # | Card | Archetype | Default temp |
82
+ |---|------|-----------|-------------|
83
+ | 0 | The Fool | Explorer / Autonomous Agent | 0.95 |
84
+ | I | The Magician | Executor / Tool Master | 0.50 |
85
+ | II | The High Priestess | Archivist / Pattern Reader | 0.40 |
86
+ | III | The Empress | Creator / Generative Agent | 0.85 |
87
+ | IV | The Emperor | Orchestrator / System Agent | 0.30 |
88
+ | V | The Hierophant | Advisor / Domain Expert | 0.30 |
89
+ | VI | The Lovers | Collaborator / Communication | 0.70 |
90
+ | VII | The Chariot | Driver / Goal Agent | 0.40 |
91
+ | VIII | Strength | Coach / Long-Game Agent | 0.60 |
92
+ | IX | The Hermit | Researcher / Deep Analyst | 0.35 |
93
+ | X | Wheel of Fortune | Scheduler / Probabilistic | 0.65 |
94
+ | XI | Justice | Auditor / Evaluation Agent | 0.20 |
95
+ | XII | The Hanged Man | Reframer / Perspective | 0.80 |
96
+ | XIII | Death | Transformer / Refactor Agent | 0.40 |
97
+ | XIV | Temperance | Integrator / Synthesis | 0.55 |
98
+ | XV | The Devil | Shadow / Constraint Breaker | 0.75 |
99
+ | XVI | The Tower | Disruptor / Breakthrough | 0.85 |
100
+ | XVII | The Star | Companion / Wellbeing Agent | 0.70 |
101
+ | XVIII | The Moon | Interpreter / Ambiguity | 0.80 |
102
+ | XIX | The Sun | Amplifier / Output Agent | 0.75 |
103
+ | XX | Judgement | Reviewer / Reflection | 0.45 |
104
+ | XXI | The World | Meta-Agent *(reserved)* | 0.50 |
105
+
106
+ The World (XXI) is defined but reserved — it cannot be assigned to an agent yet.
107
+
108
+ ---
109
+
110
+ ## Module map
111
+
112
+ | Module | What's implemented |
113
+ |--------|--------------------|
114
+ | `arcana/types/` | All Pydantic models — always import from `arcana.types`. Covers cards, agents, sessions, and models. |
115
+ | `arcana/cards/definitions/` | One file per card, each exporting a `TarotCard` instance (all 22 present). |
116
+ | `arcana/cards/registry.py` | `CardRegistry` — `get(Card)`, `all()`. |
117
+ | `arcana/cards/engine.py` | `CardEngine` — blending, `resolve()` → `AgentConfig`, `check_compatibility()`. |
118
+ | `arcana/agents/agent.py` | `Agent` — `run()` / `stream()`, session recording. |
119
+ | `arcana/agents/registry.py` | `AgentRegistry` — CRUD for agent records persisted to `~/.arcana/agents/{id}/agent.json`; `build_runtime()`. |
120
+ | `arcana/agents/session_manager.py` | `SessionManager` — session lifecycle, persisted to disk. |
121
+ | `arcana/models/` | `ModelGateway` (routing, adapter pooling, retry/backoff, error normalization, cost metering), adapters for Ollama / Anthropic / OpenAI-compatible, `ConnectionStore` (keyring-backed secrets), pricing, and a normalized `ModelError` hierarchy. |
122
+
123
+ ### Types convention
124
+
125
+ All Pydantic models are re-exported from `arcana.types`. Always import from there:
126
+
127
+ ```python
128
+ from arcana.types import Card, AgentConfig # correct
129
+ from arcana.types.card import Card # avoid
130
+ ```
131
+
132
+ ---
133
+
134
+ ## Adding a new card
135
+
136
+ 1. Create `arcana/cards/definitions/<name>.py` following `fool.py` — export a single `TarotCard` instance.
137
+ 2. Import it in `arcana/cards/definitions/__init__.py` and add it to `all_cards()` in canonical order.
138
+ 3. Add the `Card` enum value to `arcana/types/card.py` if not already present.
139
+
140
+ ---
141
+
142
+ ## Development
143
+
144
+ ```bash
145
+ # Lint
146
+ uv run ruff check .
147
+
148
+ # Type check
149
+ uv run pyright packages/arcana-core/arcana
150
+
151
+ # Tests (no LLM calls)
152
+ uv run pytest packages/arcana-core/tests/ -v -m "not llm_eval"
153
+ ```
154
+
155
+ ---
156
+
157
+ ## Roadmap
158
+
159
+ This release ships the **Phase 1a MVP**: card-configured, stateless agents on the model gateway. The memory type system (`MemoryEntry`, `MemoryProfile`, `MemoryWeights`) is already modelled and the `Agent` has memory slots ready — federated memory backends, a tool/MCP gateway, and The World meta-agent land in Phase 1b as additive wiring, not a rewrite.
@@ -0,0 +1,25 @@
1
+ """
2
+ Arcana OS — The OS that gives your agents a soul.
3
+
4
+ Quick start:
5
+ from arcana import Agent, Card
6
+ from arcana.models import ConnectionStore, ModelGateway
7
+
8
+ async with ModelGateway(ConnectionStore()) as gw:
9
+ agent = Agent(
10
+ name="researcher",
11
+ card=Card.HERMIT,
12
+ gateway=gw,
13
+ model="ollama/hermes-3",
14
+ )
15
+ result = await agent.run("Summarise recent advances in RAG")
16
+ """
17
+
18
+ from arcana.agents.agent import Agent
19
+ from arcana.agents.registry import AgentRegistry
20
+ from arcana.agents.session_manager import SessionManager
21
+ from arcana.cards.registry import CardRegistry
22
+ from arcana.types.card import Card
23
+
24
+ __all__ = ["Agent", "AgentRegistry", "Card", "CardRegistry", "SessionManager"]
25
+ __version__ = "0.1.0"
@@ -0,0 +1,5 @@
1
+ from arcana.agents.agent import Agent
2
+ from arcana.agents.registry import AgentRegistry
3
+ from arcana.agents.session_manager import SessionManager
4
+
5
+ __all__ = ["Agent", "AgentRegistry", "SessionManager"]