@yahyahammad/venastine 0.3.8 → 0.3.9

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 (128) hide show
  1. package/.env.example +19 -19
  2. package/CONFIG_ARCHITECTURE.md +2030 -2002
  3. package/LICENSE +201 -201
  4. package/README.md +1034 -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 +528 -528
  14. package/bin/venastine.py +71 -71
  15. package/cli_commands.py +838 -835
  16. package/config.yaml +13 -0
  17. package/config_edit.py +1301 -1301
  18. package/config_schema.py +971 -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 +2715 -2715
  28. package/core/commands.py +460 -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 +234 -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 +458 -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 +108 -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 +733 -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 +295 -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 +267 -267
  102. package/tools/builtin/arxiv.py +681 -681
  103. package/tools/builtin/fetch_url.py +371 -371
  104. package/tools/builtin/file_ops.py +720 -720
  105. package/tools/builtin/geometry.py +184 -184
  106. package/tools/builtin/load_skill.py +76 -76
  107. package/tools/builtin/pin.py +227 -227
  108. package/tools/builtin/probability_stats.py +224 -224
  109. package/tools/builtin/project_docs.py +464 -464
  110. package/tools/builtin/remember.py +175 -175
  111. package/tools/builtin/shell.py +980 -980
  112. package/tools/builtin/todo.py +149 -149
  113. package/tools/builtin/web_search.py +328 -328
  114. package/tools/context.py +159 -159
  115. package/tools/isolation.py +387 -387
  116. package/tools/registry.py +1242 -1242
  117. package/tui/app.py +8318 -8307
  118. package/tui/app.tcss +747 -739
  119. package/tui/commands.py +26 -26
  120. package/tui/diffs.py +286 -286
  121. package/tui/history.py +128 -128
  122. package/tui/hosted_driver.py +102 -102
  123. package/tui/markdown.py +1329 -1329
  124. package/tui/meters.py +364 -364
  125. package/tui/ravens.py +146 -146
  126. package/tui/screens.py +1255 -1197
  127. package/tui/themes.py +599 -599
  128. package/tui/widgets.py +3813 -3796
