zettcode-app 0.4.4__tar.gz → 0.4.6__tar.gz

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 (80) hide show
  1. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/PKG-INFO +8 -8
  2. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/pyproject.toml +7 -7
  3. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/ui/app.py +6 -0
  4. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/ui/commands.py +5 -4
  5. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/ui/providers.py +11 -0
  6. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/ui/sessions.py +14 -0
  7. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/.gitignore +0 -0
  8. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/__init__.py +0 -0
  9. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/agent/__init__.py +0 -0
  10. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/agent/agent/__init__.py +0 -0
  11. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/agent/agent/commands.py +0 -0
  12. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/agent/agent/settings.py +0 -0
  13. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/agent/conversation/__init__.py +0 -0
  14. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/agent/conversation/changes.py +0 -0
  15. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/agent/conversation/effort_gauge.py +0 -0
  16. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/agent/conversation/projection.py +0 -0
  17. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/agent/conversation/rendering.py +0 -0
  18. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/agent/conversation/replay.py +0 -0
  19. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/agent/conversation/shimmer.py +0 -0
  20. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/agent/conversation/stops.py +0 -0
  21. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/agent/conversation/tips.py +0 -0
  22. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/agent/conversation/transcript/__init__.py +0 -0
  23. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/agent/conversation/transcript/fold.py +0 -0
  24. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/agent/conversation/transcript/log.py +0 -0
  25. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/agent/conversation/transcript/oneoff.py +0 -0
  26. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/agent/conversation/transcript/stream.py +0 -0
  27. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/agent/conversation/transcript/turn.py +0 -0
  28. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/commandline/__init__.py +0 -0
  29. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/commandline/arguments.py +0 -0
  30. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/commandline/completion.py +0 -0
  31. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/commandline/history.py +0 -0
  32. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/commandline/runner.py +0 -0
  33. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/errors.py +0 -0
  34. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/plugins/__init__.py +0 -0
  35. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/plugins/builtins.py +0 -0
  36. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/plugins/groups.py +0 -0
  37. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/plugins/loader.py +0 -0
  38. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/py.typed +0 -0
  39. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/ui/__init__.py +0 -0
  40. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/ui/bars.py +0 -0
  41. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/ui/boot.py +0 -0
  42. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/ui/clipboard.py +0 -0
  43. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/ui/config_form.py +0 -0
  44. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/ui/demo.py +0 -0
  45. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/ui/followups.py +0 -0
  46. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/ui/gc_policy.py +0 -0
  47. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/ui/keys.py +0 -0
  48. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/ui/messaging.py +0 -0
  49. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/ui/notices.py +0 -0
  50. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/ui/settings.py +0 -0
  51. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/ui/shell.py +0 -0
  52. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/ui/turns.py +0 -0
  53. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/ui/updating.py +0 -0
  54. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/ui/widgets/__init__.py +0 -0
  55. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/ui/widgets/approval_page.py +0 -0
  56. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/ui/widgets/ask_page.py +0 -0
  57. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/ui/widgets/bash_page.py +0 -0
  58. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/ui/widgets/completer.py +0 -0
  59. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/ui/widgets/composer.py +0 -0
  60. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/ui/widgets/document_page.py +0 -0
  61. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/ui/widgets/effort_page.py +0 -0
  62. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/ui/widgets/follow_up.py +0 -0
  63. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/ui/widgets/form_page.py +0 -0
  64. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/ui/widgets/input_page.py +0 -0
  65. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/ui/widgets/model_page.py +0 -0
  66. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/ui/widgets/model_settings_page.py +0 -0
  67. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/ui/widgets/pet.py +0 -0
  68. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/ui/widgets/pet_page.py +0 -0
  69. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/ui/widgets/plugins_page.py +0 -0
  70. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/ui/widgets/root.py +0 -0
  71. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/ui/widgets/self_compact_page.py +0 -0
  72. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/ui/widgets/send_kind_page.py +0 -0
  73. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/ui/widgets/sessions_page.py +0 -0
  74. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/ui/widgets/statusline_page.py +0 -0
  75. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/ui/widgets/steering.py +0 -0
  76. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/ui/widgets/transcript.py +0 -0
  77. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/ui/widgets/update_page.py +0 -0
  78. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/app/ui/widgets/welcome.py +0 -0
  79. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/collector.py +0 -0
  80. {zettcode_app-0.4.4 → zettcode_app-0.4.6}/src/zettcode/update.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: zettcode-app
