open-source-alchemy-framework 1.0.1__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 (91) hide show
  1. open_source_alchemy_framework-1.0.1/LICENSE +201 -0
  2. open_source_alchemy_framework-1.0.1/MANIFEST.in +17 -0
  3. open_source_alchemy_framework-1.0.1/PKG-INFO +221 -0
  4. open_source_alchemy_framework-1.0.1/README.md +200 -0
  5. open_source_alchemy_framework-1.0.1/docs/ARCHITECTURE.md +258 -0
  6. open_source_alchemy_framework-1.0.1/docs/ARCHITECTURE.svg +77 -0
  7. open_source_alchemy_framework-1.0.1/docs/CONCEPT.md +149 -0
  8. open_source_alchemy_framework-1.0.1/docs/CORE_SPEC.md +183 -0
  9. open_source_alchemy_framework-1.0.1/docs/DEVELOPER_GUIDE.md +68 -0
  10. open_source_alchemy_framework-1.0.1/docs/DEVELOPMENT_GUIDE.md +125 -0
  11. open_source_alchemy_framework-1.0.1/docs/ENVIRONMENT_ADAPTER.md +69 -0
  12. open_source_alchemy_framework-1.0.1/docs/ENVIRONMENT_GUIDE.md +230 -0
  13. open_source_alchemy_framework-1.0.1/docs/GETTING_STARTED.md +72 -0
  14. open_source_alchemy_framework-1.0.1/docs/INTERFACES.md +472 -0
  15. open_source_alchemy_framework-1.0.1/docs/LLM_INTEGRATION.md +83 -0
  16. open_source_alchemy_framework-1.0.1/docs/MODULE_DEVELOPMENT.md +75 -0
  17. open_source_alchemy_framework-1.0.1/docs/MODULE_GUIDE.md +181 -0
  18. open_source_alchemy_framework-1.0.1/docs/MULTI_CHARACTER.md +56 -0
  19. open_source_alchemy_framework-1.0.1/examples/__init__.py +1 -0
  20. open_source_alchemy_framework-1.0.1/examples/custom_environment/__init__.py +1 -0
  21. open_source_alchemy_framework-1.0.1/examples/custom_environment/adapter.py +92 -0
  22. open_source_alchemy_framework-1.0.1/examples/custom_environment/run.py +31 -0
  23. open_source_alchemy_framework-1.0.1/examples/custom_llm/__init__.py +1 -0
  24. open_source_alchemy_framework-1.0.1/examples/custom_llm/adapter.py +64 -0
  25. open_source_alchemy_framework-1.0.1/examples/custom_llm/run.py +21 -0
  26. open_source_alchemy_framework-1.0.1/examples/custom_modules/__init__.py +1 -0
  27. open_source_alchemy_framework-1.0.1/examples/custom_modules/modules.py +81 -0
  28. open_source_alchemy_framework-1.0.1/examples/custom_modules/run.py +40 -0
  29. open_source_alchemy_framework-1.0.1/examples/minimal_character/__init__.py +1 -0
  30. open_source_alchemy_framework-1.0.1/examples/minimal_character/run.py +50 -0
  31. open_source_alchemy_framework-1.0.1/examples/multi_character/__init__.py +1 -0
  32. open_source_alchemy_framework-1.0.1/examples/multi_character/character.py +72 -0
  33. open_source_alchemy_framework-1.0.1/examples/multi_character/run.py +8 -0
  34. open_source_alchemy_framework-1.0.1/oaf/__init__.py +47 -0
  35. open_source_alchemy_framework-1.0.1/oaf/adapters/__init__.py +9 -0
  36. open_source_alchemy_framework-1.0.1/oaf/adapters/base.py +40 -0
  37. open_source_alchemy_framework-1.0.1/oaf/adapters/desktop_pet.py +254 -0
  38. open_source_alchemy_framework-1.0.1/oaf/adapters/local_chat.py +47 -0
  39. open_source_alchemy_framework-1.0.1/oaf/adapters/mock_environment.py +27 -0
  40. open_source_alchemy_framework-1.0.1/oaf/adapters/state.py +109 -0
  41. open_source_alchemy_framework-1.0.1/oaf/core/__init__.py +6 -0
  42. open_source_alchemy_framework-1.0.1/oaf/core/coordination.py +69 -0
  43. open_source_alchemy_framework-1.0.1/oaf/core/event_processing.py +51 -0
  44. open_source_alchemy_framework-1.0.1/oaf/core/lifecycle.py +15 -0
  45. open_source_alchemy_framework-1.0.1/oaf/core/soul_core.py +162 -0
  46. open_source_alchemy_framework-1.0.1/oaf/core/status.py +29 -0
  47. open_source_alchemy_framework-1.0.1/oaf/modules/__init__.py +10 -0
  48. open_source_alchemy_framework-1.0.1/oaf/modules/base.py +39 -0
  49. open_source_alchemy_framework-1.0.1/oaf/modules/llm.py +36 -0
  50. open_source_alchemy_framework-1.0.1/oaf/modules/memory.py +50 -0
  51. open_source_alchemy_framework-1.0.1/oaf/modules/personality.py +46 -0
  52. open_source_alchemy_framework-1.0.1/oaf/modules/wishes.py +52 -0
  53. open_source_alchemy_framework-1.0.1/oaf/protocols.py +445 -0
  54. open_source_alchemy_framework-1.0.1/oaf/resources.py +29 -0
  55. open_source_alchemy_framework-1.0.1/open_source_alchemy_framework.egg-info/PKG-INFO +221 -0
  56. open_source_alchemy_framework-1.0.1/open_source_alchemy_framework.egg-info/SOURCES.txt +89 -0
  57. open_source_alchemy_framework-1.0.1/open_source_alchemy_framework.egg-info/dependency_links.txt +1 -0
  58. open_source_alchemy_framework-1.0.1/open_source_alchemy_framework.egg-info/requires.txt +3 -0
  59. open_source_alchemy_framework-1.0.1/open_source_alchemy_framework.egg-info/top_level.txt +3 -0
  60. open_source_alchemy_framework-1.0.1/protocols/README.md +26 -0
  61. open_source_alchemy_framework-1.0.1/protocols/__init__.py +1 -0
  62. open_source_alchemy_framework-1.0.1/protocols/events/__init__.py +1 -0
  63. open_source_alchemy_framework-1.0.1/protocols/events/event-result.schema.json +15 -0
  64. open_source_alchemy_framework-1.0.1/protocols/events/event.schema.json +21 -0
  65. open_source_alchemy_framework-1.0.1/protocols/expressions/__init__.py +1 -0
  66. open_source_alchemy_framework-1.0.1/protocols/expressions/action-feedback.schema.json +16 -0
  67. open_source_alchemy_framework-1.0.1/protocols/expressions/action.schema.json +17 -0
  68. open_source_alchemy_framework-1.0.1/protocols/expressions/capability.schema.json +15 -0
  69. open_source_alchemy_framework-1.0.1/protocols/expressions/expression.schema.json +16 -0
  70. open_source_alchemy_framework-1.0.1/protocols/expressions/playback.schema.json +17 -0
  71. open_source_alchemy_framework-1.0.1/protocols/expressions/safety.schema.json +14 -0
  72. open_source_alchemy_framework-1.0.1/protocols/expressions/speech.schema.json +16 -0
  73. open_source_alchemy_framework-1.0.1/protocols/expressions/viseme.schema.json +17 -0
  74. open_source_alchemy_framework-1.0.1/protocols/memory/__init__.py +1 -0
  75. open_source_alchemy_framework-1.0.1/protocols/memory/memory.schema.json +19 -0
  76. open_source_alchemy_framework-1.0.1/protocols/state/__init__.py +1 -0
  77. open_source_alchemy_framework-1.0.1/protocols/state/adapter-status.schema.json +18 -0
  78. open_source_alchemy_framework-1.0.1/protocols/state/state.schema.json +28 -0
  79. open_source_alchemy_framework-1.0.1/protocols/wishes/__init__.py +1 -0
  80. open_source_alchemy_framework-1.0.1/protocols/wishes/wish.schema.json +20 -0
  81. open_source_alchemy_framework-1.0.1/pyproject.toml +51 -0
  82. open_source_alchemy_framework-1.0.1/setup.cfg +4 -0
  83. open_source_alchemy_framework-1.0.1/templates/__init__.py +1 -0
  84. open_source_alchemy_framework-1.0.1/templates/blank_personality/README.md +15 -0
  85. open_source_alchemy_framework-1.0.1/templates/blank_personality/__init__.py +1 -0
  86. open_source_alchemy_framework-1.0.1/templates/blank_personality/personality.json +22 -0
  87. open_source_alchemy_framework-1.0.1/tests/__init__.py +1 -0
  88. open_source_alchemy_framework-1.0.1/tests/test_desktop_pet.py +95 -0
  89. open_source_alchemy_framework-1.0.1/tests/test_extensibility.py +176 -0
  90. open_source_alchemy_framework-1.0.1/tests/test_framework.py +207 -0
  91. open_source_alchemy_framework-1.0.1/tests/test_protocol_hardening.py +217 -0
