@yahyahammad/venastine 0.3.8 → 0.3.10

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 -19
  2. package/CONFIG_ARCHITECTURE.md +2139 -2002
  3. package/LICENSE +201 -201
  4. package/README.md +1043 -1034
  5. package/agents/builtin/compactor.md +75 -75
  6. package/agents/builtin/explore.md +77 -77
  7. package/agents/builtin/pipeline-reviewer.md +100 -100
  8. package/agents/builtin/plan.md +106 -106
  9. package/agents/builtin/review.md +74 -74
  10. package/agents/manager.py +261 -261
  11. package/agents/subagent_tool.py +472 -472
  12. package/agents/tui_commands.py +238 -146
  13. package/bin/venastine.mjs +584 -528
  14. package/bin/venastine.py +73 -71
  15. package/cli_commands.py +848 -835
  16. package/config.yaml +64 -0
  17. package/config_edit.py +1301 -1301
  18. package/config_schema.py +987 -966
  19. package/config_update.py +749 -749
  20. package/core/agent_activity.py +256 -256
  21. package/core/ansi.py +452 -452
  22. package/core/approval.py +137 -137
  23. package/core/call_view.py +364 -364
  24. package/core/cancel.py +121 -121
  25. package/core/chatgpt_auth.py +747 -747
  26. package/core/claims_view.py +107 -107
  27. package/core/client.py +2756 -2715
  28. package/core/commands.py +464 -454
  29. package/core/compaction.py +1735 -1735
  30. package/core/config_loader.py +1982 -1982
  31. package/core/connect.py +686 -686
  32. package/core/events.py +123 -123
  33. package/core/file_mentions.py +280 -280
  34. package/core/interaction.py +411 -411
  35. package/core/loop.py +2566 -2566
  36. package/core/memory.py +482 -482
  37. package/core/pipeline_models.py +190 -190
  38. package/core/provider_errors.py +274 -234
  39. package/core/reasoning/authorization.py +130 -130
  40. package/core/reasoning/base.py +219 -219
  41. package/core/reasoning/confidence_scoring.py +484 -484
  42. package/core/reasoning/events.py +149 -149
  43. package/core/reasoning/orchestrator.py +1561 -1561
  44. package/core/reasoning/output_writer.py +345 -345
  45. package/core/reasoning/payload_validation.py +524 -524
  46. package/core/reasoning/pipeline_storage.py +427 -427
  47. package/core/reasoning/scholar.py +467 -458
  48. package/core/reasoning/source_corpus.py +433 -433
  49. package/core/reasoning/source_scoring.py +855 -855
  50. package/core/replay.py +315 -315
  51. package/core/shell_sessions.py +1553 -1553
  52. package/credentials.py +307 -307
  53. package/database.py +333 -333
  54. package/docs/PRIVACY.md +78 -78
  55. package/docs/SECURITY.md +114 -108
  56. package/docs/THIRD_PARTY_NOTICES.md +148 -148
  57. package/env_secrets.py +118 -118
  58. package/json_store.py +343 -343
  59. package/logging_setup.py +295 -295
  60. package/main.py +3433 -3433
  61. package/mcp_client/client.py +780 -733
  62. package/mcp_client/config.py +484 -484
  63. package/mcp_client/registration.py +343 -343
  64. package/memories/manager.py +147 -147
  65. package/memories/tui_commands.py +319 -239
  66. package/package.json +303 -303
  67. package/project_init/config_files.py +282 -282
  68. package/project_init/generator.py +728 -728
  69. package/project_init/manifest.py +418 -418
  70. package/project_init/tui_commands.py +147 -147
  71. package/prompts/critic_pass.md +24 -24
  72. package/prompts/revalidate.md +25 -25
  73. package/prompts/revise.md +17 -17
  74. package/prompts/source_grounding.md +66 -66
  75. package/prompts/system_prompts.py +316 -316
  76. package/providers.json.example +94 -94
  77. package/pyproject.toml +149 -149
  78. package/requirements.txt +314 -295
  79. package/safety/policy_enforcement.py +1082 -1082
  80. package/security/askpass.py +419 -419
  81. package/security/capability.py +207 -207
  82. package/security/confine.py +484 -484
  83. package/security/hosted.py +182 -182
  84. package/security/permissions.py +237 -237
  85. package/security/protected_paths.py +501 -501
  86. package/security/sandbox.py +4108 -4108
  87. package/skills/builtin/math/formal-specification.md +67 -67
  88. package/skills/builtin/math/numerical-methods.md +66 -66
  89. package/skills/builtin/research/experiment-design.md +62 -62
  90. package/skills/builtin/research/reproducibility.md +55 -55
  91. package/skills/builtin/research/source-evaluation.md +70 -70
  92. package/skills/builtin/research/statistical-inference.md +63 -63
  93. package/skills/builtin/research/technical-writing.md +59 -59
  94. package/skills/builtin/software/code-review.md +61 -61
  95. package/skills/builtin/software/debugging.md +61 -61
  96. package/skills/builtin/software/test-design.md +67 -67
  97. package/skills/tui_commands.py +110 -110
  98. package/storage.py +1338 -1338
  99. package/tools/base.py +465 -465
  100. package/tools/builtin/_math_common.py +667 -667
  101. package/tools/builtin/_net_common.py +1145 -267
  102. package/tools/builtin/_page_text.py +490 -0
  103. package/tools/builtin/_pdf_text.py +113 -0
  104. package/tools/builtin/arxiv.py +685 -681
  105. package/tools/builtin/fetch_url.py +639 -371
  106. package/tools/builtin/file_ops.py +720 -720
  107. package/tools/builtin/geometry.py +184 -184
  108. package/tools/builtin/load_skill.py +76 -76
  109. package/tools/builtin/pin.py +227 -227
  110. package/tools/builtin/probability_stats.py +224 -224
  111. package/tools/builtin/project_docs.py +464 -464
  112. package/tools/builtin/remember.py +175 -175
  113. package/tools/builtin/shell.py +980 -980
  114. package/tools/builtin/todo.py +149 -149
  115. package/tools/builtin/web_search.py +402 -328
  116. package/tools/context.py +159 -159
  117. package/tools/isolation.py +387 -387
  118. package/tools/registry.py +1252 -1242
  119. package/tui/app.py +8372 -8307
  120. package/tui/app.tcss +754 -739
  121. package/tui/commands.py +26 -26
  122. package/tui/diffs.py +286 -286
  123. package/tui/history.py +128 -128
  124. package/tui/hosted_driver.py +102 -102
  125. package/tui/markdown.py +1329 -1329
  126. package/tui/meters.py +364 -364
  127. package/tui/ravens.py +146 -146
  128. package/tui/screens.py +1255 -1197
  129. package/tui/themes.py +599 -599
  130. package/tui/widgets.py +3861 -3796
