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.
Files changed (116) hide show
  1. meowcat/__init__.py +40 -0
  2. meowcat/__main__.py +82 -0
  3. meowcat/_exports.py +584 -0
  4. meowcat/adapters/__init__.py +62 -0
  5. meowcat/adapters/base.py +106 -0
  6. meowcat/adapters/brain.py +467 -0
  7. meowcat/adapters/sense.py +142 -0
  8. meowcat/adapters/voice.py +44 -0
  9. meowcat/anatomy.py +139 -0
  10. meowcat/assembly.py +949 -0
  11. meowcat/biology/__init__.py +491 -0
  12. meowcat/biology/active_growth.py +368 -0
  13. meowcat/biology/active_growth_pack.py +83 -0
  14. meowcat/biology/cat_self.py +676 -0
  15. meowcat/biology/cortex.py +288 -0
  16. meowcat/biology/fusion_cycle.py +112 -0
  17. meowcat/biology/growth.py +213 -0
  18. meowcat/biology/metacognition.py +187 -0
  19. meowcat/biology/pineal_gland.py +435 -0
  20. meowcat/biology/roles.py +213 -0
  21. meowcat/biology/scribble_pad.py +209 -0
  22. meowcat/chain.py +214 -0
  23. meowcat/cli/__init__.py +30 -0
  24. meowcat/cli/app.py +80 -0
  25. meowcat/cli/commands.py +379 -0
  26. meowcat/cli/i18n.py +144 -0
  27. meowcat/cli/locales/en.json +80 -0
  28. meowcat/cli/locales/zh.json +80 -0
  29. meowcat/cli/router.py +152 -0
  30. meowcat/cli/theme.py +114 -0
  31. meowcat/colony/__init__.py +976 -0
  32. meowcat/colony/config.py +34 -0
  33. meowcat/colony/federation.py +236 -0
  34. meowcat/colony/memory.py +210 -0
  35. meowcat/colony/registry.py +188 -0
  36. meowcat/colony/rules.py +58 -0
  37. meowcat/colony_transports.py +396 -0
  38. meowcat/constants.py +76 -0
  39. meowcat/coordination.py +213 -0
  40. meowcat/defaults/__init__.py +110 -0
  41. meowcat/defaults/factory.py +323 -0
  42. meowcat/defaults/organs.py +1057 -0
  43. meowcat/defaults/presets.py +290 -0
  44. meowcat/defaults/renovated.py +974 -0
  45. meowcat/defaults/stages.py +110 -0
  46. meowcat/defaults/stores.py +177 -0
  47. meowcat/diagnose.py +209 -0
  48. meowcat/errors.py +189 -0
  49. meowcat/events.py +381 -0
  50. meowcat/events_payloads.py +296 -0
  51. meowcat/examples/01_organ_host_only.py +50 -0
  52. meowcat/examples/02_wiring_validation.py +44 -0
  53. meowcat/examples/03_event_bus_only.py +41 -0
  54. meowcat/examples/04_custom_cat.py +81 -0
  55. meowcat/examples/05_minimal_chat_cat.py +117 -0
  56. meowcat/examples/06_custom_organ.py +62 -0
  57. meowcat/examples/07_custom_organ.py +134 -0
  58. meowcat/examples/__init__.py +8 -0
  59. meowcat/gateway/__init__.py +117 -0
  60. meowcat/gateway/protocol.py +109 -0
  61. meowcat/host.py +112 -0
  62. meowcat/inject.py +129 -0
  63. meowcat/log.py +90 -0
  64. meowcat/loops.py +462 -0
  65. meowcat/middleware.py +153 -0
  66. meowcat/models.py +368 -0
  67. meowcat/nervous.py +484 -0
  68. meowcat/organ_base.py +110 -0
  69. meowcat/organ_roles.py +67 -0
  70. meowcat/path.py +263 -0
  71. meowcat/perception.py +125 -0
  72. meowcat/pipeline.py +54 -0
  73. meowcat/pluggable.py +157 -0
  74. meowcat/plus/__init__.py +42 -0
  75. meowcat/plus/browser.py +251 -0
  76. meowcat/plus/chroma_store.py +197 -0
  77. meowcat/plus/crystallizer.py +227 -0
  78. meowcat/plus/gateway/__init__.py +27 -0
  79. meowcat/plus/gateway/cli_adapter.py +136 -0
  80. meowcat/plus/gateway/http_adapter.py +184 -0
  81. meowcat/plus/gateway/ipc_adapter.py +144 -0
  82. meowcat/plus/gateway/webhook_adapter.py +183 -0
  83. meowcat/plus/gateway/ws_adapter.py +274 -0
  84. meowcat/plus/mcp_client.py +351 -0
  85. meowcat/plus/skill_loader.py +214 -0
  86. meowcat/plus/tools/__init__.py +22 -0
  87. meowcat/plus/tools/command.py +75 -0
  88. meowcat/plus/tools/file_ops.py +127 -0
  89. meowcat/plus/tools/http_client.py +42 -0
  90. meowcat/protocols.py +263 -0
  91. meowcat/protocols_brain.py +359 -0
  92. meowcat/protocols_sense.py +108 -0
  93. meowcat/protocols_storage.py +131 -0
  94. meowcat/protocols_voice.py +68 -0
  95. meowcat/py.typed +0 -0
  96. meowcat/reflex.py +307 -0
  97. meowcat/storage/__init__.py +69 -0
  98. meowcat/storage/jsonl_l6_store.py +87 -0
  99. meowcat/storage/sqlite_graph_store.py +76 -0
  100. meowcat/storage/vector_store.py +209 -0
  101. meowcat/telemetry.py +193 -0
  102. meowcat/testing.py +22 -0
  103. meowcat/tools/__init__.py +64 -0
  104. meowcat/tools/matcher.py +167 -0
  105. meowcat/tools/paws.py +173 -0
  106. meowcat/tools/skill.py +189 -0
  107. meowcat/tools/tool.py +220 -0
  108. meowcat/utils/__init__.py +14 -0
  109. meowcat/utils/http.py +98 -0
  110. meowcat/wiring.py +194 -0
  111. meowcat/worker/__init__.py +288 -0
  112. meowcat/worker/scheduler.py +175 -0
  113. meowcat-1.2.35.dist-info/METADATA +17 -0
  114. meowcat-1.2.35.dist-info/RECORD +116 -0
  115. meowcat-1.2.35.dist-info/WHEEL +4 -0
  116. 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()