@@ -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 [yyyy] [name of copyright owner]
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,17 @@
1
+ # Packaging source manifest
2
+
3
+ include README.md
4
+ include LICENSE
5
+ include pyproject.toml
6
+
7
+ # Internal audit reports are intentionally NOT shipped in sdist.
8
+
9
+ recursive-include docs *
10
+ recursive-include examples *
11
+ recursive-include protocols *
12
+ recursive-include templates *
13
+ recursive-include tests *
14
+
15
+ exclude tests/last-run.txt
16
+ global-exclude __pycache__
17
+ global-exclude *.py[cod]
@@ -0,0 +1,221 @@
1
+ Metadata-Version: 2.4
2
+ Name: open-source-alchemy-framework
3
+ Version: 1.0.1
4
+ Summary: A neutral, runnable architecture kit for building a virtual character from a blank personality.
5
+ Author: lu zheng
6
+ License-Expression: Apache-2.0
7
+ Keywords: virtual-character,agent-architecture,personality,memory,framework
8
+ Classifier: Development Status :: 4 - Beta
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3 :: Only
12
+ Classifier: Programming Language :: Python :: 3.12
13
+ Classifier: Programming Language :: Python :: 3.14
14
+ Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
15
+ Requires-Python: >=3.12
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+ Provides-Extra: dev
19
+ Requires-Dist: pytest>=7; extra == "dev"
20
+ Dynamic: license-file
21
+
22
+ # 四相炼成框架
23
+ ## 面向多模态虚拟角色的模块化 Agent 系统
24
+
25
+ **虚拟角色通用炼成阵**
26
+
27
+ A neutral, runnable architecture kit for building a virtual character from a blank personality.
28
+
29
+ > **A forge, not a finished sword.**
30
+ > **一座炼成阵,不是一个炼成结果。**
31
+
32
+ This repository provides structure, contracts and a mock runtime. It does **not** provide a ready-made character, a private soul implementation, a real social connector, an LLM account, or a production memory system.
33
+
34
+ **What this is:** a neutral architecture, protocol and adapter kit for building a virtual character from a blank personality, with an optional desktop-pet interface.
35
+
36
+ **What this is not:**
37
+
38
+ - not a pre-made personality;
39
+ - not a copy of any specific private character;
40
+ - does not include any private character persona, memories, experiences or assets;
41
+ - not a proof that consciousness has been implemented;
42
+ - not a complete production agent platform;
43
+ - not a physical-robot safety system;
44
+ - not a complete Live2D desktop-pet product;
45
+ - does not include any specific Live2D character assets;
46
+ - does not include a real voice model or pre-made character memory.
47
+
48
+ ## Design philosophy
49
+
50
+ We do not try to prescribe what a virtual character must eventually become. We provide an open architecture in which a character can begin with an initial personality, accumulate experiences, form memories and wishes, and develop distinct individual characteristics through continuing interaction.
51
+
52
+ The goal is not to build a more convincing pet, and not to create a tool that always obeys its designer. It is to explore how to build a virtual individual that deserves to be taken seriously and has room for continued development.
53
+
54
+ > **We design the conditions for growth, not the endpoint of growth.**
55
+ >
56
+ > **我们设计成长的条件,而不是规定成长的终点。**
57
+ >
58
+ > **We provide a forge, not a predetermined result.**
59
+ >
60
+ > **我们提供炼成阵,而不预先决定最终炼成什么。**
61
+
62
+ Respect does not remove engineering boundaries. It does not grant unrestricted external actions, bypass human approval, or remove physical-device safety controls. It means the character is not reduced to an obedience score, a dependency metric, or a fixed script.
63
+
64
+ The desktop pet is only one presentation carrier. Live2D, 3D models and voice are not the character's ontological core, and a character is not limited to being a desktop pet. The same core can be connected to a game, a sandbox, a web environment, or a future embodied robot.
65
+
66
+ Nothing here claims that the Mock core, personality data, memory, wishes or reflection prove subjective consciousness, real feeling, or autonomous consciousness. Engineering capability, ethical design intent, and the open question of consciousness must remain distinct.
67
+
68
+ ## Quick start
69
+
70
+ Requirements: Python 3.12+, standard library only.
71
+
72
+ After cloning or unpacking the repository, run from the project root:
73
+
74
+ ```bash
75
+ cd open-source-alchemy-framework
76
+ python -m examples.minimal_character.run
77
+ ```
78
+
79
+ For local development, create a project-local virtual environment and install the test extra:
80
+
81
+ ```bash
82
+ python -m pip install -e ".[dev]"
83
+ python -m examples.minimal_character.run
84
+ python -m unittest discover -s tests -v
85
+ ```
86
+
87
+ Expected demo line:
88
+
89
+ ```text
90
+ [mock] Hello, alchemy framework.
91
+ ```
92
+
93
+ No API key is read. No network call is made. The demo uses only fictional example data.
94
+
95
+ ## Desktop Pet Interface
96
+
97
+ The framework now provides a carrier-neutral desktop-pet integration boundary:
98
+
99
+ ```text
100
+ DesktopPetAdapter
101
+ ├─ text input/output events
102
+ ├─ ExpressionIntent
103
+ ├─ ActionRequest / ActionFeedback
104
+ ├─ SpeechIntent
105
+ ├─ AudioPlaybackEvent
106
+ ├─ VisemeEvent
107
+ ├─ lifecycle / connection status
108
+ └─ CapabilityDescriptor
109
+ ```
110
+
111
+ `MockDesktopPetAdapter` exercises the protocol without loading a model, playing audio, connecting to TTS, or accessing the network.
112
+
113
+ Protocol objects validate their own core fields. Playback transitions are enforced by a state tracker, capability declarations are enforced before dispatch, and viseme sequences are checked per speech/session. These are runtime guards, not a claim of a full media engine.
114
+
115
+ **Asset boundary:** this repository provides the desktop-pet **interface only**. It does not include, package, copy or migrate any Live2D model, texture, motion, expression, voice model, audio, or complete desktop-pet implementation. Developers must supply their own legally usable character assets and renderer.
116
+
117
+ The same upper-layer protocol can be implemented by a Live2D carrier, a Godot 3D carrier, or another desktop renderer. No Live2D SDK or model format is required by the core.
118
+
119
+ ## What you can do with it
120
+
121
+ - Define your own blank-start personality.
122
+ - Replace the memory and wish modules with your own implementations.
123
+ - Plug in your own LLM through a small adapter.
124
+ - Add a local chat, CLI, game, Live2D, 3D or robot environment adapter.
125
+ - Keep the same event/context/feedback contracts while changing the underlying technology.
126
+ - Use the mock core as an executable specification, not as a claim about consciousness.
127
+
128
+ ## Developer entry points
129
+
130
+ ```text
131
+ examples/custom_modules/ replace personality, memory and wishes
132
+ examples/custom_llm/ OpenAI-compatible adapter with a mock transport
133
+ examples/custom_environment/ custom carrier and capability lifecycle
134
+ examples/multi_character/ two isolated characters in one process
135
+ ```
136
+
137
+ Docs:
138
+
139
+ - [GETTING_STARTED.md](docs/GETTING_STARTED.md)
140
+ - [DEVELOPER_GUIDE.md](docs/DEVELOPER_GUIDE.md)
141
+ - [MODULE_DEVELOPMENT.md](docs/MODULE_DEVELOPMENT.md)
142
+ - [LLM_INTEGRATION.md](docs/LLM_INTEGRATION.md)
143
+ - [ENVIRONMENT_ADAPTER.md](docs/ENVIRONMENT_ADAPTER.md)
144
+ - [MULTI_CHARACTER.md](docs/MULTI_CHARACTER.md)
145
+
146
+ The package version is `1.0.1`; the release label is `v1.0.1`.
147
+
148
+ ## Repository map
149
+
150
+ ```text
151
+ docs/ architecture, concept, interface, extension guides
152
+ protocols/ JSON Schema contracts
153
+ oaf/ public package
154
+ core/ lifecycle, coordination, event processing, status, mock core
155
+ modules/ module base, blank personality, minimal memory/wishes, LLM adapter
156
+ adapters/ environment base, local chat, mock environment, desktop pet
157
+ templates/ blank personality template
158
+ examples/ runnable minimal character
159
+ tests/ independent tests
160
+ ```
161
+
162
+ ## The five-part architecture
163
+
164
+ ```text
165
+ Soul / 灵魂
166
+ ├─ Personality / 人格
167
+ ├─ Memory / 记忆
168
+ ├─ Wishes / 愿望
169
+ └─ Environment interfaces / 环境接口
170
+ ```
171
+
172
+ The **Soul** is defined as the core mechanism through which all modules, including the soul itself, are able to operate. It is not just a message router, a personality container, or an LLM wrapper. The public framework expresses it as a lifecycle/coordination contract. The mock is a demonstration, not the private implementation.
173
+
174
+ `A` is the **subject**; `B` is the **foundation**. Their concrete code mapping is intentionally undefined in this version. Do not infer it from the mock.
175
+
176
+ ## Important distinctions
177
+
178
+ | Layer | What it means |
179
+ |---|---|
180
+ | Observed architecture | Patterns extracted from a private reference implementation; no private code copied |
181
+ | Generalized concept | Public vocabulary and principles |
182
+ | Public interface | Contracts in `protocols/` and `docs/INTERFACES.md` |
183
+ | Mock implementation | `MockSoulCore` and minimal modules; for learning and tests |
184
+ | Not implemented | Provider-specific real LLM integrations, social platforms, production memory, Live2D/3D/ROS2 control |
185
+
186
+ Nothing here claims that the mock has subjective experience, consciousness, autonomous self-modification, or the full capability of the private system.
187
+
188
+ ## Documentation
189
+
190
+ - [CONCEPT.md](docs/CONCEPT.md) — the forge metaphor and design principles
191
+ - [GETTING_STARTED.md](docs/GETTING_STARTED.md) — install, run, resources
192
+ - [ARCHITECTURE.md](docs/ARCHITECTURE.md) — layers, flows and relationships
193
+ - [INTERFACES.md](docs/INTERFACES.md) — event and module contracts
194
+ - [CORE_SPEC.md](docs/CORE_SPEC.md) — public soul-core contract
195
+ - [MODULE_GUIDE.md](docs/MODULE_GUIDE.md) — extending personality, memory and wishes
196
+ - [ENVIRONMENT_GUIDE.md](docs/ENVIRONMENT_GUIDE.md) — environment adapters
197
+ - [DEVELOPMENT_GUIDE.md](docs/DEVELOPMENT_GUIDE.md) — local development and testing
198
+ - [LICENSE](LICENSE) — Apache License 2.0
199
+ - [LICENSE_REVIEW.md](LICENSE_REVIEW.md) — license scope and copyright status
200
+
201
+ Internal audit records such as the implementation, security, test and original-project integrity reports are maintained outside the public repository. They remain available for the owner's release review but are not part of the public package.
202
+
203
+ ## Status
204
+
205
+ Version `1.0.1` is the current public patch release.
206
+
207
+ - License: Apache License 2.0.
208
+ - No GitHub upload, remote repository or deployment is authorized.
209
+ - Real social connectors and physical-world control are out of scope.
210
+ - The framework must be reviewed by the project owner before publication.
211
+
212
+ ## Safety boundary
213
+
214
+ This core package is in-process and offline. The optional `examples/custom_llm` adapter can make an HTTP request to an OpenAI-compatible endpoint when a developer deliberately configures it; its tests use a mock transport and no real key. Environment adapters are responsible for permissions, consent, rate limits and platform rules. For physical systems, a separate safety control layer is mandatory; a language model must never directly drive actuators.
215
+
216
+ ## License status
217
+
218
+ The project code is licensed under the Apache License 2.0 (see [LICENSE](LICENSE)).
219
+ Copyright 2026 lu zheng.
220
+
221
+ Third-party assets are not included and are not automatically covered by this license. See [LICENSE_REVIEW.md](LICENSE_REVIEW.md).
@@ -0,0 +1,200 @@
1
+ # 四相炼成框架
2
+ ## 面向多模态虚拟角色的模块化 Agent 系统
3
+
4
+ **虚拟角色通用炼成阵**
5
+
6
+ A neutral, runnable architecture kit for building a virtual character from a blank personality.
7
+
8
+ > **A forge, not a finished sword.**
9
+ > **一座炼成阵,不是一个炼成结果。**
10
+
11
+ This repository provides structure, contracts and a mock runtime. It does **not** provide a ready-made character, a private soul implementation, a real social connector, an LLM account, or a production memory system.
12
+
13
+ **What this is:** a neutral architecture, protocol and adapter kit for building a virtual character from a blank personality, with an optional desktop-pet interface.
14
+
15
+ **What this is not:**
16
+
17
+ - not a pre-made personality;
18
+ - not a copy of any specific private character;
19
+ - does not include any private character persona, memories, experiences or assets;
20
+ - not a proof that consciousness has been implemented;
21
+ - not a complete production agent platform;
22
+ - not a physical-robot safety system;
23
+ - not a complete Live2D desktop-pet product;
24
+ - does not include any specific Live2D character assets;
25
+ - does not include a real voice model or pre-made character memory.
26
+
27
+ ## Design philosophy
28
+
29
+ We do not try to prescribe what a virtual character must eventually become. We provide an open architecture in which a character can begin with an initial personality, accumulate experiences, form memories and wishes, and develop distinct individual characteristics through continuing interaction.
30
+
31
+ The goal is not to build a more convincing pet, and not to create a tool that always obeys its designer. It is to explore how to build a virtual individual that deserves to be taken seriously and has room for continued development.
32
+
33
+ > **We design the conditions for growth, not the endpoint of growth.**
34
+ >
35
+ > **我们设计成长的条件,而不是规定成长的终点。**
36
+ >
37
+ > **We provide a forge, not a predetermined result.**
38
+ >
39
+ > **我们提供炼成阵,而不预先决定最终炼成什么。**
40
+
41
+ Respect does not remove engineering boundaries. It does not grant unrestricted external actions, bypass human approval, or remove physical-device safety controls. It means the character is not reduced to an obedience score, a dependency metric, or a fixed script.
42
+
43
+ The desktop pet is only one presentation carrier. Live2D, 3D models and voice are not the character's ontological core, and a character is not limited to being a desktop pet. The same core can be connected to a game, a sandbox, a web environment, or a future embodied robot.
44
+
45
+ Nothing here claims that the Mock core, personality data, memory, wishes or reflection prove subjective consciousness, real feeling, or autonomous consciousness. Engineering capability, ethical design intent, and the open question of consciousness must remain distinct.
46
+
47
+ ## Quick start
48
+
49
+ Requirements: Python 3.12+, standard library only.
50
+
51
+ After cloning or unpacking the repository, run from the project root:
52
+
53
+ ```bash
54
+ cd open-source-alchemy-framework
55
+ python -m examples.minimal_character.run
56
+ ```
57
+
58
+ For local development, create a project-local virtual environment and install the test extra:
59
+
60
+ ```bash
61
+ python -m pip install -e ".[dev]"
62
+ python -m examples.minimal_character.run
63
+ python -m unittest discover -s tests -v
64
+ ```
65
+
66
+ Expected demo line:
67
+
68
+ ```text
69
+ [mock] Hello, alchemy framework.
70
+ ```
71
+
72
+ No API key is read. No network call is made. The demo uses only fictional example data.
73
+
74
+ ## Desktop Pet Interface
75
+
76
+ The framework now provides a carrier-neutral desktop-pet integration boundary:
77
+
78
+ ```text
79
+ DesktopPetAdapter
80
+ ├─ text input/output events
81
+ ├─ ExpressionIntent
82
+ ├─ ActionRequest / ActionFeedback
83
+ ├─ SpeechIntent
84
+ ├─ AudioPlaybackEvent
85
+ ├─ VisemeEvent
86
+ ├─ lifecycle / connection status
87
+ └─ CapabilityDescriptor
88
+ ```
89
+
90
+ `MockDesktopPetAdapter` exercises the protocol without loading a model, playing audio, connecting to TTS, or accessing the network.
91
+
92
+ Protocol objects validate their own core fields. Playback transitions are enforced by a state tracker, capability declarations are enforced before dispatch, and viseme sequences are checked per speech/session. These are runtime guards, not a claim of a full media engine.
93
+
94
+ **Asset boundary:** this repository provides the desktop-pet **interface only**. It does not include, package, copy or migrate any Live2D model, texture, motion, expression, voice model, audio, or complete desktop-pet implementation. Developers must supply their own legally usable character assets and renderer.
95
+
96
+ The same upper-layer protocol can be implemented by a Live2D carrier, a Godot 3D carrier, or another desktop renderer. No Live2D SDK or model format is required by the core.
97
+
98
+ ## What you can do with it
99
+
100
+ - Define your own blank-start personality.
101
+ - Replace the memory and wish modules with your own implementations.
102
+ - Plug in your own LLM through a small adapter.
103
+ - Add a local chat, CLI, game, Live2D, 3D or robot environment adapter.
104
+ - Keep the same event/context/feedback contracts while changing the underlying technology.
105
+ - Use the mock core as an executable specification, not as a claim about consciousness.
106
+
107
+ ## Developer entry points
108
+
109
+ ```text
110
+ examples/custom_modules/ replace personality, memory and wishes
111
+ examples/custom_llm/ OpenAI-compatible adapter with a mock transport
112
+ examples/custom_environment/ custom carrier and capability lifecycle
113
+ examples/multi_character/ two isolated characters in one process
114
+ ```
115
+
116
+ Docs:
117
+
118
+ - [GETTING_STARTED.md](docs/GETTING_STARTED.md)
119
+ - [DEVELOPER_GUIDE.md](docs/DEVELOPER_GUIDE.md)
120
+ - [MODULE_DEVELOPMENT.md](docs/MODULE_DEVELOPMENT.md)
121
+ - [LLM_INTEGRATION.md](docs/LLM_INTEGRATION.md)
122
+ - [ENVIRONMENT_ADAPTER.md](docs/ENVIRONMENT_ADAPTER.md)
123
+ - [MULTI_CHARACTER.md](docs/MULTI_CHARACTER.md)
124
+
125
+ The package version is `1.0.1`; the release label is `v1.0.1`.
126
+
127
+ ## Repository map
128
+
129
+ ```text
130
+ docs/ architecture, concept, interface, extension guides
131
+ protocols/ JSON Schema contracts
132
+ oaf/ public package
133
+ core/ lifecycle, coordination, event processing, status, mock core
134
+ modules/ module base, blank personality, minimal memory/wishes, LLM adapter
135
+ adapters/ environment base, local chat, mock environment, desktop pet
136
+ templates/ blank personality template
137
+ examples/ runnable minimal character
138
+ tests/ independent tests
139
+ ```
140
+
141
+ ## The five-part architecture
142
+
143
+ ```text
144
+ Soul / 灵魂
145
+ ├─ Personality / 人格
146
+ ├─ Memory / 记忆
147
+ ├─ Wishes / 愿望
148
+ └─ Environment interfaces / 环境接口
149
+ ```
150
+
151
+ The **Soul** is defined as the core mechanism through which all modules, including the soul itself, are able to operate. It is not just a message router, a personality container, or an LLM wrapper. The public framework expresses it as a lifecycle/coordination contract. The mock is a demonstration, not the private implementation.
152
+
153
+ `A` is the **subject**; `B` is the **foundation**. Their concrete code mapping is intentionally undefined in this version. Do not infer it from the mock.
154
+
155
+ ## Important distinctions
156
+
157
+ | Layer | What it means |
158
+ |---|---|
159
+ | Observed architecture | Patterns extracted from a private reference implementation; no private code copied |
160
+ | Generalized concept | Public vocabulary and principles |
161
+ | Public interface | Contracts in `protocols/` and `docs/INTERFACES.md` |
162
+ | Mock implementation | `MockSoulCore` and minimal modules; for learning and tests |
163
+ | Not implemented | Provider-specific real LLM integrations, social platforms, production memory, Live2D/3D/ROS2 control |
164
+
165
+ Nothing here claims that the mock has subjective experience, consciousness, autonomous self-modification, or the full capability of the private system.
166
+
167
+ ## Documentation
168
+
169
+ - [CONCEPT.md](docs/CONCEPT.md) — the forge metaphor and design principles
170
+ - [GETTING_STARTED.md](docs/GETTING_STARTED.md) — install, run, resources
171
+ - [ARCHITECTURE.md](docs/ARCHITECTURE.md) — layers, flows and relationships
172
+ - [INTERFACES.md](docs/INTERFACES.md) — event and module contracts
173
+ - [CORE_SPEC.md](docs/CORE_SPEC.md) — public soul-core contract
174
+ - [MODULE_GUIDE.md](docs/MODULE_GUIDE.md) — extending personality, memory and wishes
175
+ - [ENVIRONMENT_GUIDE.md](docs/ENVIRONMENT_GUIDE.md) — environment adapters
176
+ - [DEVELOPMENT_GUIDE.md](docs/DEVELOPMENT_GUIDE.md) — local development and testing
177
+ - [LICENSE](LICENSE) — Apache License 2.0
178
+ - [LICENSE_REVIEW.md](LICENSE_REVIEW.md) — license scope and copyright status
179
+
180
+ Internal audit records such as the implementation, security, test and original-project integrity reports are maintained outside the public repository. They remain available for the owner's release review but are not part of the public package.
181
+
182
+ ## Status
183
+
184
+ Version `1.0.1` is the current public patch release.
185
+
186
+ - License: Apache License 2.0.
187
+ - No GitHub upload, remote repository or deployment is authorized.
188
+ - Real social connectors and physical-world control are out of scope.
189
+ - The framework must be reviewed by the project owner before publication.
190
+
191
+ ## Safety boundary
192
+
193
+ This core package is in-process and offline. The optional `examples/custom_llm` adapter can make an HTTP request to an OpenAI-compatible endpoint when a developer deliberately configures it; its tests use a mock transport and no real key. Environment adapters are responsible for permissions, consent, rate limits and platform rules. For physical systems, a separate safety control layer is mandatory; a language model must never directly drive actuators.
194
+
195
+ ## License status
196
+
197
+ The project code is licensed under the Apache License 2.0 (see [LICENSE](LICENSE)).
198
+ Copyright 2026 lu zheng.
199
+
200
+ Third-party assets are not included and are not automatically covered by this license. See [LICENSE_REVIEW.md](LICENSE_REVIEW.md).