package/bin/venastine.py CHANGED
@@ -1,71 +1,73 @@
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())
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
+ # An install from before ROADMAP_v3 §93 recorded no installer, and was pip's.
52
+ print(f"venastine {version}\n commit: {runtime['commit']}\n package root: {root}\n python: {python}\n"
53
+ f" installed by: {runtime.get('installer', 'pip')}\n cwd: {Path.cwd()}")
54
+ for name in ("AGENT_PROVIDERS_FILE", "APP_DB_PATH", "AGENT_LOG_FILE"):
55
+ print(f" {name}: {env.get(name, '(local/default)')}")
56
+ return 0
57
+ config_history(python, root)
58
+ # The child shares the terminal and receives Ctrl+C itself. Keep the
59
+ # launcher alive to collect its status and mirror settings after exit.
60
+ # A caught handler is reset on exec; SIG_IGN would leak into the child.
61
+ old_handler = signal.signal(signal.SIGINT, lambda *_: None)
62
+ try:
63
+ child = subprocess.Popen( # nosec B603 - installed interpreter, argv forwarded without a shell
64
+ [python, str(root / "main.py"), *argv], env=env)
65
+ status = child.wait()
66
+ return 128 - status if status < 0 else status
67
+ finally:
68
+ signal.signal(signal.SIGINT, old_handler)
69
+ config_history(python, root, "--mirror")
70
+
71
+
72
+ if __name__ == "__main__":
73
+ sys.exit(main())