@yahyahammad/venastine 0.1.0 → 0.3.8

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 (130) hide show
  1. package/.env.example +19 -14
  2. package/CONFIG_ARCHITECTURE.md +2002 -0
  3. package/NOTICE +1 -1
  4. package/README.md +249 -93
  5. package/agents/builtin/build.md +73 -0
  6. package/agents/builtin/general.md +80 -0
  7. package/agents/builtin/plan.md +23 -5
  8. package/agents/builtin/test.md +65 -0
  9. package/agents/builtin/writer.md +67 -0
  10. package/agents/manager.py +261 -195
  11. package/agents/subagent_tool.py +280 -23
  12. package/agents/tui_commands.py +31 -21
  13. package/bin/venastine.mjs +528 -382
  14. package/bin/venastine.py +71 -0
  15. package/cli_commands.py +835 -0
  16. package/config.py +95 -1198
  17. package/config.yaml +1090 -0
  18. package/config_edit.py +1301 -0
  19. package/config_schema.py +966 -0
  20. package/config_update.py +749 -0
  21. package/core/agent_activity.py +256 -0
  22. package/core/ansi.py +452 -0
  23. package/core/approval.py +27 -5
  24. package/core/call_view.py +364 -0
  25. package/core/cancel.py +121 -0
  26. package/core/chatgpt_auth.py +747 -0
  27. package/core/claims_view.py +107 -0
  28. package/core/client.py +1249 -82
  29. package/core/commands.py +454 -0
  30. package/core/compaction.py +1735 -959
  31. package/core/config_loader.py +516 -97
  32. package/core/connect.py +686 -0
  33. package/core/events.py +68 -6
  34. package/core/file_mentions.py +280 -0
  35. package/core/interaction.py +87 -4
  36. package/core/line_pattern.py +128 -0
  37. package/core/loop.py +2566 -1353
  38. package/core/memory.py +482 -370
  39. package/core/pipeline_models.py +23 -9
  40. package/core/provider_errors.py +234 -0
  41. package/core/reasoning/confidence_scoring.py +70 -54
  42. package/core/reasoning/json_retry.py +19 -1
  43. package/core/reasoning/orchestrator.py +232 -53
  44. package/core/reasoning/output_writer.py +90 -31
  45. package/core/reasoning/payload_validation.py +133 -7
  46. package/core/reasoning/pipeline_storage.py +427 -361
  47. package/core/reasoning/review.py +659 -615
  48. package/core/reasoning/scholar.py +38 -14
  49. package/core/reasoning/source_corpus.py +110 -4
  50. package/core/replay.py +315 -167
  51. package/core/session.py +36 -12
  52. package/core/session_view.py +259 -0
  53. package/core/session_wake.py +259 -0
  54. package/core/shell_sessions.py +1553 -0
  55. package/core/workspace_trust.py +1 -1
  56. package/credentials.py +308 -180
  57. package/database.py +82 -1
  58. package/{PRIVACY.md → docs/PRIVACY.md} +19 -7
  59. package/docs/SECURITY.md +108 -0
  60. package/docs/THIRD_PARTY_NOTICES.md +148 -0
  61. package/env_secrets.py +118 -77
  62. package/json_store.py +236 -16
  63. package/logging_setup.py +121 -11
  64. package/main.py +1672 -198
  65. package/mcp_client/client.py +257 -23
  66. package/mcp_client/config.py +484 -379
  67. package/mcp_client/registration.py +163 -2
  68. package/memories/manager.py +15 -0
  69. package/memories/tui_commands.py +21 -14
  70. package/package.json +303 -73
  71. package/project_init/config_files.py +4 -0
  72. package/project_init/generator.py +201 -37
  73. package/project_init/manifest.py +418 -406
  74. package/project_init/tui_commands.py +7 -4
  75. package/prompts/revalidate.md +1 -1
  76. package/prompts/revise.md +17 -15
  77. package/prompts/system_prompts.py +64 -10
  78. package/providers.json.example +94 -92
  79. package/pyproject.toml +149 -100
  80. package/requirements.txt +252 -29
  81. package/safety/policy_enforcement.py +1082 -682
  82. package/security/askpass.py +419 -0
  83. package/security/capability.py +37 -7
  84. package/security/confine.py +484 -0
  85. package/security/hosted.py +182 -0
  86. package/security/permissions.py +54 -7
  87. package/security/posture.py +124 -12
  88. package/security/protected_paths.py +198 -6
  89. package/security/sandbox.py +3262 -139
  90. package/security/secrets.py +855 -0
  91. package/skills/tui_commands.py +3 -4
  92. package/storage.py +1338 -1005
  93. package/tools/base.py +465 -305
  94. package/tools/builtin/_math_common.py +306 -16
  95. package/tools/builtin/_net_common.py +267 -61
  96. package/tools/builtin/arxiv.py +681 -223
  97. package/tools/builtin/ask_user.py +231 -213
  98. package/tools/builtin/discrete_math.py +35 -4
  99. package/tools/builtin/fetch_url.py +239 -21
  100. package/tools/builtin/file_ops.py +341 -33
  101. package/tools/builtin/geometry.py +184 -148
  102. package/tools/builtin/get_time.py +2 -2
  103. package/tools/builtin/linear_algebra.py +66 -23
  104. package/tools/builtin/load_skill.py +10 -0
  105. package/tools/builtin/logic.py +171 -12
  106. package/tools/builtin/pin.py +46 -12
  107. package/tools/builtin/probability_stats.py +224 -228
  108. package/tools/builtin/project_docs.py +80 -21
  109. package/tools/builtin/remember.py +21 -4
  110. package/tools/builtin/shell.py +586 -67
  111. package/tools/builtin/shell_sessions.py +613 -0
  112. package/tools/builtin/symbolic_math.py +80 -10
  113. package/tools/builtin/todo.py +5 -3
  114. package/tools/builtin/web_search.py +329 -151
  115. package/tools/context.py +23 -0
  116. package/tools/isolation.py +387 -314
  117. package/tools/registry.py +374 -29
  118. package/tui/app.py +5281 -397
  119. package/tui/app.tcss +290 -9
  120. package/tui/commands.py +26 -61
  121. package/tui/diffs.py +286 -265
  122. package/tui/history.py +128 -0
  123. package/tui/hosted_driver.py +102 -0
  124. package/tui/markdown.py +1329 -0
  125. package/tui/meters.py +364 -0
  126. package/tui/screens.py +346 -92
  127. package/tui/themes.py +599 -366
  128. package/tui/widgets.py +2673 -116
  129. package/SECURITY.md +0 -88
  130. package/THIRD_PARTY_NOTICES.md +0 -100