3
- Version: 0.4.4
3
+ Version: 0.4.6
4
4
  Summary: The terminal application of ZettCode: the conversation model, the shell and its views
5
5
  Project-URL: Repository, https://github.com/Chang-LeHung/zettcode
6
6
  Author: Chang-LeHung
@@ -17,10 +17,10 @@ Classifier: Typing :: Typed
17
17
  Requires-Python: >=3.10
18
18
  Requires-Dist: truststore<1,>=0.10
19
19
  Requires-Dist: zett-agent<0.3,>=0.2.10
20
- Requires-Dist: zettcode-broker
21
- Requires-Dist: zettcode-engine
22
- Requires-Dist: zettcode-messaging
23
- Requires-Dist: zettcode-plugin-api
24
- Requires-Dist: zettcode-presenters
25
- Requires-Dist: zettcode-sdk
26
- Requires-Dist: zettcode-tui
20
+ Requires-Dist: zettcode-broker<0.5,>=0.4.6
21
+ Requires-Dist: zettcode-engine<0.5,>=0.4.6
22
+ Requires-Dist: zettcode-messaging<0.5,>=0.4.6
23
+ Requires-Dist: zettcode-plugin-api<0.5,>=0.4.6
24
+ Requires-Dist: zettcode-presenters<0.5,>=0.4.6
25
+ Requires-Dist: zettcode-sdk<0.5,>=0.4.6
26
+ Requires-Dist: zettcode-tui<0.5,>=0.4.6
@@ -17,14 +17,14 @@ classifiers = [
17
17
  "Typing :: Typed",
18
18
  ]
