cave-harness 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 (90) hide show
  1. cave_harness-0.1.0/LICENSE +144 -0
  2. cave_harness-0.1.0/PKG-INFO +87 -0
  3. cave_harness-0.1.0/README.md +50 -0
  4. cave_harness-0.1.0/cave/__init__.py +92 -0
  5. cave_harness-0.1.0/cave/_llegos/__init__.py +3 -0
  6. cave_harness-0.1.0/cave/_llegos/llegos.py +681 -0
  7. cave_harness-0.1.0/cave/_llegos/logger.py +11 -0
  8. cave_harness-0.1.0/cave/actors/__init__.py +3 -0
  9. cave_harness-0.1.0/cave/actors/llegos.py +681 -0
  10. cave_harness-0.1.0/cave/actors/logger.py +11 -0
  11. cave_harness-0.1.0/cave/adapters/__init__.py +0 -0
  12. cave_harness-0.1.0/cave/core/__init__.py +8 -0
  13. cave_harness-0.1.0/cave/core/agent.py +1054 -0
  14. cave_harness-0.1.0/cave/core/automation.py +733 -0
  15. cave_harness-0.1.0/cave/core/blockage_store.py +175 -0
  16. cave_harness-0.1.0/cave/core/calendar.py +315 -0
  17. cave_harness-0.1.0/cave/core/capability_resolver.py +124 -0
  18. cave_harness-0.1.0/cave/core/cave_agent.py +1040 -0
  19. cave_harness-0.1.0/cave/core/channel.py +533 -0
  20. cave_harness-0.1.0/cave/core/config.py +105 -0
  21. cave_harness-0.1.0/cave/core/config_snapshots.py +298 -0
  22. cave_harness-0.1.0/cave/core/container_registration.py +126 -0
  23. cave_harness-0.1.0/cave/core/discord_config.py +31 -0
  24. cave_harness-0.1.0/cave/core/discord_source.py +177 -0
  25. cave_harness-0.1.0/cave/core/dna.py +244 -0
  26. cave_harness-0.1.0/cave/core/event_broadcaster.py +159 -0
  27. cave_harness-0.1.0/cave/core/event_router.py +382 -0
  28. cave_harness-0.1.0/cave/core/harness.py +380 -0
  29. cave_harness-0.1.0/cave/core/hook_control.py +87 -0
  30. cave_harness-0.1.0/cave/core/hooks.py +514 -0
  31. cave_harness-0.1.0/cave/core/inbox.py +160 -0
  32. cave_harness-0.1.0/cave/core/inbox_hook.py +57 -0
  33. cave_harness-0.1.0/cave/core/loops/__init__.py +48 -0
  34. cave_harness-0.1.0/cave/core/loops/autopoiesis.py +53 -0
  35. cave_harness-0.1.0/cave/core/loops/base.py +143 -0
  36. cave_harness-0.1.0/cave/core/loops/guru.py +53 -0
  37. cave_harness-0.1.0/cave/core/loops/omnisanc_loops.py +116 -0
  38. cave_harness-0.1.0/cave/core/loops/transitions.py +145 -0
  39. cave_harness-0.1.0/cave/core/mini_cli.py +162 -0
  40. cave_harness-0.1.0/cave/core/mixins/__init__.py +34 -0
  41. cave_harness-0.1.0/cave/core/mixins/agent_registry.py +43 -0
  42. cave_harness-0.1.0/cave/core/mixins/anatomy.py +1031 -0
  43. cave_harness-0.1.0/cave/core/mixins/automation_mixin.py +102 -0
  44. cave_harness-0.1.0/cave/core/mixins/heartbeat.py +158 -0
  45. cave_harness-0.1.0/cave/core/mixins/heartbeat_cron.py +93 -0
  46. cave_harness-0.1.0/cave/core/mixins/hook_router.py +234 -0
  47. cave_harness-0.1.0/cave/core/mixins/loop_manager.py +193 -0
  48. cave_harness-0.1.0/cave/core/mixins/message_router.py +141 -0
  49. cave_harness-0.1.0/cave/core/mixins/omnisanc.py +239 -0
  50. cave_harness-0.1.0/cave/core/mixins/paia_state.py +51 -0
  51. cave_harness-0.1.0/cave/core/mixins/remote_agent.py +95 -0
  52. cave_harness-0.1.0/cave/core/mixins/sse.py +43 -0
  53. cave_harness-0.1.0/cave/core/mixins/tui.py +380 -0
  54. cave_harness-0.1.0/cave/core/models.py +116 -0
  55. cave_harness-0.1.0/cave/core/organ_daemon.py +289 -0
  56. cave_harness-0.1.0/cave/core/output_watcher.py +237 -0
  57. cave_harness-0.1.0/cave/core/publishing/__init__.py +0 -0
  58. cave_harness-0.1.0/cave/core/publishing/blog_organ_nightly.py +345 -0
  59. cave_harness-0.1.0/cave/core/publishing/coglog_publisher.py +346 -0
  60. cave_harness-0.1.0/cave/core/publishing/review_coglogs.py +98 -0
  61. cave_harness-0.1.0/cave/core/ralph_scheduler.py +382 -0
  62. cave_harness-0.1.0/cave/core/remote_agent.py +192 -0
  63. cave_harness-0.1.0/cave/core/sanctuary_degree_calculator.py +329 -0
  64. cave_harness-0.1.0/cave/core/sanctum_automations.py +811 -0
  65. cave_harness-0.1.0/cave/core/sanctum_canopy.py +252 -0
  66. cave_harness-0.1.0/cave/core/sanctum_cli.py +288 -0
  67. cave_harness-0.1.0/cave/core/sanctum_source.py +278 -0
  68. cave_harness-0.1.0/cave/core/self_command_generator.py +212 -0
  69. cave_harness-0.1.0/cave/core/state_reader.py +334 -0
  70. cave_harness-0.1.0/cave/core/status.py +144 -0
  71. cave_harness-0.1.0/cave/core/terminal_ui.py +307 -0
  72. cave_harness-0.1.0/cave/core/user_config.py +130 -0
  73. cave_harness-0.1.0/cave/core/world.py +230 -0
  74. cave_harness-0.1.0/cave/mcp/harness_client_mcp.py +169 -0
  75. cave_harness-0.1.0/cave/server/__init__.py +0 -0
  76. cave_harness-0.1.0/cave/server/cave_http_server.py +429 -0
  77. cave_harness-0.1.0/cave/server/http_server.py +550 -0
  78. cave_harness-0.1.0/cave/utils/__init__.py +0 -0
  79. cave_harness-0.1.0/cave_harness.egg-info/PKG-INFO +87 -0
  80. cave_harness-0.1.0/cave_harness.egg-info/SOURCES.txt +88 -0
  81. cave_harness-0.1.0/cave_harness.egg-info/dependency_links.txt +1 -0
  82. cave_harness-0.1.0/cave_harness.egg-info/entry_points.txt +2 -0
  83. cave_harness-0.1.0/cave_harness.egg-info/requires.txt +16 -0
  84. cave_harness-0.1.0/cave_harness.egg-info/top_level.txt +1 -0
  85. cave_harness-0.1.0/pyproject.toml +58 -0
  86. cave_harness-0.1.0/setup.cfg +4 -0
  87. cave_harness-0.1.0/tests/test_blog_organ_nightly.py +114 -0
  88. cave_harness-0.1.0/tests/test_conductor_routing.py +154 -0
  89. cave_harness-0.1.0/tests/test_journal_trigger_pipeline.py +139 -0
  90. cave_harness-0.1.0/tests/test_perception_refactor.py +206 -0