@@ -0,0 +1,71 @@
1
+ #!/usr/bin/env python3
2
+ """Launch a GitHub installation using its already-provisioned Python environment.
3
+
4
+ This is stdlib-only and never installs packages. Like the npm launcher, it
5
+ preserves cwd, arguments, and stdio; config_update owns settings migration.
6
+ """
7
+
8
+ import json
9
+ import os
10
+ import signal
11
+ import subprocess # nosec B404 - launch the installed interpreter without a shell
12
+ import sys
13
+ from pathlib import Path
14
+
15
+
16
+ def child_env(cwd, home, inherited):
17
+ env = dict(inherited)
18
+ shared = home / ".config" / "venastine"
19
+ if not env.get("AGENT_PROVIDERS_FILE") and not (cwd / "providers.json").exists():
20
+ if (shared / "providers.json").exists():
21
+ env["AGENT_PROVIDERS_FILE"] = str(shared / "providers.json")
22
+ if not env.get("APP_DB_PATH") and not (cwd / "app.db").exists():
23
+ env["APP_DB_PATH"] = str(shared / "app.db")
24
+ if not env.get("AGENT_LOG_FILE"):
25
+ env["AGENT_LOG_FILE"] = str(shared / "logs" / "app.log")
26
+ return env
27
+
28
+
29
+ def config_history(python, root, *args):
30
+ try:
31
+ subprocess.run( # nosec B603 - installed interpreter and fixed script, no shell
32
+ [python, str(root / "config_update.py"), *args], cwd=root, check=False)
33
+ except OSError as error:
34
+ print(f"Config history could not be updated: {error}", file=sys.stderr)
35
+
36
+
37
+ def main(argv=None):
38
+ argv = sys.argv[1:] if argv is None else argv
39
+ root = Path(__file__).resolve().parent.parent
40
+ try:
41
+ runtime = json.loads((root / ".venastine-runtime.json").read_text(encoding="utf-8"))
42
+ python = runtime["python"]
43
+ if not Path(python).is_file():
44
+ raise ValueError("The installed Python environment is missing; rerun the installer")
45
+ except (OSError, ValueError, KeyError) as error:
46
+ print(f"Cannot launch this GitHub installation: {error}", file=sys.stderr)
47
+ return 1
48
+ env = child_env(Path.cwd(), Path.home(), os.environ)
49
+ if argv == ["--venastine-doctor"]:
50
+ version = json.loads((root / "package.json").read_text(encoding="utf-8"))["version"]
51
+ print(f"venastine {version}\n commit: {runtime['commit']}\n package root: {root}\n python: {python}\n cwd: {Path.cwd()}")
52
+ for name in ("AGENT_PROVIDERS_FILE", "APP_DB_PATH", "AGENT_LOG_FILE"):
53
+ print(f" {name}: {env.get(name, '(local/default)')}")
54
+ return 0
55
+ config_history(python, root)
56
+ # The child shares the terminal and receives Ctrl+C itself. Keep the
57
+ # launcher alive to collect its status and mirror settings after exit.
58
+ # A caught handler is reset on exec; SIG_IGN would leak into the child.
59
+ old_handler = signal.signal(signal.SIGINT, lambda *_: None)
60
+ try:
61
+ child = subprocess.Popen( # nosec B603 - installed interpreter, argv forwarded without a shell
62
+ [python, str(root / "main.py"), *argv], env=env)
63
+ status = child.wait()
64
+ return 128 - status if status < 0 else status
65
+ finally:
66
+ signal.signal(signal.SIGINT, old_handler)
67
+ config_history(python, root, "--mirror")
68
+
69
+
70
+ if __name__ == "__main__":
71
+ sys.exit(main())