@yahyahammad/venastine 0.2.0 → 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.
- package/.env.example +9 -4
- package/CONFIG_ARCHITECTURE.md +2030 -0
- package/LICENSE +201 -201
- package/NOTICE +1 -1
- package/README.md +1034 -895
- package/agents/builtin/build.md +73 -0
- package/agents/builtin/compactor.md +75 -75
- package/agents/builtin/explore.md +77 -77
- package/agents/builtin/general.md +80 -0
- package/agents/builtin/pipeline-reviewer.md +100 -100
- package/agents/builtin/plan.md +106 -88
- package/agents/builtin/review.md +74 -74
- package/agents/builtin/test.md +65 -0
- package/agents/builtin/writer.md +67 -0
- package/agents/manager.py +68 -2
- package/agents/subagent_tool.py +472 -238
- package/agents/tui_commands.py +238 -151
- package/bin/venastine.mjs +150 -4
- package/bin/venastine.py +71 -0
- package/cli_commands.py +838 -0
- package/config.py +95 -1198
- package/config.yaml +1103 -0
- package/config_edit.py +1301 -0
- package/config_schema.py +971 -0
- package/config_update.py +749 -0
- package/core/agent_activity.py +256 -118
- package/core/ansi.py +452 -0
- package/core/approval.py +137 -115
- package/core/call_view.py +364 -0
- package/core/cancel.py +121 -0
- package/core/chatgpt_auth.py +747 -0
- package/core/claims_view.py +107 -0
- package/core/client.py +2715 -1559
- package/core/commands.py +460 -0
- package/core/compaction.py +1735 -971
- package/core/config_loader.py +1982 -1563
- package/core/connect.py +686 -0
- package/core/events.py +123 -61
- package/core/file_mentions.py +280 -0
- package/core/interaction.py +411 -328
- package/core/line_pattern.py +128 -0
- package/core/loop.py +2566 -1490
- package/core/memory.py +482 -370
- package/core/pipeline_models.py +190 -176
- package/core/provider_errors.py +234 -0
- package/core/reasoning/authorization.py +130 -130
- package/core/reasoning/base.py +219 -219
- package/core/reasoning/confidence_scoring.py +484 -468
- package/core/reasoning/events.py +149 -149
- package/core/reasoning/json_retry.py +19 -1
- package/core/reasoning/orchestrator.py +1561 -1382
- package/core/reasoning/output_writer.py +345 -286
- package/core/reasoning/payload_validation.py +524 -398
- package/core/reasoning/pipeline_storage.py +88 -22
- package/core/reasoning/review.py +659 -615
- package/core/reasoning/scholar.py +458 -434
- package/core/reasoning/source_corpus.py +433 -327
- package/core/reasoning/source_scoring.py +855 -855
- package/core/replay.py +315 -183
- package/core/session.py +36 -12
- package/core/session_view.py +259 -0
- package/core/session_wake.py +259 -0
- package/core/shell_sessions.py +1553 -0
- package/core/workspace_trust.py +1 -1
- package/credentials.py +148 -20
- package/database.py +333 -252
- package/{PRIVACY.md → docs/PRIVACY.md} +78 -66
- package/docs/SECURITY.md +108 -0
- package/docs/THIRD_PARTY_NOTICES.md +148 -0
- package/env_secrets.py +50 -9
- package/json_store.py +343 -123
- package/logging_setup.py +295 -185
- package/main.py +3433 -1961
- package/mcp_client/client.py +733 -499
- package/mcp_client/config.py +126 -21
- package/mcp_client/registration.py +343 -182
- package/memories/manager.py +147 -132
- package/memories/tui_commands.py +319 -244
- package/package.json +303 -73
- package/project_init/config_files.py +282 -278
- package/project_init/generator.py +728 -564
- package/project_init/manifest.py +18 -6
- package/project_init/tui_commands.py +147 -144
- package/prompts/critic_pass.md +24 -24
- package/prompts/revalidate.md +25 -25
- package/prompts/revise.md +2 -0
- package/prompts/source_grounding.md +66 -66
- package/prompts/system_prompts.py +316 -262
- package/providers.json.example +4 -2
- package/pyproject.toml +149 -100
- package/requirements.txt +295 -72
- package/safety/policy_enforcement.py +1082 -746
- package/security/askpass.py +419 -0
- package/security/capability.py +207 -177
- package/security/confine.py +484 -0
- package/security/hosted.py +182 -0
- package/security/permissions.py +237 -190
- package/security/posture.py +124 -12
- package/security/protected_paths.py +501 -309
- package/security/sandbox.py +4108 -985
- package/security/secrets.py +855 -0
- package/skills/builtin/math/formal-specification.md +67 -67
- package/skills/builtin/math/numerical-methods.md +66 -66
- package/skills/builtin/research/experiment-design.md +62 -62
- package/skills/builtin/research/reproducibility.md +55 -55
- package/skills/builtin/research/source-evaluation.md +70 -70
- package/skills/builtin/research/statistical-inference.md +63 -63
- package/skills/builtin/research/technical-writing.md +59 -59
- package/skills/builtin/software/code-review.md +61 -61
- package/skills/builtin/software/debugging.md +61 -61
- package/skills/builtin/software/test-design.md +67 -67
- package/skills/tui_commands.py +110 -111
- package/storage.py +1338 -1005
- package/tools/base.py +161 -1
- package/tools/builtin/_math_common.py +667 -377
- package/tools/builtin/_net_common.py +225 -19
- package/tools/builtin/arxiv.py +497 -39
- package/tools/builtin/ask_user.py +231 -213
- package/tools/builtin/discrete_math.py +35 -4
- package/tools/builtin/fetch_url.py +371 -153
- package/tools/builtin/file_ops.py +720 -412
- package/tools/builtin/geometry.py +48 -12
- package/tools/builtin/get_time.py +2 -2
- package/tools/builtin/linear_algebra.py +66 -23
- package/tools/builtin/load_skill.py +76 -66
- package/tools/builtin/logic.py +171 -12
- package/tools/builtin/pin.py +227 -193
- package/tools/builtin/probability_stats.py +12 -16
- package/tools/builtin/project_docs.py +464 -405
- package/tools/builtin/remember.py +175 -158
- package/tools/builtin/shell.py +980 -461
- package/tools/builtin/shell_sessions.py +613 -0
- package/tools/builtin/symbolic_math.py +80 -10
- package/tools/builtin/todo.py +149 -147
- package/tools/builtin/web_search.py +191 -13
- package/tools/context.py +159 -136
- package/tools/isolation.py +107 -34
- package/tools/registry.py +1242 -925
- package/tui/app.py +8318 -4100
- package/tui/app.tcss +747 -556
- package/tui/commands.py +26 -170
- package/tui/diffs.py +34 -13
- package/tui/history.py +128 -128
- package/tui/hosted_driver.py +102 -0
- package/tui/markdown.py +1329 -1279
- package/tui/meters.py +364 -268
- package/tui/ravens.py +146 -146
- package/tui/screens.py +1255 -943
- package/tui/themes.py +599 -559
- package/tui/widgets.py +3813 -2332
- package/SECURITY.md +0 -88
- package/THIRD_PARTY_NOTICES.md +0 -100
package/skills/tui_commands.py
CHANGED
|
@@ -1,111 +1,110 @@
|
|
|
1
|
-
"""
|
|
2
|
-
skills/tui_commands.py
|
|
3
|
-
|
|
4
|
-
ROADMAP_v2 §19, D7: `/skill` registers into §16's slash registry. The
|
|
5
|
-
shell hosts the command; this section owns it -- the same
|
|
6
|
-
mechanism-vs-policy split tools/registry.py uses for tools and
|
|
7
|
-
agents/tui_commands.py uses for /agent.
|
|
8
|
-
|
|
9
|
-
Handlers receive the app object from tui.commands.dispatch(); this module
|
|
10
|
-
deliberately does NOT import tui.app, so app.py can import it without a
|
|
11
|
-
cycle.
|
|
12
|
-
|
|
13
|
-
The app owns `active_skills` (K5: session-scoped, unpersisted, matching
|
|
14
|
-
/agent rather than /goal). This module reads and replaces it through the
|
|
15
|
-
manager, which holds no state of its own (K3).
|
|
16
|
-
"""
|
|
17
|
-
|
|
18
|
-
from agents.manager import manager as agents
|
|
19
|
-
from skills.manager import manager as skills
|
|
20
|
-
from tui.commands import
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
app.
|
|
49
|
-
|
|
50
|
-
+
|
|
51
|
-
+ "\
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
app.
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
app.
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
f"
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
"
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
#
|
|
96
|
-
#
|
|
97
|
-
#
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
f"{'
|
|
103
|
-
"
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
"[name|off <name>|clear]"))
|
|
1
|
+
"""
|
|
2
|
+
skills/tui_commands.py
|
|
3
|
+
|
|
4
|
+
ROADMAP_v2 §19, D7: `/skill` registers into §16's slash registry. The
|
|
5
|
+
shell hosts the command; this section owns it -- the same
|
|
6
|
+
mechanism-vs-policy split tools/registry.py uses for tools and
|
|
7
|
+
agents/tui_commands.py uses for /agent.
|
|
8
|
+
|
|
9
|
+
Handlers receive the app object from tui.commands.dispatch(); this module
|
|
10
|
+
deliberately does NOT import tui.app, so app.py can import it without a
|
|
11
|
+
cycle.
|
|
12
|
+
|
|
13
|
+
The app owns `active_skills` (K5: session-scoped, unpersisted, matching
|
|
14
|
+
/agent rather than /goal). This module reads and replaces it through the
|
|
15
|
+
manager, which holds no state of its own (K3).
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
from agents.manager import manager as agents
|
|
19
|
+
from skills.manager import manager as skills
|
|
20
|
+
from tui.commands import bind
|
|
21
|
+
from tui.commands import registry as commands
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def _current_context(app):
|
|
25
|
+
"""The ToolContext the NEXT turn will actually run under.
|
|
26
|
+
|
|
27
|
+
The precondition check has to use the same context the loop will, or
|
|
28
|
+
/skill reports one thing and the turn enforces another -- which is the
|
|
29
|
+
divergence the check exists to prevent in the first place.
|
|
30
|
+
"""
|
|
31
|
+
if app.active_agent is None:
|
|
32
|
+
return None
|
|
33
|
+
return agents.active_context(app.active_agent)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def _list(app) -> None:
|
|
37
|
+
grouped = skills.by_category()
|
|
38
|
+
if not grouped:
|
|
39
|
+
app._transcript.write_system("No skills discovered.")
|
|
40
|
+
return
|
|
41
|
+
lines = []
|
|
42
|
+
for category in sorted(grouped):
|
|
43
|
+
if category:
|
|
44
|
+
lines.append(f" [{category}]")
|
|
45
|
+
for skill in grouped[category]:
|
|
46
|
+
mark = "*" if skill.name in app.active_skills else "-"
|
|
47
|
+
lines.append(f" {mark} {skill.name}: {skill.description}")
|
|
48
|
+
active = ", ".join(app.active_skills) or "none"
|
|
49
|
+
app._transcript.write_system(
|
|
50
|
+
"Skills (* = active):\n" + "\n".join(lines)
|
|
51
|
+
+ f"\nActive: {active}."
|
|
52
|
+
+ "\n/skill <name> to activate, /skill off <name>, /skill clear."
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def _cmd_skill(app, args: str) -> None:
|
|
57
|
+
"""Activate a skill for this session: its full body is pinned into
|
|
58
|
+
every subsequent turn's system prompt until deactivated (K1)."""
|
|
59
|
+
args = (args or "").strip()
|
|
60
|
+
if not args:
|
|
61
|
+
_list(app)
|
|
62
|
+
return
|
|
63
|
+
|
|
64
|
+
if args == "clear":
|
|
65
|
+
app.active_skills = []
|
|
66
|
+
app._transcript.write_system("All skills deactivated.")
|
|
67
|
+
return
|
|
68
|
+
|
|
69
|
+
if args.startswith("off "):
|
|
70
|
+
name = args[4:].strip()
|
|
71
|
+
if name not in app.active_skills:
|
|
72
|
+
app._transcript.write_error(f"{name!r} is not active.")
|
|
73
|
+
return
|
|
74
|
+
app.active_skills = skills.deactivate(name, app.active_skills)
|
|
75
|
+
app._transcript.write_system(f"Deactivated {name}.")
|
|
76
|
+
return
|
|
77
|
+
|
|
78
|
+
skill = skills.get(args)
|
|
79
|
+
if skill is None:
|
|
80
|
+
app._transcript.write_error(
|
|
81
|
+
f"Unknown skill {args!r}. "
|
|
82
|
+
f"Available: {', '.join(skills.names()) or 'none'}.")
|
|
83
|
+
return
|
|
84
|
+
|
|
85
|
+
already = args in app.active_skills
|
|
86
|
+
app.active_skills = skills.activate(args, app.active_skills)
|
|
87
|
+
if already:
|
|
88
|
+
app._transcript.write_system(f"{skill.name} is already active.")
|
|
89
|
+
return
|
|
90
|
+
|
|
91
|
+
app._transcript.write_system(
|
|
92
|
+
f"Activated {skill.name} — {skill.description}. "
|
|
93
|
+
"Its full instructions now apply to every turn until /skill off.")
|
|
94
|
+
|
|
95
|
+
# K2: report, do not refuse. A skill is often useful without an
|
|
96
|
+
# optional tool, and a hard failure here would make a restrictive agent
|
|
97
|
+
# silently un-pairable with half the catalog. Saying it now beats the
|
|
98
|
+
# model discovering it mid-turn as a denied call.
|
|
99
|
+
missing = skills.missing_tools(skill, _current_context(app))
|
|
100
|
+
if missing:
|
|
101
|
+
app._transcript.write_system(
|
|
102
|
+
f"Note: {skill.name} expects {', '.join(missing)}, which "
|
|
103
|
+
f"{'is' if len(missing) == 1 else 'are'} not available in this "
|
|
104
|
+
"session. The skill is active; those steps will not be.")
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
def register_skill_commands() -> None:
|
|
108
|
+
"""Idempotent -- registering by name overwrites, matching §16's
|
|
109
|
+
register_builtin_commands() and §18's register_agent_commands()."""
|
|
110
|
+
commands.register(bind("skill", _cmd_skill))
|