package/tui/ravens.py CHANGED
@@ -1,146 +1,146 @@
1
- """
2
- tui/ravens.py
3
-
4
- ROADMAP_v2 §16. The two ravens, and the mapping from loop activity to a
5
- raven state.
6
-
7
- Deliberately data-only: this module owns the art and the state table, and
8
- nothing else. The widgets in tui/widgets.py render it; tui/app.py decides
9
- when the state changes. Keeping the mapping here means adding a tool never
10
- requires touching a widget.
11
-
12
- Why a table rather than a match on tool names inside the app: §17 (MCP)
13
- registers tools at runtime with names nobody has written down yet, and §18
14
- adds subagents. Unknown names resolve to WORKING rather than falling
15
- through to an unchanged raven, so a new tool always animates something.
16
- """
17
-
18
- from dataclasses import dataclass
19
-
20
-
21
- @dataclass(frozen=True)
22
- class RavenState:
23
- key: str
24
- label: str
25
- frames: tuple[str, ...] # cycled when animations are on; frames[0] is static
26
-
27
-
28
- # Three-line art. Each state varies the head/wing so the change is legible
29
- # at a glance in a small corner panel rather than needing the label read.
30
- IDLE = RavenState(
31
- "idle", "idle",
32
- (
33
- " __\n<o )___\n `----'",
34
- " __\n<- )___\n `----'", # blink
35
- ),
36
- )
37
-
38
- THINKING = RavenState(
39
- "thinking", "thinking",
40
- (
41
- " __\n<o )___\n `--^-'",
42
- " __\n<o )___\n `--`-'",
43
- " __\n<o )___\n `--,-'",
44
- ),
45
- )
46
-
47
- SEARCHING = RavenState(
48
- "searching", "searching",
49
- (
50
- " __\n<o )___ o\n `----'",
51
- " __\n<o )___ o\n `----'",
52
- " __\n<o )___ o\n `----'",
53
- ),
54
- )
55
-
56
- READING = RavenState(
57
- "reading", "reading",
58
- (
59
- " __\n<o )___\n `--[]'",
60
- " __\n<- )___\n `--[]'",
61
- ),
62
- )
63
-
64
- EDITING = RavenState(
65
- "editing", "editing",
66
- (
67
- " __\n<o )___\n `--/-'",
68
- " __\n<o )___\n `--\\-'",
69
- ),
70
- )
71
-
72
- RUNNING = RavenState(
73
- "running", "running",
74
- (
75
- " __\n<o )___\n `--$-'",
76
- " __\n<0 )___\n `--$-'",
77
- ),
78
- )
79
-
80
- WAITING = RavenState(
81
- "waiting", "waiting on you",
82
- (
83
- " __\n<? )___\n `----'",
84
- " __\n<! )___\n `----'",
85
- ),
86
- )
87
-
88
- WORKING = RavenState(
89
- "working", "working",
90
- (
91
- " __\n<o )___\n `--*-'",
92
- " __\n<o )___\n `--+-'",
93
- ),
94
- )
95
-
96
- # Tool name -> state. Anything not listed maps to WORKING (see module
97
- # docstring): runtime-registered MCP tools and §18 subagents must animate
98
- # without this table being edited.
99
- TOOL_STATES = {
100
- "web_search": SEARCHING,
101
- "arxiv_search": SEARCHING,
102
- "fetch_url": SEARCHING,
103
- "read": READING,
104
- "load_skill": READING,
105
- "write": EDITING,
106
- "edit": EDITING,
107
- "shell": RUNNING,
108
- }
109
-
110
-
111
- def state_for_tool(tool_name: str) -> RavenState:
112
- return TOOL_STATES.get(tool_name, WORKING)
113
-
114
-
115
- # --- Effort raven -----------------------------------------------------------
116
- # A separate, one-line raven whose plumage reflects the current reasoning
117
- # effort, so the setting is visible rather than remembered. Ordered
118
- # least-to-most. An UNSET level renders as "auto" (the provider's own
119
- # default, which is what effort=None sends); an unknown one renders by
120
- # name with no bar, since its rank is exactly what we don't know.
121
- EFFORT_PLUMAGE = {
122
- "low": "▁",
123
- "medium": "▃",
124
- "high": "▅",
125
- "xhigh": "▇",
126
- "ultra": "▇",
127
- "max": "█",
128
- }
129
-
130
-
131
- def effort_raven(effort: str | None) -> str:
132
- """One-line effort indicator: a small raven plus a plumage bar.
133
-
134
- An unknown level keeps its NAME but gets no plumage, rather than
135
- borrowing "low"'s single bar. Levels are discovered at runtime from
136
- the Models API, so a provider reporting one outside this table is a
137
- reachable state -- and drawing it as the least-effort setting
138
- misreports the rank while the comment above promised the neutral
139
- display.
140
- """
141
- if not effort:
142
- return "<o)~ auto"
143
- plumage = EFFORT_PLUMAGE.get(effort)
144
- if plumage is None:
145
- return f"<o)~ {effort}"
146
- return f"<o)~ {plumage * 3} {effort}"
1
+ """
2
+ tui/ravens.py
3
+
4
+ ROADMAP_v2 §16. The two ravens, and the mapping from loop activity to a
5
+ raven state.
6
+
7
+ Deliberately data-only: this module owns the art and the state table, and
8
+ nothing else. The widgets in tui/widgets.py render it; tui/app.py decides
9
+ when the state changes. Keeping the mapping here means adding a tool never
10
+ requires touching a widget.
11
+
12
+ Why a table rather than a match on tool names inside the app: §17 (MCP)
13
+ registers tools at runtime with names nobody has written down yet, and §18
14
+ adds subagents. Unknown names resolve to WORKING rather than falling
15
+ through to an unchanged raven, so a new tool always animates something.
16
+ """
17
+
18
+ from dataclasses import dataclass
19
+
20
+
21
+ @dataclass(frozen=True)
22
+ class RavenState:
23
+ key: str
24
+ label: str
25
+ frames: tuple[str, ...] # cycled when animations are on; frames[0] is static
26
+
27
+
28
+ # Three-line art. Each state varies the head/wing so the change is legible
29
+ # at a glance in a small corner panel rather than needing the label read.
30
+ IDLE = RavenState(
31
+ "idle", "idle",
32
+ (
33
+ " __\n<o )___\n `----'",
34
+ " __\n<- )___\n `----'", # blink
35
+ ),
36
+ )
37
+
38
+ THINKING = RavenState(
39
+ "thinking", "thinking",
40
+ (
41
+ " __\n<o )___\n `--^-'",
42
+ " __\n<o )___\n `--`-'",
43
+ " __\n<o )___\n `--,-'",
44
+ ),
45
+ )
46
+
47
+ SEARCHING = RavenState(
48
+ "searching", "searching",
49
+ (
50
+ " __\n<o )___ o\n `----'",
51
+ " __\n<o )___ o\n `----'",
52
+ " __\n<o )___ o\n `----'",
53
+ ),
54
+ )
55
+
56
+ READING = RavenState(
57
+ "reading", "reading",
58
+ (
59
+ " __\n<o )___\n `--[]'",
60
+ " __\n<- )___\n `--[]'",
61
+ ),
62
+ )
63
+
64
+ EDITING = RavenState(
65
+ "editing", "editing",
66
+ (
67
+ " __\n<o )___\n `--/-'",
68
+ " __\n<o )___\n `--\\-'",
69
+ ),
70
+ )
71
+
72
+ RUNNING = RavenState(
73
+ "running", "running",
74
+ (
75
+ " __\n<o )___\n `--$-'",
76
+ " __\n<0 )___\n `--$-'",
77
+ ),
78
+ )
79
+
80
+ WAITING = RavenState(
81
+ "waiting", "waiting on you",
82
+ (
83
+ " __\n<? )___\n `----'",
84
+ " __\n<! )___\n `----'",
85
+ ),
86
+ )
87
+
88
+ WORKING = RavenState(
89
+ "working", "working",
90
+ (
91
+ " __\n<o )___\n `--*-'",
92
+ " __\n<o )___\n `--+-'",
93
+ ),
94
+ )
95
+
96
+ # Tool name -> state. Anything not listed maps to WORKING (see module
97
+ # docstring): runtime-registered MCP tools and §18 subagents must animate
98
+ # without this table being edited.
99
+ TOOL_STATES = {
100
+ "web_search": SEARCHING,
101
+ "arxiv_search": SEARCHING,
102
+ "fetch_url": SEARCHING,
103
+ "read": READING,
104
+ "load_skill": READING,
105
+ "write": EDITING,
106
+ "edit": EDITING,
107
+ "shell": RUNNING,
108
+ }
109
+
110
+
111
+ def state_for_tool(tool_name: str) -> RavenState:
112
+ return TOOL_STATES.get(tool_name, WORKING)
113
+
114
+
115
+ # --- Effort raven -----------------------------------------------------------
116
+ # A separate, one-line raven whose plumage reflects the current reasoning
117
+ # effort, so the setting is visible rather than remembered. Ordered
118
+ # least-to-most. An UNSET level renders as "auto" (the provider's own
119
+ # default, which is what effort=None sends); an unknown one renders by
120
+ # name with no bar, since its rank is exactly what we don't know.
121
+ EFFORT_PLUMAGE = {
122
+ "low": "▁",
123
+ "medium": "▃",
124
+ "high": "▅",
125
+ "xhigh": "▇",
126
+ "ultra": "▇",
127
+ "max": "█",
128
+ }
129
+
130
+
131
+ def effort_raven(effort: str | None) -> str:
132
+ """One-line effort indicator: a small raven plus a plumage bar.
133
+
134
+ An unknown level keeps its NAME but gets no plumage, rather than
135
+ borrowing "low"'s single bar. Levels are discovered at runtime from
136
+ the Models API, so a provider reporting one outside this table is a
137
+ reachable state -- and drawing it as the least-effort setting
138
+ misreports the rank while the comment above promised the neutral
139
+ display.
140
+ """
141
+ if not effort:
142
+ return "<o)~ auto"
143
+ plumage = EFFORT_PLUMAGE.get(effort)
144
+ if plumage is None:
145
+ return f"<o)~ {effort}"
146
+ return f"<o)~ {plumage * 3} {effort}"