@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.
Files changed (129) hide show
  1. package/.env.example +19 -14
  2. package/CONFIG_ARCHITECTURE.md +2002 -0
  3. package/NOTICE +1 -1
  4. package/README.md +233 -94
  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 +277 -43
  12. package/agents/tui_commands.py +7 -12
  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 +158 -20
  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 +1238 -82
  29. package/core/commands.py +454 -0
  30. package/core/compaction.py +830 -66
  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 +1516 -440
  38. package/core/memory.py +120 -8
  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 +158 -26
  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 +1671 -199
  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 +7 -12
  70. package/package.json +234 -4
  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 +51 -2
  80. package/requirements.txt +252 -29
  81. package/safety/policy_enforcement.py +353 -17
  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 +368 -35
  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 +347 -30
  118. package/tui/app.py +4645 -438
  119. package/tui/app.tcss +185 -2
  120. package/tui/commands.py +10 -154
  121. package/tui/diffs.py +286 -265
  122. package/tui/hosted_driver.py +102 -0
  123. package/tui/markdown.py +60 -10
  124. package/tui/meters.py +103 -7
  125. package/tui/screens.py +346 -92
  126. package/tui/themes.py +59 -19
  127. package/tui/widgets.py +1575 -111
  128. package/SECURITY.md +0 -88
  129. 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 pinned textual 1.0.0,
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 three of the
232
- #: twelve built-ins the command palette offers do leave one blank or
233
- #: fill it with a vocabulary Rich cannot read: textual-dark has no
234
- #: `background`, textual-light no `foreground`, textual-ansi nothing
235
- #: but `ansi_*` names. Reading them raw is what made selecting
236
- #: textual-dark kill the harness AT MOUNT -- and keep killing it,
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
- textual-ansi fills every slot with `ansi_blue`/`ansi_default` --
256
- the terminal's own sixteen, which is the entire point of that
257
- theme -- and Rich's Style.parse does not know the prefix. It knows
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 pinned 1.0.0, per D22), and `ansi_default`
261
- is Rich's `default`. A translation, then, rather than a guess.
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 textual-ansi --
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-four themes
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 textual-ansi and nothing else: there is no RGB there to blend,
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: three of the twenty-six themes ctrl+p offers
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
- # textual-ansi and nothing else -- and the row then takes the
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 textual-ansi render unstyled for as
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