creatureos 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 (88) hide show
  1. creatureos-0.1.0/LICENSE +201 -0
  2. creatureos-0.1.0/MANIFEST.in +5 -0
  3. creatureos-0.1.0/PKG-INFO +248 -0
  4. creatureos-0.1.0/README.md +217 -0
  5. creatureos-0.1.0/creatureos/__init__.py +3 -0
  6. creatureos-0.1.0/creatureos/__main__.py +7 -0
  7. creatureos-0.1.0/creatureos/cli.py +604 -0
  8. creatureos-0.1.0/creatureos/codex_cli.py +199 -0
  9. creatureos-0.1.0/creatureos/config.py +236 -0
  10. creatureos-0.1.0/creatureos/service.py +12586 -0
  11. creatureos-0.1.0/creatureos/static/alien-picker-icon.svg +1 -0
  12. creatureos-0.1.0/creatureos/static/alien-scene.svg +58 -0
  13. creatureos-0.1.0/creatureos/static/apple-touch-icon.png +0 -0
  14. creatureos-0.1.0/creatureos/static/console.css +5349 -0
  15. creatureos-0.1.0/creatureos/static/creature_os.css +9636 -0
  16. creatureos-0.1.0/creatureos/static/creature_os.js +3074 -0
  17. creatureos-0.1.0/creatureos/static/creatureos-favicon.png +0 -0
  18. creatureos-0.1.0/creatureos/static/creatureos-icon-192.png +0 -0
  19. creatureos-0.1.0/creatureos/static/creatureos-icon-512.png +0 -0
  20. creatureos-0.1.0/creatureos/static/creatureos-mark.png +0 -0
  21. creatureos-0.1.0/creatureos/static/expanse-bridge-scene.svg +361 -0
  22. creatureos-0.1.0/creatureos/static/expanse-hubble-xdf.jpg +0 -0
  23. creatureos-0.1.0/creatureos/static/favicon-16x16.png +0 -0
  24. creatureos-0.1.0/creatureos/static/favicon-32x32.png +0 -0
  25. creatureos-0.1.0/creatureos/static/favicon.ico +0 -0
  26. creatureos-0.1.0/creatureos/static/monsters-picker-icon.svg +1 -0
  27. creatureos-0.1.0/creatureos/static/monsters-scene.svg +172 -0
  28. creatureos-0.1.0/creatureos/static/ocean-picker-icon.svg +1 -0
  29. creatureos-0.1.0/creatureos/static/ocean-scene.svg +99 -0
  30. creatureos-0.1.0/creatureos/static/ocean-source-algae.svg +1 -0
  31. creatureos-0.1.0/creatureos/static/ocean-source-clam-shell.svg +3 -0
  32. creatureos-0.1.0/creatureos/static/ocean-source-coral.svg +1 -0
  33. creatureos-0.1.0/creatureos/static/ocean-source-crab.svg +1 -0
  34. creatureos-0.1.0/creatureos/static/ocean-source-fish-muted-flip.png +0 -0
  35. creatureos-0.1.0/creatureos/static/ocean-source-fish-muted.png +0 -0
  36. creatureos-0.1.0/creatureos/static/ocean-source-hammerhead-muted.png +0 -0
  37. creatureos-0.1.0/creatureos/static/ocean-source-octopus-muted.png +0 -0
  38. creatureos-0.1.0/creatureos/static/ocean-source-oyster-shell.svg +11 -0
  39. creatureos-0.1.0/creatureos/static/ocean-source-seahorse.svg +77 -0
  40. creatureos-0.1.0/creatureos/static/ocean-source-seaweed-tall.svg +66 -0
  41. creatureos-0.1.0/creatureos/static/ocean-source-seaweed.svg +40 -0
  42. creatureos-0.1.0/creatureos/static/ocean-source-shark-muted.png +0 -0
  43. creatureos-0.1.0/creatureos/static/ocean-source-starfish.svg +1 -0
  44. creatureos-0.1.0/creatureos/static/ocean-source-whale.svg +61 -0
  45. creatureos-0.1.0/creatureos/static/shell.js +405 -0
  46. creatureos-0.1.0/creatureos/static/site.webmanifest +19 -0
  47. creatureos-0.1.0/creatureos/static/spooky-bone.svg +7 -0
  48. creatureos-0.1.0/creatureos/static/spooky-flying-ghost.svg +9 -0
  49. creatureos-0.1.0/creatureos/static/spooky-gate.svg +1487 -0
  50. creatureos-0.1.0/creatureos/static/spooky-hasty-grave.svg +1 -0
  51. creatureos-0.1.0/creatureos/static/spooky-midnight-graveyard.svg +2681 -0
  52. creatureos-0.1.0/creatureos/static/spooky-picker-icon.svg +1 -0
  53. creatureos-0.1.0/creatureos/static/spooky-scene.svg +88 -0
  54. creatureos-0.1.0/creatureos/static/spooky-tombstone.svg +1 -0
  55. creatureos-0.1.0/creatureos/static/spooky-zombie-hand.svg +1 -0
  56. creatureos-0.1.0/creatureos/static/tech-picker-icon.svg +3 -0
  57. creatureos-0.1.0/creatureos/static/tech-scene.svg +90 -0
  58. creatureos-0.1.0/creatureos/static/tech-web-delivery-drone.svg +1 -0
  59. creatureos-0.1.0/creatureos/static/tech-web-tracked-robot.svg +1 -0
  60. creatureos-0.1.0/creatureos/static/tech-web-walking-scout.svg +1 -0
  61. creatureos-0.1.0/creatureos/static/woodlands-beaver-soft.svg +100 -0
  62. creatureos-0.1.0/creatureos/static/woodlands-birds.svg +7 -0
  63. creatureos-0.1.0/creatureos/static/woodlands-branches-dark.svg +356 -0
  64. creatureos-0.1.0/creatureos/static/woodlands-conifer-deep.svg +157 -0
  65. creatureos-0.1.0/creatureos/static/woodlands-conifer-soft.svg +157 -0
  66. creatureos-0.1.0/creatureos/static/woodlands-deer-soft.svg +119 -0
  67. creatureos-0.1.0/creatureos/static/woodlands-eagle-soft.svg +105 -0
  68. creatureos-0.1.0/creatureos/static/woodlands-fox-soft.svg +61 -0
  69. creatureos-0.1.0/creatureos/static/woodlands-owl-soft.svg +99 -0
  70. creatureos-0.1.0/creatureos/static/woodlands-rabbit-soft.svg +117 -0
  71. creatureos-0.1.0/creatureos/static/woodlands-scene.svg +60 -0
  72. creatureos-0.1.0/creatureos/static/woodlands-trees-mid-clipped-strong.png +0 -0
  73. creatureos-0.1.0/creatureos/storage.py +2465 -0
  74. creatureos-0.1.0/creatureos/templates/index.html +1443 -0
  75. creatureos-0.1.0/creatureos/templates/layouts/console_base.html +88 -0
  76. creatureos-0.1.0/creatureos/web.py +931 -0
  77. creatureos-0.1.0/creatureos.egg-info/PKG-INFO +248 -0
  78. creatureos-0.1.0/creatureos.egg-info/SOURCES.txt +86 -0
  79. creatureos-0.1.0/creatureos.egg-info/dependency_links.txt +1 -0
  80. creatureos-0.1.0/creatureos.egg-info/entry_points.txt +2 -0
  81. creatureos-0.1.0/creatureos.egg-info/requires.txt +8 -0
  82. creatureos-0.1.0/creatureos.egg-info/top_level.txt +1 -0
  83. creatureos-0.1.0/pyproject.toml +57 -0
  84. creatureos-0.1.0/setup.cfg +4 -0
  85. creatureos-0.1.0/tests/test_browser_smoke.py +104 -0
  86. creatureos-0.1.0/tests/test_service.py +247 -0
  87. creatureos-0.1.0/tests/test_storage.py +175 -0
  88. creatureos-0.1.0/tests/test_web.py +118 -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,5 @@