@@ -0,0 +1,144 @@
1
+ GNOSYS Personal Builder License (GPBL) v1.0
2
+
3
+ Copyright © 2025 Isaac Wostrel-Rubin
4
+ Guardian of the GNOSYS / Sanctuary Stack
5
+
6
+ GNOSYS and the Sanctuary libraries are free, open, and hackable for personal and internal use.
7
+ Run them, fork them, and share them — with one core constraint:
8
+
9
+ You can't sell them or run them as-a-service without a separate commercial license from me.
10
+
11
+
12
+
13
+ 1 You Can
14
+
15
+ You are granted a non-exclusive, non-transferable, worldwide license to:
16
+ • Run GNOSYS / Sanctuary libraries anywhere, for yourself or inside your own org, for free.
17
+ • Study, modify, and extend the code, including:
18
+ • Changing behavior, structure, or architecture
19
+ • Adding MCPs, agents, workflows, UI, or integrations
20
+ • Share your modified versions (forks, patches, examples) publicly, as long as:
21
+ • You keep this license text, and
22
+ • Your distribution stays non-commercial (see §3).
23
+
24
+ This applies to:
25
+ • The GNOSYS meta-library
26
+ • Sanctuary / STARSYSTEM / HEAVEN / CartON / related libraries and tools in this repo
27
+ • Any example configs or reference agents shipped with them
28
+
29
+ unless a specific file or subproject explicitly states a different license.
30
+
31
+
32
+
33
+ 2 Please Do
34
+
35
+ To keep the ecosystem coherent:
36
+ • Keep this license notice and a link back to the main repo.
37
+ • Clearly mark modifications (e.g. in the README:
38
+ "This is a modified version of GNOSYS by <your name>."
39
+ • When possible, credit GNOSYS / Sanctuary in docs or marketing as the underlying stack.
40
+
41
+
42
+
43
+ 3 You Can't (Without a Commercial License)
44
+
45
+ You may not, without a separate written commercial license from Isaac Wostrel-Rubin:
46
+ • Sell GNOSYS / Sanctuary itself, including:
47
+ • Paid downloads, paywalled builds, or subscriptions
48
+ • "Pro" binaries where GNOSYS is the primary value
49
+ • Offer GNOSYS / Sanctuary as a hosted or managed service, including:
50
+ • SaaS platforms, hosted agents, or API products where:
51
+ • GNOSYS / Sanctuary code is a core dependency and
52
+ • Third parties sign up, pay, or are billed for access
53
+ • Bundle GNOSYS / Sanctuary into another paid product, where:
54
+ • The libraries are a key part of the product's value, even if not visible
55
+ • Or the product would not realistically function as-sold without them
56
+ • Re-license this code under a different, more permissive or commercial license.
57
+
58
+ If you want to:
59
+ • Build a SaaS,
60
+ • Embed this stack in a product, or
61
+ • Sell access to agents powered by GNOSYS / Sanctuary,
62
+ then you need a commercial license. See §9.
63
+
64
+
65
+
66
+ 4 What Is Allowed Commercially
67
+
68
+ You may, without a separate license:
69
+ • Charge for your time and expertise, including:
70
+ • Consulting, coaching, architecture, and design work
71
+ • Installation, customization, and integration of GNOSYS / Sanctuary on the client's own infrastructure
72
+ • Teaching others how to use, extend, or modify the stack
73
+ • Use GNOSYS internally to:
74
+ • Accelerate your own work
75
+ • Build internal tools and workflows not sold as products
76
+ • Support your own content, research, or services
77
+
78
+ Put simply:
79
+
80
+ Selling your brain is OK. Selling GNOSYS / Sanctuary as a product or hosted service is not, unless you've got a commercial agreement.
81
+
82
+
83
+
84
+ 5 Trademarks & Naming
85
+
86
+ "GNOSYS", "Sanctuary System", "STARSYSTEM", "Victory-Everything Chain (VEC)", "OMNISANC", and related marks, names, or logos may be protected as trademarks or service marks.
87
+
88
+ Under this license you:
89
+ • May reference these names factually (e.g. "Built on GNOSYS"), and
90
+ • May not imply official endorsement, partnership, or authorship by Isaac Wostrel-Rubin unless you actually have that agreement.
91
+
92
+ If you fork the stack into your own product, use your own brand and clearly mark it as such.
93
+
94
+
95
+
96
+ 6 No Warranty
97
+
98
+ The software is provided "as is", without warranty of any kind, express or implied, including but not limited to:
99
+ • Merchantability
100
+ • Fitness for a particular purpose
101
+ • Non-infringement
102
+
103
+ You assume all risk for using, modifying, or deploying this code.
104
+
105
+
106
+
107
+ 7 Limitation of Liability
108
+
109
+ In no event shall the author(s) or copyright holder(s) be liable for any claim, damages, or other liability, whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the software or the use or other dealings in the software.
110
+
111
+
112
+
113
+ 8 Termination
114
+
115
+ If you violate this license and do not remedy the violation within 30 days of being notified:
116
+ • Your rights under this license automatically terminate.
117
+ • You must stop using, distributing, or hosting GNOSYS / Sanctuary under this license.
118
+
119
+ The author may grant you a new license at their sole discretion after remediation.
120
+
121
+
122
+
123
+ 9 Commercial Licensing
124
+
125
+ If you want to:
126
+ • Run GNOSYS / Sanctuary as a SaaS or hosted agent platform
127
+ • Embed it into a commercial product
128
+ • Resell it or bundle it into paid offerings
129
+
130
+ you must obtain a commercial license.
131
+
132
+ To do that:
133
+ 1. Book a paid licensing meeting via
134
+ 👉 https://isaacwr.carrd.co
135
+ and note that you are requesting a GNOSYS / Sanctuary commercial license.
136
+ 2. The meeting payment reserves Isaac's time and is non-refundable if you decide not to purchase the license.
137
+ 3. If you proceed, the meeting fee will be discounted against the license price.
138
+
139
+ The standard commercial license is:
140
+
141
+ $997 USD — universal commercial rights
142
+ (to use GNOSYS / Sanctuary in your own commercial products and services, subject to the terms in the commercial agreement).
143
+
144
+ Do not book this meeting unless you are seriously intending to obtain the license; the call fee compensates for time even if you choose not to move forward.
@@ -0,0 +1,87 @@
1
+ Metadata-Version: 2.4
2
+ Name: cave-harness
3
+ Version: 0.1.0
4
+ Summary: Code Agent Virtualization Environment - Virtualize any terminal-based code agent
5
+ Author-email: Isaac <isaac@example.com>
6
+ License: GPBL-1.0
7
+ Project-URL: Homepage, https://github.com/sancovp/cave
8
+ Project-URL: Documentation, https://github.com/sancovp/cave#readme
9
+ Project-URL: Repository, https://github.com/sancovp/cave
10
+ Keywords: ai,agents,claude,virtualization,harness
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: Other/Proprietary License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Requires-Python: >=3.10
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Requires-Dist: pydantic==2.10.6
22
+ Requires-Dist: fastapi==0.136.1
23
+ Requires-Dist: uvicorn==0.46.0
24
+ Requires-Dist: httpx==0.28.1
25
+ Requires-Dist: sanctuary-dna>=0.3.5
26
+ Requires-Dist: beartype
27
+ Requires-Dist: deepmerge
28
+ Requires-Dist: svix-ksuid==0.7.0
29
+ Requires-Dist: networkx
30
+ Requires-Dist: pydash
31
+ Requires-Dist: pyee
32
+ Requires-Dist: sorcery
33
+ Provides-Extra: dev
34
+ Requires-Dist: pytest>=7.0; extra == "dev"
35
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
36
+ Dynamic: license-file
37
+
38
+ # CAVE — Code Agent Virtualization Environment
39
+
40
+ **Package:** `cave-harness`
41
+
42
+ CAVE virtualizes any terminal-based code agent (e.g. Claude Code) behind an HTTP server, so it can be
43
+ driven, observed, and orchestrated as a service instead of an interactive terminal. It is the agent
44
+ runtime that PromptWorld and the other *Worlds are built on.
45
+
46
+ ## What it gives you
47
+
48
+ - **An HTTP server around a code agent** — start a long-lived agent process and talk to it over HTTP
49
+ instead of a TTY: inject prompts, stream output, and run it inside a loop.
50
+ - **A hook harness** — a registry + dispatch layer for Claude Code hooks (session-start / per-turn /
51
+ stop), so behavior can be layered onto the agent from outside.
52
+ - **Loop infrastructure** — the autopoiesis / guru loops that keep an agent working across turns.
53
+
54
+ ## Install
55
+
56
+ ```bash
57
+ pip install cave-harness
58
+ ```
59
+
60
+ Optional extras:
61
+
62
+ ```bash
63
+ pip install "cave-harness[sdna]" # + sanctuary-dna integration
64
+ pip install "cave-harness[dev]" # + pytest / pytest-asyncio
65
+ ```
66
+
67
+ ## Run the server
68
+
69
+ ```bash
70
+ cave-server
71
+ ```
72
+
73
+ This launches the HTTP server (`cave.server.http_server:run_server`, FastAPI + uvicorn). Point your
74
+ client at it to register hooks, inject prompts, and drive the virtualized agent.
75
+
76
+ ## Where it sits
77
+
78
+ CAVE is the **runtime** layer of the SANCREV / GNOSYS stack: the *Worlds (PromptWorld, …) compile their
79
+ agents and run them on top of the CAVE harness. See the ecosystem docs for the full picture.
80
+
81
+ ## Docs
82
+
83
+ Full documentation and the ecosystem map: **https://sancovp.github.io/aisaac/**
84
+
85
+ ## License
86
+
87
+ GPBL-1.0 — see `LICENSE`.
@@ -0,0 +1,50 @@
1
+ # CAVE — Code Agent Virtualization Environment
2
+
3
+ **Package:** `cave-harness`
4
+
5
+ CAVE virtualizes any terminal-based code agent (e.g. Claude Code) behind an HTTP server, so it can be
6
+ driven, observed, and orchestrated as a service instead of an interactive terminal. It is the agent
7
+ runtime that PromptWorld and the other *Worlds are built on.
8
+
9
+ ## What it gives you
10
+
11
+ - **An HTTP server around a code agent** — start a long-lived agent process and talk to it over HTTP
12
+ instead of a TTY: inject prompts, stream output, and run it inside a loop.
13
+ - **A hook harness** — a registry + dispatch layer for Claude Code hooks (session-start / per-turn /
14
+ stop), so behavior can be layered onto the agent from outside.
15
+ - **Loop infrastructure** — the autopoiesis / guru loops that keep an agent working across turns.
16
+
17
+ ## Install
18
+
19
+ ```bash
20
+ pip install cave-harness
21
+ ```
22
+
23
+ Optional extras:
24
+
25
+ ```bash
26
+ pip install "cave-harness[sdna]" # + sanctuary-dna integration
27
+ pip install "cave-harness[dev]" # + pytest / pytest-asyncio
28
+ ```
29
+
30
+ ## Run the server
31
+
32
+ ```bash
33
+ cave-server
34
+ ```
35
+
36
+ This launches the HTTP server (`cave.server.http_server:run_server`, FastAPI + uvicorn). Point your
37
+ client at it to register hooks, inject prompts, and drive the virtualized agent.
38
+
39
+ ## Where it sits
40
+
41
+ CAVE is the **runtime** layer of the SANCREV / GNOSYS stack: the *Worlds (PromptWorld, …) compile their
42
+ agents and run them on top of the CAVE harness. See the ecosystem docs for the full picture.
43
+
44
+ ## Docs
45
+
46
+ Full documentation and the ecosystem map: **https://sancovp.github.io/aisaac/**
47
+
48
+ ## License
49
+
50
+ GPBL-1.0 — see `LICENSE`.
@@ -0,0 +1,92 @@
1
+ """
2
+ CAVE - Code Agent Virtualization Environment
3
+
4
+ Virtualize any terminal-based code agent (Claude Code, Aider, etc.)
5
+ to create AI-legible architectures where you can vibe code together.
6
+ """
7
+
8
+ # === Core Agent Classes ===
9
+ from .core.agent import (
10
+ CodeAgent,
11
+ CodeAgentConfig,
12
+ ClaudeCodeAgent,
13
+ ClaudeCodeAgentConfig,
14
+ InboxMessage,
15
+ UserPromptMessage,
16
+ SystemEventMessage,
17
+ BlockedMessage,
18
+ CompletedMessage,
19
+ IngressType,
20
+ create_user_message,
21
+ create_system_event,
22
+ )
23
+
24
+ # === CAVEAgent (The God Object) ===
25
+ from .core.cave_agent import CAVEAgent
26
+ from .core.config import CAVEConfig
27
+ from .core.models import MainAgentConfig, PAIAState, AgentRegistration, RemoteAgentHandle
28
+ from .core.state_reader import ClaudeStateReader
29
+
30
+ # === Mixins ===
31
+ from .core.mixins import (
32
+ PAIAStateMixin,
33
+ AgentRegistryMixin,
34
+ MessageRouterMixin,
35
+ HookRouterMixin,
36
+ RemoteAgentMixin,
37
+ SSEMixin,
38
+ )
39
+
40
+ # === Hooks (define hooks in code) ===
41
+ from .core.hooks import (
42
+ ClaudeCodeHook,
43
+ HookType,
44
+ HookDecision,
45
+ HookResult,
46
+ HookRegistry,
47
+ RegistryEntry,
48
+ AntigravityHook,
49
+ AntigravityEnvelopeAdapter,
50
+ )
51
+
52
+ __version__ = "0.1.0"
53
+ __all__ = [
54
+ # Core agents
55
+ "CodeAgent",
56
+ "CodeAgentConfig",
57
+ "ClaudeCodeAgent",
58
+ "ClaudeCodeAgentConfig",
59
+ "InboxMessage",
60
+ "UserPromptMessage",
61
+ "SystemEventMessage",
62
+ "BlockedMessage",
63
+ "CompletedMessage",
64
+ "IngressType",
65
+ "create_user_message",
66
+ "create_system_event",
67
+ # CAVEAgent
68
+ "CAVEAgent",
69
+ "CAVEConfig",
70
+ # Models
71
+ "PAIAState",
72
+ "AgentRegistration",
73
+ "RemoteAgentHandle",
74
+ "ClaudeStateReader",
75
+ # Mixins
76
+ "PAIAStateMixin",
77
+ "AgentRegistryMixin",
78
+ "MessageRouterMixin",
79
+ "HookRouterMixin",
80
+ "RemoteAgentMixin",
81
+ "SSEMixin",
82
+ # Hooks
83
+ "ClaudeCodeHook",
84
+ "HookType",
85
+ "HookDecision",
86
+ "HookResult",
87
+ "HookRegistry",
88
+ "RegistryEntry",
89
+ "AntigravityHook",
90
+ "AntigravityEnvelopeAdapter",
91
+ ]
92
+
@@ -0,0 +1,3 @@
1
+ """llegos - Actor model for multi-agent systems (LGPL-3.0)"""
2
+ from .llegos import Actor, Message, Network, Object, message_send, message_propagate
3
+ __all__ = ["Actor", "Message", "Network", "Object", "message_send", "message_propagate"]