19
19
  dependencies = [
20
- "zettcode-engine",
21
- "zettcode-tui",
22
- "zettcode-sdk",
23
- "zettcode-broker",
20
+ "zettcode-engine>=0.4.6,<0.5",
21
+ "zettcode-tui>=0.4.6,<0.5",
22
+ "zettcode-sdk>=0.4.6,<0.5",
23
+ "zettcode-broker>=0.4.6,<0.5",
24
24
  # The line to the other sessions, which the shell's agent carries and matches messages against.
25
- "zettcode-messaging",
26
- "zettcode-plugin-api",
27
- "zettcode-presenters",
25
+ "zettcode-messaging>=0.4.6,<0.5",
26
+ "zettcode-plugin-api>=0.4.6,<0.5",
27
+ "zettcode-presenters>=0.4.6,<0.5",
28
28
  "zett-agent>=0.2.10,<0.3",
29
29
  # The release check verifies the index against the system trust store; imported by `update.py` with a
30
30
  # fallback, so it is a hint rather than a requirement.
@@ -1081,6 +1081,12 @@ class ZettCodeApp(
1081
1081
  self._refuse_busy()
1082
1082
  return False
1083
1083
  if chosen.when_busy == "now":
1084
+ if not self._turn_running:
1085
+ # "Now" means beside a request, and there is none: a resume, a fork or a new session is
1086
+ # holding the shell, and it is about to replace the conversation this command would act
1087
+ # on. Refusing is what happened before the command asked for "now" at all.
1088
+ self._refuse_busy()
1089
+ return False
1084
1090
  self._run_command_now(chosen, argument)
1085
1091
  return True
1086
1092
  self._queue_command(value)
@@ -90,10 +90,11 @@ class ShellCommands(CommandProvider):
90
90
  """Return the shell's own commands, in the order ``/help`` lists them."""
91
91
  return (
92
92
  # ``when_busy="now"`` below is for what only looks at the session or sets something the
93
- # running request reads when it needs it. What it touches while a request runs - the
94
- # transcript it writes into, the session, the model it started with and the window that
95
- # model's compaction is sized to - stays refused: /config, and the plugins' /model, /clear,
96
- # /resume, /fork, plus the agent's /new, /compact and /export.
93
+ # running request does not read again. What it touches while a request runs - the
94
+ # transcript it writes into, the session, the window its compaction is sized to - stays
95
+ # refused: /config, and the plugins' /clear, /resume, /fork, plus the agent's /new,
96
+ # /compact and /export. (/model runs beside a request too: the request in flight was
97
+ # handed its provider when it started, so the choice reaches the next turn.)
97
98
  Command(
98
99
  "/config",
99
100
  "add, change or remove models: /config [add|remove|list]",
@@ -322,6 +322,8 @@ class ConfigMixin(ShellState):
322
322
  return "context_window"
323
323
  if "compact_percent" in message or "compact percent" in message:
324
324
  return "compact_percent"
325
+ if "max_tokens" in message or "output budget" in message:
326
+ return "max_tokens"
325
327
  if "temperature" in message:
326
328
  return "temperature"
327
329
  return ""
@@ -461,6 +463,13 @@ class ConfigMixin(ShellState):
461
463
  placeholder="80 (% of the window)",
462
464
  hint="When the conversation fills this share of the window it is summarized first: more than 0, at most 100.",
463
465
  ),
466
+ Setting(
467
+ "max_tokens",
468
+ "Reply budget",
469
+ initial=str(entry.get("max_tokens", "")),
470
+ placeholder="20,000 tokens",
471
+ hint="How long one reply may be: 32000, 32k or 1m. Leave it empty for 20,000; 0 sends none and uses the endpoint's own.",
472
+ ),
464
473
  ]
465
474
  actions = [
466
475
  Action("use", "Use this model", "save any change, then switch to it now", saves=True),
@@ -539,6 +548,7 @@ class ConfigMixin(ShellState):
539
548
  "temperature": lambda text: whole_if_whole(parse_temperature(text, api)),
540
549
  "context_window": parse_tokens,
541
550
  "compact_percent": lambda text: whole_if_whole(parse_percent(text)),
551
+ "max_tokens": parse_tokens,
542
552
  }
543
553
  for key in (
544
554
  "base_url",
@@ -548,6 +558,7 @@ class ConfigMixin(ShellState):
548
558
  "temperature",
549
559
  "context_window",
550
560
  "compact_percent",
561
+ "max_tokens",
551
562
  ):
552
563
  text = str(values[key])
553
564
  if text == str(current.get(key, "")):
@@ -290,11 +290,13 @@ class SessionMixin(ShellState):
290
290
  def _install_session(self, loaded: LoadedSession) -> None:
291
291
  """Make a loaded session the visible one. Assignment only; runs on the loop."""
292
292
  previous = self.model
293
+ previous_effort = self.client.effort
293
294
  self.transcript.replace(loaded.replayed.transcript.entries)
294
295
  self.client.sessions.install(loaded.stored)
295
296
  if not self.transcript.entries:
296
297
  self.transcript.welcome(WELCOME)
297
298
  self._announce_restored_model(previous, loaded.stored)
299
+ self._announce_restored_effort(previous_effort)
298
300
  self.view.follow_tail = True
299
301
  self.view.clear_selection()
300
302
  self._session_title = loaded.stored.title
@@ -325,6 +327,18 @@ class SessionMixin(ShellState):
325
327
  f"This session last used {stored.model}, which is not in your configuration; staying on {current.name}."
326
328
  )
327
329
 
330
+ def _announce_restored_effort(self, previous: str) -> None:
331
+ """Say so when resuming a session moved the reasoning level.
332
+
333
+ The level travels with the model, so a session that reasoned at ``high`` comes back at ``high`` even when
334
+ this shell was at the default; the header shows the new level, and a figure that changed by itself is a
335
+ thing to name. Silence is for when nothing changed: the session never recorded a level, or it is the one
336
+ already in force.
337
+ """
338
+ current = self.client.effort
339
+ if current and current != previous:
340
+ self.transcript.announce(f"Reasoning set to {current}, the level this session last used.")
341
+
328
342
  def _remeasure_context_later(self) -> None:
329
343
  """Measure the context again, for a figure that cannot be true.
330
344
 
File without changes