MeowCat 1.2.35__py3-none-any.whl
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.
- meowcat/__init__.py +40 -0
- meowcat/__main__.py +82 -0
- meowcat/_exports.py +584 -0
- meowcat/adapters/__init__.py +62 -0
- meowcat/adapters/base.py +106 -0
- meowcat/adapters/brain.py +467 -0
- meowcat/adapters/sense.py +142 -0
- meowcat/adapters/voice.py +44 -0
- meowcat/anatomy.py +139 -0
- meowcat/assembly.py +949 -0
- meowcat/biology/__init__.py +491 -0
- meowcat/biology/active_growth.py +368 -0
- meowcat/biology/active_growth_pack.py +83 -0
- meowcat/biology/cat_self.py +676 -0
- meowcat/biology/cortex.py +288 -0
- meowcat/biology/fusion_cycle.py +112 -0
- meowcat/biology/growth.py +213 -0
- meowcat/biology/metacognition.py +187 -0
- meowcat/biology/pineal_gland.py +435 -0
- meowcat/biology/roles.py +213 -0
- meowcat/biology/scribble_pad.py +209 -0
- meowcat/chain.py +214 -0
- meowcat/cli/__init__.py +30 -0
- meowcat/cli/app.py +80 -0
- meowcat/cli/commands.py +379 -0
- meowcat/cli/i18n.py +144 -0
- meowcat/cli/locales/en.json +80 -0
- meowcat/cli/locales/zh.json +80 -0
- meowcat/cli/router.py +152 -0
- meowcat/cli/theme.py +114 -0
- meowcat/colony/__init__.py +976 -0
- meowcat/colony/config.py +34 -0
- meowcat/colony/federation.py +236 -0
- meowcat/colony/memory.py +210 -0
- meowcat/colony/registry.py +188 -0
- meowcat/colony/rules.py +58 -0
- meowcat/colony_transports.py +396 -0
- meowcat/constants.py +76 -0
- meowcat/coordination.py +213 -0
- meowcat/defaults/__init__.py +110 -0
- meowcat/defaults/factory.py +323 -0
- meowcat/defaults/organs.py +1057 -0
- meowcat/defaults/presets.py +290 -0
- meowcat/defaults/renovated.py +974 -0
- meowcat/defaults/stages.py +110 -0
- meowcat/defaults/stores.py +177 -0
- meowcat/diagnose.py +209 -0
- meowcat/errors.py +189 -0
- meowcat/events.py +381 -0
- meowcat/events_payloads.py +296 -0
- meowcat/examples/01_organ_host_only.py +50 -0
- meowcat/examples/02_wiring_validation.py +44 -0
- meowcat/examples/03_event_bus_only.py +41 -0
- meowcat/examples/04_custom_cat.py +81 -0
- meowcat/examples/05_minimal_chat_cat.py +117 -0
- meowcat/examples/06_custom_organ.py +62 -0
- meowcat/examples/07_custom_organ.py +134 -0
- meowcat/examples/__init__.py +8 -0
- meowcat/gateway/__init__.py +117 -0
- meowcat/gateway/protocol.py +109 -0
- meowcat/host.py +112 -0
- meowcat/inject.py +129 -0
- meowcat/log.py +90 -0
- meowcat/loops.py +462 -0
- meowcat/middleware.py +153 -0
- meowcat/models.py +368 -0
- meowcat/nervous.py +484 -0
- meowcat/organ_base.py +110 -0
- meowcat/organ_roles.py +67 -0
- meowcat/path.py +263 -0
- meowcat/perception.py +125 -0
- meowcat/pipeline.py +54 -0
- meowcat/pluggable.py +157 -0
- meowcat/plus/__init__.py +42 -0
- meowcat/plus/browser.py +251 -0
- meowcat/plus/chroma_store.py +197 -0
- meowcat/plus/crystallizer.py +227 -0
- meowcat/plus/gateway/__init__.py +27 -0
- meowcat/plus/gateway/cli_adapter.py +136 -0
- meowcat/plus/gateway/http_adapter.py +184 -0
- meowcat/plus/gateway/ipc_adapter.py +144 -0
- meowcat/plus/gateway/webhook_adapter.py +183 -0
- meowcat/plus/gateway/ws_adapter.py +274 -0
- meowcat/plus/mcp_client.py +351 -0
- meowcat/plus/skill_loader.py +214 -0
- meowcat/plus/tools/__init__.py +22 -0
- meowcat/plus/tools/command.py +75 -0
- meowcat/plus/tools/file_ops.py +127 -0
- meowcat/plus/tools/http_client.py +42 -0
- meowcat/protocols.py +263 -0
- meowcat/protocols_brain.py +359 -0
- meowcat/protocols_sense.py +108 -0
- meowcat/protocols_storage.py +131 -0
- meowcat/protocols_voice.py +68 -0
- meowcat/py.typed +0 -0
- meowcat/reflex.py +307 -0
- meowcat/storage/__init__.py +69 -0
- meowcat/storage/jsonl_l6_store.py +87 -0
- meowcat/storage/sqlite_graph_store.py +76 -0
- meowcat/storage/vector_store.py +209 -0
- meowcat/telemetry.py +193 -0
- meowcat/testing.py +22 -0
- meowcat/tools/__init__.py +64 -0
- meowcat/tools/matcher.py +167 -0
- meowcat/tools/paws.py +173 -0
- meowcat/tools/skill.py +189 -0
- meowcat/tools/tool.py +220 -0
- meowcat/utils/__init__.py +14 -0
- meowcat/utils/http.py +98 -0
- meowcat/wiring.py +194 -0
- meowcat/worker/__init__.py +288 -0
- meowcat/worker/scheduler.py +175 -0
- meowcat-1.2.35.dist-info/METADATA +17 -0
- meowcat-1.2.35.dist-info/RECORD +116 -0
- meowcat-1.2.35.dist-info/WHEEL +4 -0
- meowcat-1.2.35.dist-info/licenses/LICENSE +21 -0
meowcat/__init__.py
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"""meowcat — An agent framework built on the biological blueprint of a cat. Depends on pydantic>=2.0 + anyio>=4.0, zero meowagent imports."""
|
|
2
|
+
# (c) 2025-2026 Axonant. MIT License.
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
import importlib
|
|
7
|
+
import pathlib
|
|
8
|
+
import re
|
|
9
|
+
|
|
10
|
+
from meowcat._exports import __all__, _LAZY_MAP, _SUBMODULES
|
|
11
|
+
|
|
12
|
+
# -- Version (eager — tiny and universally accessed) ----------------------
|
|
13
|
+
_pyproject = pathlib.Path(__file__).resolve().parent.parent / "pyproject.toml"
|
|
14
|
+
_match = re.search(r'^version\s*=\s*["\']([^"\']+)["\']',
|
|
15
|
+
_pyproject.read_text(encoding="utf-8"), re.MULTILINE)
|
|
16
|
+
__version__ = _match.group(1) if _match else "0.0.0"
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def __getattr__(name: str):
|
|
20
|
+
"""PEP 562 lazy import — only loads a module on first access.
|
|
21
|
+
|
|
22
|
+
``import meowcat`` costs ~2 ms instead of ~80 ms because nothing
|
|
23
|
+
beyond ``_exports.py`` + ``__init__.py`` is imported eagerly.
|
|
24
|
+
"""
|
|
25
|
+
# Submodule access: meowcat.anatomy, meowcat.biology, meowcat.organ_roles
|
|
26
|
+
if name in _SUBMODULES:
|
|
27
|
+
module = importlib.import_module(f"meowcat.{name}")
|
|
28
|
+
globals()[name] = module
|
|
29
|
+
return module
|
|
30
|
+
|
|
31
|
+
# Named symbol access: meowcat.CatBase, meowcat.Nervous, etc.
|
|
32
|
+
entry = _LAZY_MAP.get(name)
|
|
33
|
+
if entry is not None:
|
|
34
|
+
mod_path, attr = entry
|
|
35
|
+
module = importlib.import_module(mod_path)
|
|
36
|
+
value = getattr(module, attr)
|
|
37
|
+
globals()[name] = value
|
|
38
|
+
return value
|
|
39
|
+
|
|
40
|
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
meowcat/__main__.py
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"""python -m meowcat new <name> -- cat project scaffolding.
|
|
2
|
+
|
|
3
|
+
Comparable to Flask ``flask new`` / FastAPI ``fastapi new`` -- minimal.
|
|
4
|
+
"""
|
|
5
|
+
# (c) 2025-2026 Axonant. MIT License.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
import sys
|
|
11
|
+
from pathlib import Path
|
|
12
|
+
|
|
13
|
+
TEMPLATES: dict[str, str] = {
|
|
14
|
+
"cat.py": '''"""{{name}} -- your custom cat."""
|
|
15
|
+
from meowcat import Colony
|
|
16
|
+
from meowcat.defaults import create_cat
|
|
17
|
+
from meowcat.defaults.stores import InMemorySharedStore
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class EchoCerebrum:
|
|
21
|
+
name = "echo_cerebrum"
|
|
22
|
+
|
|
23
|
+
async def generate(self, prompt, system_prompt=None, temperature=0.7, max_tokens=None):
|
|
24
|
+
return f"[Echo] Received: {prompt[:200]}"
|
|
25
|
+
|
|
26
|
+
async def stream_generate(self, prompt, system_prompt=None, temperature=0.7, max_tokens=None):
|
|
27
|
+
yield f"[Echo] {prompt[:200]}"
|
|
28
|
+
|
|
29
|
+
def reload_config(self):
|
|
30
|
+
pass
|
|
31
|
+
|
|
32
|
+
def diagnose(self):
|
|
33
|
+
return {"echo": True}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
async def main() -> None:
|
|
37
|
+
colony = Colony("{{name}}-colony", storage=InMemorySharedStore())
|
|
38
|
+
cat = create_cat("{{name}}", container=colony, cerebrum=EchoCerebrum())
|
|
39
|
+
await cat.start()
|
|
40
|
+
result = await cat.run_loop("conversation", message="Hello!")
|
|
41
|
+
print(result)
|
|
42
|
+
await cat.shutdown()
|
|
43
|
+
''',
|
|
44
|
+
"main.py": '''"""{{name}} entry point."""
|
|
45
|
+
import asyncio
|
|
46
|
+
from cat import main
|
|
47
|
+
|
|
48
|
+
if __name__ == "__main__":
|
|
49
|
+
asyncio.run(main())
|
|
50
|
+
''',
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def new_project(name: str, target_dir: Path | None = None) -> Path:
|
|
55
|
+
"""Generate meowcat skeleton project."""
|
|
56
|
+
dir_ = (target_dir or Path.cwd()) / name
|
|
57
|
+
dir_.mkdir(parents=True, exist_ok=True)
|
|
58
|
+
|
|
59
|
+
for filename, template in TEMPLATES.items():
|
|
60
|
+
content = template.replace("{{name}}", name)
|
|
61
|
+
(dir_ / filename).write_text(content)
|
|
62
|
+
|
|
63
|
+
print(f"Created {dir_}/")
|
|
64
|
+
print(f" {name}/cat.py")
|
|
65
|
+
print(f" {name}/main.py")
|
|
66
|
+
print(f"\ncd {name} && python main.py")
|
|
67
|
+
return dir_
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def main() -> None:
|
|
71
|
+
"""python -m meowcat CLI entry point."""
|
|
72
|
+
if len(sys.argv) < 3 or sys.argv[1] != "new":
|
|
73
|
+
print("Usage: python -m meowcat new <project-name>")
|
|
74
|
+
print("Example: python -m meowcat new my-cat")
|
|
75
|
+
sys.exit(1)
|
|
76
|
+
|
|
77
|
+
name = sys.argv[2]
|
|
78
|
+
new_project(name)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
if __name__ == "__main__":
|
|
82
|
+
main()
|