1
+ include LICENSE
2
+ include README.md
3
+ recursive-include creatureos/templates *
4
+ recursive-include creatureos/static *
5
+ global-exclude __pycache__ *.py[cod]
@@ -0,0 +1,248 @@
1
+ Metadata-Version: 2.4
2
+ Name: creatureos
3
+ Version: 0.1.0
4
+ Summary: Local-first CreatureOS runtime for persistent Codex creatures
5
+ License-Expression: Apache-2.0
6
+ Project-URL: Homepage, https://github.com/CreatureOS/creatureos
7
+ Project-URL: Repository, https://github.com/CreatureOS/creatureos
8
+ Project-URL: Issues, https://github.com/CreatureOS/creatureos/issues
9
+ Keywords: codex,creatures,fastapi,local-first,sqlite
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Environment :: Console
12
+ Classifier: Framework :: FastAPI
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Operating System :: MacOS
15
+ Classifier: Operating System :: Microsoft :: Windows
16
+ Classifier: Operating System :: POSIX :: Linux
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Software Development :: User Interfaces
20
+ Requires-Python: >=3.12
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Requires-Dist: fastapi
24
+ Requires-Dist: jinja2
25
+ Requires-Dist: python-multipart
26
+ Requires-Dist: uvicorn
27
+ Provides-Extra: test
28
+ Requires-Dist: httpx; extra == "test"
29
+ Requires-Dist: pytest; extra == "test"
30
+ Dynamic: license-file
31
+
32
+ # CreatureOS
33
+
34
+ CreatureOS is a local-first runtime for persistent Codex creatures.
35
+
36
+ It gives you a small ambient habitat of specialized creatures that can:
37
+ - watch a workspace over time
38
+ - keep durable notes, memory, and activity reports
39
+ - chat in a web UI
40
+ - practice habits on a schedule and surface useful things without needing a fresh prompt every time
41
+ - work with local documents, attachments, and browser flows as part of their normal job
42
+ - keep private workshop scripts, files, templates, and reports that make repeated work easier
43
+
44
+ CreatureOS is intentionally opinionated:
45
+ - chats get fresh Codex threads
46
+ - habit runs stay on a persistent creature thread
47
+ - state lives locally in SQLite
48
+ - creatures use purpose and habits as their authority rather than a matrix of manual capability grants
49
+ - The Keeper helps summon and shape the rest of the habitat
50
+
51
+ ## Prerequisites
52
+
53
+ CreatureOS itself is a Python app, but it wraps the Codex CLI.
54
+
55
+ You should have:
56
+ - Python `3.12+`
57
+ - the `codex` CLI available on your `PATH`
58
+ - Codex authenticated locally
59
+
60
+ SQLite uses Python's built-in `sqlite3` module. There is no separate database server to install.
61
+
62
+ Optional:
63
+ - Tailscale, if you want private cross-device access with `--tailscale`
64
+
65
+ ## Install
66
+
67
+ Install from a checkout:
68
+
69
+ ```bash
70
+ python3 -m pip install -e .
71
+ ```
72
+
73
+ Once published to PyPI, the install command will be:
74
+
75
+ ```bash
76
+ pip install creatureos
77
+ ```
78
+
79
+ ## Start
80
+
81
+ Initialize the database once:
82
+
83
+ ```bash
84
+ creatureos init-db
85
+ ```
86
+
87
+ Start CreatureOS in safe local-only mode:
88
+
89
+ ```bash
90
+ creatureos serve --workspace /path/to/workspace
91
+ ```
92
+
93
+ That binds to:
94
+ - `127.0.0.1:404` by default
95
+
96
+ Serve on localhost plus the detected Tailscale IPv4:
97
+
98
+ ```bash
99
+ creatureos serve --workspace /path/to/workspace --tailscale
100
+ ```
101
+
102
+ That binds to:
103
+ - `127.0.0.1:404`
104
+ - the detected Tailscale IPv4 on the same port
105
+
106
+ If no Tailscale IPv4 is detected, it falls back to localhost-only.
107
+
108
+ Force a fresh onboarding environment scan on boot:
109
+
110
+ ```bash
111
+ creatureos serve --workspace /path/to/workspace --force-scan
112
+ ```
113
+
114
+ ## Working Root And Data
115
+
116
+ If you do not pass `--workspace`, CreatureOS uses your current working directory as the primary working root for creature file work.
117
+
118
+ The onboarding scan is broader than that. It looks across likely work directories on the machine so The Keeper can form a first impression of the kind of work you do.
119
+
120
+ For repeatable launches, prefer setting the workspace explicitly with:
121
+ - `creatureos --workspace /path/to/workspace serve`
122
+
123
+ or with:
124
+ - `CREATURE_OS_WORKSPACE_ROOT`
125
+
126
+ Runtime state lives under:
127
+
128
+ ```text
129
+ ~/.local/state/creatureos
130
+ ```
131
+
132
+ on Linux by default.
133
+
134
+ On macOS the default is:
135
+
136
+ ```text
137
+ ~/Library/Application Support/CreatureOS
138
+ ```
139
+
140
+ On Windows the default is:
141
+
142
+ ```text
143
+ %LOCALAPPDATA%\CreatureOS
144
+ ```
145
+
146
+ Override that explicitly with:
147
+ - `creatureos --data-dir /path/to/data serve`
148
+ - `CREATURE_OS_DATA_DIR`
149
+ - `CREATURE_OS_DB_PATH`
150
+
151
+ ## Environment
152
+
153
+ - `CREATURE_OS_WORKSPACE_ROOT`: primary working root for creature file work
154
+ - `CREATURE_OS_DATA_DIR`: runtime data directory
155
+ - `CREATURE_OS_DB_PATH`: SQLite path override
156
+ - `CREATURE_OS_HOST`: bind host override for single-bind serve mode
157
+ - `CREATURE_OS_PUBLIC_HOST`: display host used in generated URLs
158
+ - `CREATURE_OS_PORT`: port override
159
+ - `CREATURE_OS_CODEX_BIN`: Codex CLI binary
160
+ - `CREATURE_OS_MODEL`: model override
161
+ - `CREATURE_OS_REASONING_EFFORT`: reasoning effort override
162
+ - `CREATURE_OS_TIMEOUT_SECONDS`: read-only run timeout
163
+ - `CREATURE_OS_WRITE_TIMEOUT_SECONDS`: write-enabled run timeout
164
+ - `CREATURE_OS_PYTHON_BIN`: Python interpreter used by helper scripts
165
+
166
+ ## Development
167
+
168
+ Common commands:
169
+
170
+ ```bash
171
+ python3 -m py_compile creatureos/cli.py creatureos/web.py creatureos/service.py creatureos/storage.py creatureos/config.py creatureos/codex_cli.py
172
+ node --check creatureos/static/creature_os.js
173
+ python3 -m creatureos.cli --help
174
+ python3 -m creatureos.cli serve --help
175
+ ```
176
+
177
+ Health check:
178
+
179
+ ```bash
180
+ curl http://127.0.0.1:404/healthz
181
+ ```
182
+
183
+ Testing:
184
+
185
+ ```bash
186
+ python3 -m pytest
187
+ ```
188
+
189
+ Browser smoke test:
190
+
191
+ ```bash
192
+ CREATURE_OS_RUN_BROWSER_SMOKE=1 python3 -m pytest -m browser
193
+ ```
194
+
195
+ Storage-focused guardrails:
196
+
197
+ ```bash
198
+ python3 scripts/check_storage_sql.py
199
+ python3 scripts/storage_smoke.py
200
+ ```
201
+
202
+ ## Packaging
203
+
204
+ Build an sdist and wheel:
205
+
206
+ ```bash
207
+ python3 -m pip install build twine
208
+ python3 -m build
209
+ python3 -m twine check dist/*
210
+ ```
211
+
212
+ CreatureOS wheels bundle:
213
+ - templates
214
+ - static assets
215
+
216
+ so the installed app can run outside a source checkout.
217
+
218
+ ## Publishing
219
+
220
+ CreatureOS is set up for trusted publishing with GitHub Actions.
221
+
222
+ Test phase on TestPyPI:
223
+ - add this GitHub repo as a trusted publisher in TestPyPI
224
+ - run the `Publish Package` workflow manually with target `testpypi`
225
+
226
+ Real release on PyPI:
227
+ - add this GitHub repo as a trusted publisher in PyPI
228
+ - create a GitHub release
229
+ - the same workflow publishes to PyPI automatically on `release.published`
230
+
231
+ The CI workflow also smoke-installs the built wheel so packaging regressions get caught before release.
232
+
233
+ ## Repo Layout
234
+
235
+ - runtime package: `creatureos/`
236
+ - UI assets: `creatureos/templates/`, `creatureos/static/`
237
+ - helper scripts: `scripts/`
238
+ - tests: `tests/`
239
+
240
+ ## Notes
241
+
242
+ - `serve` runs a small supervisor that restarts the worker when core runtime files change.
243
+ - Static JS and CSS are served with revalidation headers to avoid stale browser state.
244
+ - If a server is already running for the same CreatureOS data directory, a second `serve` exits instead of starting a duplicate process.
245
+
246
+ ## License
247
+
248
+ CreatureOS is licensed under Apache 2.0. See [LICENSE](LICENSE).
@@ -0,0 +1,217 @@
1
+ # CreatureOS
2
+
3
+ CreatureOS is a local-first runtime for persistent Codex creatures.
4
+
5
+ It gives you a small ambient habitat of specialized creatures that can:
6
+ - watch a workspace over time
7
+ - keep durable notes, memory, and activity reports
8
+ - chat in a web UI
9
+ - practice habits on a schedule and surface useful things without needing a fresh prompt every time
10
+ - work with local documents, attachments, and browser flows as part of their normal job
11
+ - keep private workshop scripts, files, templates, and reports that make repeated work easier
12
+
13
+ CreatureOS is intentionally opinionated:
14
+ - chats get fresh Codex threads
15
+ - habit runs stay on a persistent creature thread
16
+ - state lives locally in SQLite
17
+ - creatures use purpose and habits as their authority rather than a matrix of manual capability grants
18
+ - The Keeper helps summon and shape the rest of the habitat
19
+
20
+ ## Prerequisites
21
+
22
+ CreatureOS itself is a Python app, but it wraps the Codex CLI.
23
+
24
+ You should have:
25
+ - Python `3.12+`
26
+ - the `codex` CLI available on your `PATH`
27
+ - Codex authenticated locally
28
+
29
+ SQLite uses Python's built-in `sqlite3` module. There is no separate database server to install.
30
+
31
+ Optional:
32
+ - Tailscale, if you want private cross-device access with `--tailscale`
33
+
34
+ ## Install
35
+
36
+ Install from a checkout:
37
+
38
+ ```bash
39
+ python3 -m pip install -e .
40
+ ```
41
+
42
+ Once published to PyPI, the install command will be:
43
+
44
+ ```bash
45
+ pip install creatureos
46
+ ```
47
+
48
+ ## Start
49
+
50
+ Initialize the database once:
51
+
52
+ ```bash
53
+ creatureos init-db
54
+ ```
55
+
56
+ Start CreatureOS in safe local-only mode:
57
+
58
+ ```bash
59
+ creatureos serve --workspace /path/to/workspace
60
+ ```
61
+
62
+ That binds to:
63
+ - `127.0.0.1:404` by default
64
+
65
+ Serve on localhost plus the detected Tailscale IPv4:
66
+
67
+ ```bash
68
+ creatureos serve --workspace /path/to/workspace --tailscale
69
+ ```
70
+
71
+ That binds to:
72
+ - `127.0.0.1:404`
73
+ - the detected Tailscale IPv4 on the same port
74
+
75
+ If no Tailscale IPv4 is detected, it falls back to localhost-only.
76
+
77
+ Force a fresh onboarding environment scan on boot:
78
+
79
+ ```bash
80
+ creatureos serve --workspace /path/to/workspace --force-scan
81
+ ```
82
+
83
+ ## Working Root And Data
84
+
85
+ If you do not pass `--workspace`, CreatureOS uses your current working directory as the primary working root for creature file work.
86
+
87
+ The onboarding scan is broader than that. It looks across likely work directories on the machine so The Keeper can form a first impression of the kind of work you do.
88
+
89
+ For repeatable launches, prefer setting the workspace explicitly with:
90
+ - `creatureos --workspace /path/to/workspace serve`
91
+
92
+ or with:
93
+ - `CREATURE_OS_WORKSPACE_ROOT`
94
+
95
+ Runtime state lives under:
96
+
97
+ ```text
98
+ ~/.local/state/creatureos
99
+ ```
100
+
101
+ on Linux by default.
102
+
103
+ On macOS the default is:
104
+
105
+ ```text
106
+ ~/Library/Application Support/CreatureOS
107
+ ```
108
+
109
+ On Windows the default is:
110
+
111
+ ```text
112
+ %LOCALAPPDATA%\CreatureOS
113
+ ```
114
+
115
+ Override that explicitly with:
116
+ - `creatureos --data-dir /path/to/data serve`
117
+ - `CREATURE_OS_DATA_DIR`
118
+ - `CREATURE_OS_DB_PATH`
119
+
120
+ ## Environment
121
+
122
+ - `CREATURE_OS_WORKSPACE_ROOT`: primary working root for creature file work
123
+ - `CREATURE_OS_DATA_DIR`: runtime data directory
124
+ - `CREATURE_OS_DB_PATH`: SQLite path override
125
+ - `CREATURE_OS_HOST`: bind host override for single-bind serve mode
126
+ - `CREATURE_OS_PUBLIC_HOST`: display host used in generated URLs
127
+ - `CREATURE_OS_PORT`: port override
128
+ - `CREATURE_OS_CODEX_BIN`: Codex CLI binary
129
+ - `CREATURE_OS_MODEL`: model override
130
+ - `CREATURE_OS_REASONING_EFFORT`: reasoning effort override
131
+ - `CREATURE_OS_TIMEOUT_SECONDS`: read-only run timeout
132
+ - `CREATURE_OS_WRITE_TIMEOUT_SECONDS`: write-enabled run timeout
133
+ - `CREATURE_OS_PYTHON_BIN`: Python interpreter used by helper scripts
134
+
135
+ ## Development
136
+
137
+ Common commands:
138
+
139
+ ```bash
140
+ python3 -m py_compile creatureos/cli.py creatureos/web.py creatureos/service.py creatureos/storage.py creatureos/config.py creatureos/codex_cli.py
141
+ node --check creatureos/static/creature_os.js
142
+ python3 -m creatureos.cli --help
143
+ python3 -m creatureos.cli serve --help
144
+ ```
145
+
146
+ Health check:
147
+
148
+ ```bash
149
+ curl http://127.0.0.1:404/healthz
150
+ ```
151
+
152
+ Testing:
153
+
154
+ ```bash
155
+ python3 -m pytest
156
+ ```
157
+
158
+ Browser smoke test:
159
+
160
+ ```bash
161
+ CREATURE_OS_RUN_BROWSER_SMOKE=1 python3 -m pytest -m browser
162
+ ```
163
+
164
+ Storage-focused guardrails:
165
+
166
+ ```bash
167
+ python3 scripts/check_storage_sql.py
168
+ python3 scripts/storage_smoke.py
169
+ ```
170
+
171
+ ## Packaging
172
+
173
+ Build an sdist and wheel:
174
+
175
+ ```bash
176
+ python3 -m pip install build twine
177
+ python3 -m build
178
+ python3 -m twine check dist/*
179
+ ```
180
+
181
+ CreatureOS wheels bundle:
182
+ - templates
183
+ - static assets
184
+
185
+ so the installed app can run outside a source checkout.
186
+
187
+ ## Publishing
188
+
189
+ CreatureOS is set up for trusted publishing with GitHub Actions.
190
+
191
+ Test phase on TestPyPI:
192
+ - add this GitHub repo as a trusted publisher in TestPyPI
193
+ - run the `Publish Package` workflow manually with target `testpypi`
194
+
195
+ Real release on PyPI:
196
+ - add this GitHub repo as a trusted publisher in PyPI
197
+ - create a GitHub release
198
+ - the same workflow publishes to PyPI automatically on `release.published`
199
+
200
+ The CI workflow also smoke-installs the built wheel so packaging regressions get caught before release.
201
+
202
+ ## Repo Layout
203
+
204
+ - runtime package: `creatureos/`
205
+ - UI assets: `creatureos/templates/`, `creatureos/static/`
206
+ - helper scripts: `scripts/`
207
+ - tests: `tests/`
208
+
209
+ ## Notes
210
+
211
+ - `serve` runs a small supervisor that restarts the worker when core runtime files change.
212
+ - Static JS and CSS are served with revalidation headers to avoid stale browser state.
213
+ - If a server is already running for the same CreatureOS data directory, a second `serve` exits instead of starting a duplicate process.
214
+
215
+ ## License
216
+
217
+ CreatureOS is licensed under Apache 2.0. See [LICENSE](LICENSE).
@@ -0,0 +1,3 @@
1
+ from __future__ import annotations
2
+
3
+ __all__ = []
@@ -0,0 +1,7 @@
1
+ from __future__ import annotations
2
+
3
+ from .cli import main
4
+
5
+
6
+ if __name__ == "__main__":
7
+ raise SystemExit(main())