@yahyahammad/venastine 0.2.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.
- package/.env.example +19 -14
- package/CONFIG_ARCHITECTURE.md +2002 -0
- package/NOTICE +1 -1
- package/README.md +233 -94
- package/agents/builtin/build.md +73 -0
- package/agents/builtin/general.md +80 -0
- package/agents/builtin/plan.md +23 -5
- package/agents/builtin/test.md +65 -0
- package/agents/builtin/writer.md +67 -0
- package/agents/manager.py +261 -195
- package/agents/subagent_tool.py +277 -43
- package/agents/tui_commands.py +7 -12
- package/bin/venastine.mjs +528 -382
- package/bin/venastine.py +71 -0
- package/cli_commands.py +835 -0
- package/config.py +95 -1198
- package/config.yaml +1090 -0
- package/config_edit.py +1301 -0
- package/config_schema.py +966 -0
- package/config_update.py +749 -0
- package/core/agent_activity.py +158 -20
- package/core/ansi.py +452 -0
- package/core/approval.py +27 -5
- 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 +1238 -82
- package/core/commands.py +454 -0
- package/core/compaction.py +830 -66
- package/core/config_loader.py +516 -97
- package/core/connect.py +686 -0
- package/core/events.py +68 -6
- package/core/file_mentions.py +280 -0
- package/core/interaction.py +87 -4
- package/core/line_pattern.py +128 -0
- package/core/loop.py +1516 -440
- package/core/memory.py +120 -8
- package/core/pipeline_models.py +23 -9
- package/core/provider_errors.py +234 -0
- package/core/reasoning/confidence_scoring.py +70 -54
- package/core/reasoning/json_retry.py +19 -1
- package/core/reasoning/orchestrator.py +232 -53
- package/core/reasoning/output_writer.py +90 -31
- package/core/reasoning/payload_validation.py +133 -7
- package/core/reasoning/pipeline_storage.py +427 -361
- package/core/reasoning/review.py +659 -615
- package/core/reasoning/scholar.py +38 -14
- package/core/reasoning/source_corpus.py +110 -4
- package/core/replay.py +158 -26
- 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 +308 -180
- package/database.py +82 -1
- package/{PRIVACY.md → docs/PRIVACY.md} +19 -7
- package/docs/SECURITY.md +108 -0
- package/docs/THIRD_PARTY_NOTICES.md +148 -0
- package/env_secrets.py +118 -77
- package/json_store.py +236 -16
- package/logging_setup.py +121 -11
- package/main.py +1671 -199
- package/mcp_client/client.py +257 -23
- package/mcp_client/config.py +484 -379
- package/mcp_client/registration.py +163 -2
- package/memories/manager.py +15 -0
- package/memories/tui_commands.py +7 -12
- package/package.json +234 -4
- package/project_init/config_files.py +4 -0
- package/project_init/generator.py +201 -37
- package/project_init/manifest.py +418 -406
- package/project_init/tui_commands.py +7 -4
- package/prompts/revalidate.md +1 -1
- package/prompts/revise.md +17 -15
- package/prompts/system_prompts.py +64 -10
- package/providers.json.example +94 -92
- package/pyproject.toml +51 -2
- package/requirements.txt +252 -29
- package/safety/policy_enforcement.py +353 -17
- package/security/askpass.py +419 -0
- package/security/capability.py +37 -7
- package/security/confine.py +484 -0
- package/security/hosted.py +182 -0
- package/security/permissions.py +54 -7
- package/security/posture.py +124 -12
- package/security/protected_paths.py +198 -6
- package/security/sandbox.py +3262 -139
- package/security/secrets.py +855 -0
- package/skills/tui_commands.py +3 -4
- package/storage.py +368 -35
- package/tools/base.py +465 -305
- package/tools/builtin/_math_common.py +306 -16
- package/tools/builtin/_net_common.py +267 -61
- package/tools/builtin/arxiv.py +681 -223
- package/tools/builtin/ask_user.py +231 -213
- package/tools/builtin/discrete_math.py +35 -4
- package/tools/builtin/fetch_url.py +239 -21
- package/tools/builtin/file_ops.py +341 -33
- package/tools/builtin/geometry.py +184 -148
- package/tools/builtin/get_time.py +2 -2
- package/tools/builtin/linear_algebra.py +66 -23
- package/tools/builtin/load_skill.py +10 -0
- package/tools/builtin/logic.py +171 -12
- package/tools/builtin/pin.py +46 -12
- package/tools/builtin/probability_stats.py +224 -228
- package/tools/builtin/project_docs.py +80 -21
- package/tools/builtin/remember.py +21 -4
- package/tools/builtin/shell.py +586 -67
- package/tools/builtin/shell_sessions.py +613 -0
- package/tools/builtin/symbolic_math.py +80 -10
- package/tools/builtin/todo.py +5 -3
- package/tools/builtin/web_search.py +329 -151
- package/tools/context.py +23 -0
- package/tools/isolation.py +387 -314
- package/tools/registry.py +347 -30
- package/tui/app.py +4645 -438
- package/tui/app.tcss +185 -2
- package/tui/commands.py +10 -154
- package/tui/diffs.py +286 -265
- package/tui/hosted_driver.py +102 -0
- package/tui/markdown.py +60 -10
- package/tui/meters.py +103 -7
- package/tui/screens.py +346 -92
- package/tui/themes.py +59 -19
- package/tui/widgets.py +1575 -111
- package/SECURITY.md +0 -88
- package/THIRD_PARTY_NOTICES.md +0 -100
package/tui/themes.py
CHANGED
|
@@ -19,10 +19,14 @@ it still resolves, because ctrl+p's command palette can select one of
|
|
|
19
19
|
Textual's own built-in themes and a whitelist here would silently forget
|
|
20
20
|
it.
|
|
21
21
|
|
|
22
|
-
Built on textual.theme.Theme (verified against the
|
|
22
|
+
Built on textual.theme.Theme (verified against the installed textual,
|
|
23
23
|
per D22's rule about not assuming a dependency's API shape). Textual
|
|
24
24
|
derives the full variable set from these anchors, so each theme only
|
|
25
25
|
declares the colours that actually differ.
|
|
26
|
+
|
|
27
|
+
`Theme` gained an `ansi: bool` when the pin moved to 8.2.8, and nothing
|
|
28
|
+
here sets it: these fourteen are RGB palettes, which is the whole
|
|
29
|
+
premise of the contrast floors they are held to.
|
|
26
30
|
"""
|
|
27
31
|
|
|
28
32
|
import logging
|
|
@@ -228,13 +232,13 @@ DIFF_TINT = 0.8
|
|
|
228
232
|
|
|
229
233
|
|
|
230
234
|
#: The eight Theme slots `role_styles` reads. Every one of them but
|
|
231
|
-
#: `primary` is Optional[str] on textual's own Theme, and
|
|
232
|
-
#:
|
|
233
|
-
#: fill it with a vocabulary Rich cannot read: textual-dark has no
|
|
234
|
-
#: `background`, textual-light no `foreground`,
|
|
235
|
-
#: but `ansi_*` names. Reading them raw is what made
|
|
236
|
-
#: textual-dark kill the harness AT MOUNT -- and keep killing
|
|
237
|
-
#: since watch_theme had already remembered the name (batch 64).
|
|
235
|
+
#: `primary` is Optional[str] on textual's own Theme, and four of the
|
|
236
|
+
#: twenty-one built-ins the command palette offers do leave one blank
|
|
237
|
+
#: or fill it with a vocabulary Rich cannot read: textual-dark has no
|
|
238
|
+
#: `background`, textual-light no `foreground`, and ansi-dark and
|
|
239
|
+
#: ansi-light nothing but `ansi_*` names. Reading them raw is what made
|
|
240
|
+
#: selecting textual-dark kill the harness AT MOUNT -- and keep killing
|
|
241
|
+
#: it, since watch_theme had already remembered the name (batch 64).
|
|
238
242
|
_SLOTS = ("primary", "secondary", "accent", "warning", "error",
|
|
239
243
|
"success", "foreground", "background")
|
|
240
244
|
|
|
@@ -252,18 +256,25 @@ _RESOLVED: dict[tuple, dict[str, str]] = {}
|
|
|
252
256
|
def _rich(colour: str) -> str:
|
|
253
257
|
"""Textual's `ansi_*` colour names in Rich's vocabulary.
|
|
254
258
|
|
|
255
|
-
|
|
256
|
-
the terminal's own sixteen, which is the entire point of
|
|
257
|
-
|
|
259
|
+
An ANSI theme fills every slot with `ansi_blue`/`ansi_default` --
|
|
260
|
+
the terminal's own sixteen, which is the entire point of those
|
|
261
|
+
themes -- and Rich's Style.parse does not know the prefix. It knows
|
|
258
262
|
the names underneath it: textual.color.ANSI_COLORS is exactly the
|
|
259
263
|
ANSI subset of rich.color.ANSI_COLOR_NAMES (verified by set
|
|
260
|
-
difference against the
|
|
261
|
-
|
|
264
|
+
difference against the installed package -- 16 of 235, re-checked
|
|
265
|
+
when the pin moved to 8.2.8), and `ansi_default` is Rich's
|
|
266
|
+
`default`. A translation, then, rather than a guess.
|
|
267
|
+
|
|
268
|
+
There was ONE such theme (`textual-ansi`) until 8.2.5 replaced it
|
|
269
|
+
with `ansi-dark` and `ansi-light`, and `Theme` grew an `ansi` flag
|
|
270
|
+
in the same release. Nothing here reads the flag: a name can be
|
|
271
|
+
renamed again and the `ansi_` prefix is the thing this function is
|
|
272
|
+
actually about.
|
|
262
273
|
|
|
263
274
|
Not doing it was never a crash, which is why it lasted: Rich's
|
|
264
275
|
Text.render resolves a style string with `default=Style.null()`,
|
|
265
276
|
so an unparseable one renders PLAIN and says nothing. Twenty-five
|
|
266
|
-
of the thirty-four roles were silently unstyled on
|
|
277
|
+
of the thirty-four roles were silently unstyled on the ANSI theme --
|
|
267
278
|
the uniformly white transcript this section exists to fix, reached
|
|
268
279
|
by a different road.
|
|
269
280
|
"""
|
|
@@ -285,7 +296,7 @@ def _palette(theme: Theme) -> dict[str, str]:
|
|
|
285
296
|
#D8A441 and differs from the raw slot on 41 values across the
|
|
286
297
|
fourteen shipped themes. And it is 48x slower than role_styles
|
|
287
298
|
itself. Reaching for it only where a slot is actually None leaves
|
|
288
|
-
all fourteen byte-identical and costs the other twenty-
|
|
299
|
+
all fourteen byte-identical and costs the other twenty-one built-ins
|
|
289
300
|
eight getattrs.
|
|
290
301
|
"""
|
|
291
302
|
raw = tuple(getattr(theme, slot) for slot in _SLOTS)
|
|
@@ -310,7 +321,7 @@ def _tint(colour: str, background: str,
|
|
|
310
321
|
standalone themes, whose panels carry the identity, visibly so.
|
|
311
322
|
|
|
312
323
|
None when either end is one of the terminal's own sixteen, which
|
|
313
|
-
is
|
|
324
|
+
is the ANSI themes and nothing else: there is no RGB there to blend,
|
|
314
325
|
so there is no band to draw. Not a hypothetical guard -- textual's
|
|
315
326
|
Color.parse raises on Rich's `default`, and blending two ANSI
|
|
316
327
|
colours in textual hands back one of them unchanged, so both
|
|
@@ -329,7 +340,7 @@ def role_styles(theme: Theme) -> dict[str, str]:
|
|
|
329
340
|
`tool_error` is a failed tool call rather than "amber".
|
|
330
341
|
|
|
331
342
|
Reads the RESOLVED palette rather than the Theme's own slots,
|
|
332
|
-
which is batch 64:
|
|
343
|
+
which is batch 64: four of the thirty-five themes ctrl+p offers
|
|
333
344
|
leave a slot at None or fill it with textual's `ansi_*` names,
|
|
334
345
|
and one of them took the whole app down at mount. `_palette`
|
|
335
346
|
fills and translates; nothing below can see the difference.
|
|
@@ -346,8 +357,37 @@ def role_styles(theme: Theme) -> dict[str, str]:
|
|
|
346
357
|
# longest text on screen and the thing most often actually read;
|
|
347
358
|
# tinting it costs contrast to say something the label already said.
|
|
348
359
|
"assistant": "",
|
|
360
|
+
# ROADMAP_v3 §49 (SS14): a line of a background session's own
|
|
361
|
+
# output, quoted into a session view. PLAIN, for `assistant`'s
|
|
362
|
+
# reason and one better: it is not the harness's voice and not
|
|
363
|
+
# the model's, it is what a program printed, and a view of a
|
|
364
|
+
# failing test run is read line by line rather than skimmed.
|
|
365
|
+
# `system` was the alternative and is wrong twice -- dimmed and
|
|
366
|
+
# italic is the worst possible treatment for forty lines of
|
|
367
|
+
# output, and it would claim the harness said them.
|
|
368
|
+
#
|
|
369
|
+
# `foreground` EXPLICITLY, not `""` like `assistant`. The empty
|
|
370
|
+
# slot means "inherit", which is right for the body text of a
|
|
371
|
+
# pane that has no other colour in force and wrong for a block
|
|
372
|
+
# quoted inside a frame of `system` lines. It is also the one
|
|
373
|
+
# deliberately unstyled slot, and tests/test_themes.py says so.
|
|
374
|
+
"output": palette["foreground"],
|
|
349
375
|
# The harness talking about itself.
|
|
350
376
|
"system": "dim italic",
|
|
377
|
+
# ROADMAP_v3 §49 (SS5): the harness starting a turn with a
|
|
378
|
+
# background session's result. In the tool call's hue, since it is
|
|
379
|
+
# the far end of one, and bold italic so it is neither that call
|
|
380
|
+
# (plain accent) nor the reply's label (bold accent). Not `dim`:
|
|
381
|
+
# this line opens a turn the reader did not ask for, and `system`
|
|
382
|
+
# alone is dimmed (test_dim_is_the_system_role_alone).
|
|
383
|
+
"wake": f"bold italic {palette['accent']}",
|
|
384
|
+
# Batch 199, the owner's request and choice: the hosted banner's
|
|
385
|
+
# star line, the harness asking the reader to do something outside
|
|
386
|
+
# it. The success hue because it is the inviting colour every theme
|
|
387
|
+
# has -- dark-plain, the hosted default, is grey but for its three
|
|
388
|
+
# severities -- and BOLD, where `success` is plain, so it is not a
|
|
389
|
+
# line reporting that something went well.
|
|
390
|
+
"invite": f"bold {palette['success']}",
|
|
351
391
|
# §38: the model's reasoning, when tui.show_thinking renders it
|
|
352
392
|
# inline. `secondary` because thinking is the answer's quieter
|
|
353
393
|
# sibling rather than a severity or an identity -- it already
|
|
@@ -397,7 +437,7 @@ def role_styles(theme: Theme) -> dict[str, str]:
|
|
|
397
437
|
#
|
|
398
438
|
# Unless there is no background to set. `_tint` answers None on
|
|
399
439
|
# a theme whose colours are the terminal's own sixteen --
|
|
400
|
-
#
|
|
440
|
+
# an ANSI theme and nothing else -- and the row then takes the
|
|
401
441
|
# severity colour as its FOREGROUND, which is what git, diff
|
|
402
442
|
# and patch all do in a sixteen-colour terminal. A solid band
|
|
403
443
|
# was the alternative, and DIFF_TINT's comment above turns that
|
|
@@ -497,7 +537,7 @@ def styles_for(app) -> dict[str, str]:
|
|
|
497
537
|
preferences._remember's deliberate non-latching, and for the
|
|
498
538
|
reason that module states: a warning fires there on a human's own
|
|
499
539
|
action, and fires here on every line drawn. Silence is precisely
|
|
500
|
-
what let textual-light and
|
|
540
|
+
what let textual-light and the ANSI themes render unstyled for as
|
|
501
541
|
long as they did -- Rich resolves an unparseable style with
|
|
502
542
|
`default=Style.null()` and says nothing -- so a contained failure
|
|
503
543
|
that reported nothing would be the same defect wearing a better
|