aetheris 1.3.0__tar.gz → 1.3.1__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 (173) hide show
  1. {aetheris-1.3.0 → aetheris-1.3.1}/CHANGELOG.md +12 -0
  2. {aetheris-1.3.0/aetheris.egg-info → aetheris-1.3.1}/PKG-INFO +1 -1
  3. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/__init__.py +1 -1
  4. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/update.py +92 -1
  5. {aetheris-1.3.0 → aetheris-1.3.1/aetheris.egg-info}/PKG-INFO +1 -1
  6. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_update.py +74 -0
  7. {aetheris-1.3.0 → aetheris-1.3.1}/.github/check_dist.py +0 -0
  8. {aetheris-1.3.0 → aetheris-1.3.1}/.github/check_version.py +0 -0
  9. {aetheris-1.3.0 → aetheris-1.3.1}/.github/workflows/ci.yml +0 -0
  10. {aetheris-1.3.0 → aetheris-1.3.1}/.github/workflows/publish.yml +0 -0
  11. {aetheris-1.3.0 → aetheris-1.3.1}/.gitignore +0 -0
  12. {aetheris-1.3.0 → aetheris-1.3.1}/.mcp.json.example +0 -0
  13. {aetheris-1.3.0 → aetheris-1.3.1}/.permissions.json.example +0 -0
  14. {aetheris-1.3.0 → aetheris-1.3.1}/ARCHITECTURE.md +0 -0
  15. {aetheris-1.3.0 → aetheris-1.3.1}/LICENSE +0 -0
  16. {aetheris-1.3.0 → aetheris-1.3.1}/MANIFEST.in +0 -0
  17. {aetheris-1.3.0 → aetheris-1.3.1}/README.md +0 -0
  18. {aetheris-1.3.0 → aetheris-1.3.1}/TODO.md +0 -0
  19. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/__main__.py +0 -0
  20. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/app.py +0 -0
  21. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/atomic.py +0 -0
  22. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/attacca.py +0 -0
  23. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/background.py +0 -0
  24. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/channel.py +0 -0
  25. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/commands.py +0 -0
  26. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/config.py +0 -0
  27. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/connect.py +0 -0
  28. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/context.py +0 -0
  29. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/deepthink.py +0 -0
  30. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/events.py +0 -0
  31. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/git_ops.py +0 -0
  32. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/hooks.py +0 -0
  33. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/images.py +0 -0
  34. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/keystore.py +0 -0
  35. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/llm_client.py +0 -0
  36. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/mcp_client.py +0 -0
  37. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/mentions.py +0 -0
  38. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/modes.py +0 -0
  39. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/netguard.py +0 -0
  40. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/notes.py +0 -0
  41. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/paths.py +0 -0
  42. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/permissions.py +0 -0
  43. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/promptkeys.py +0 -0
  44. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/providers.py +0 -0
  45. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/py.typed +0 -0
  46. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/qr.py +0 -0
  47. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/remote.py +0 -0
  48. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/renderer.py +0 -0
  49. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/rewind.py +0 -0
  50. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/scheduler.py +0 -0
  51. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/screen.py +0 -0
  52. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/session.py +0 -0
  53. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/shell_session.py +0 -0
  54. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/skills.py +0 -0
  55. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/sse.py +0 -0
  56. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/subagent.py +0 -0
  57. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/symbols.py +0 -0
  58. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/systemprompt.py +0 -0
  59. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/terms.py +0 -0
  60. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/todos.py +0 -0
  61. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/tools.py +0 -0
  62. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/toolspec.py +0 -0
  63. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/transcript.py +0 -0
  64. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/trust.py +0 -0
  65. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/tui.py +0 -0
  66. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/vault.py +0 -0
  67. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/verify.py +0 -0
  68. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/vm.py +0 -0
  69. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/websearch.py +0 -0
  70. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/worktree.py +0 -0
  71. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/zyris.py +0 -0
  72. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris.egg-info/SOURCES.txt +0 -0
  73. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris.egg-info/dependency_links.txt +0 -0
  74. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris.egg-info/entry_points.txt +0 -0
  75. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris.egg-info/requires.txt +0 -0
  76. {aetheris-1.3.0 → aetheris-1.3.1}/aetheris.egg-info/top_level.txt +0 -0
  77. {aetheris-1.3.0 → aetheris-1.3.1}/bench/.gitignore +0 -0
  78. {aetheris-1.3.0 → aetheris-1.3.1}/bench/fixtures/stats.py +0 -0
  79. {aetheris-1.3.0 → aetheris-1.3.1}/bench/run.py +0 -0
  80. {aetheris-1.3.0 → aetheris-1.3.1}/docs/agents.md +0 -0
  81. {aetheris-1.3.0 → aetheris-1.3.1}/docs/configuration.md +0 -0
  82. {aetheris-1.3.0 → aetheris-1.3.1}/docs/deepthink.md +0 -0
  83. {aetheris-1.3.0 → aetheris-1.3.1}/docs/demo.md +0 -0
  84. {aetheris-1.3.0 → aetheris-1.3.1}/docs/design.md +0 -0
  85. {aetheris-1.3.0 → aetheris-1.3.1}/docs/features.md +0 -0
  86. {aetheris-1.3.0 → aetheris-1.3.1}/docs/hooks.md +0 -0
  87. {aetheris-1.3.0 → aetheris-1.3.1}/docs/library.md +0 -0
  88. {aetheris-1.3.0 → aetheris-1.3.1}/docs/permissions.md +0 -0
  89. {aetheris-1.3.0 → aetheris-1.3.1}/docs/providers.md +0 -0
  90. {aetheris-1.3.0 → aetheris-1.3.1}/docs/remote.md +0 -0
  91. {aetheris-1.3.0 → aetheris-1.3.1}/docs/running-commands.md +0 -0
  92. {aetheris-1.3.0 → aetheris-1.3.1}/docs/setup.md +0 -0
  93. {aetheris-1.3.0 → aetheris-1.3.1}/docs/skills-and-mcp.md +0 -0
  94. {aetheris-1.3.0 → aetheris-1.3.1}/docs/slash-commands.md +0 -0
  95. {aetheris-1.3.0 → aetheris-1.3.1}/docs/tools.md +0 -0
  96. {aetheris-1.3.0 → aetheris-1.3.1}/docs/undo-and-verify.md +0 -0
  97. {aetheris-1.3.0 → aetheris-1.3.1}/docs/web-search.md +0 -0
  98. {aetheris-1.3.0 → aetheris-1.3.1}/pyproject.toml +0 -0
  99. {aetheris-1.3.0 → aetheris-1.3.1}/requirements.txt +0 -0
  100. {aetheris-1.3.0 → aetheris-1.3.1}/setup.cfg +0 -0
  101. {aetheris-1.3.0 → aetheris-1.3.1}/skills/README.md +0 -0
  102. {aetheris-1.3.0 → aetheris-1.3.1}/skills/code-review/SKILL.md +0 -0
  103. {aetheris-1.3.0 → aetheris-1.3.1}/skills/git-commit/SKILL.md +0 -0
  104. {aetheris-1.3.0 → aetheris-1.3.1}/skills/git-commit/types.md +0 -0
  105. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_attacca.py +0 -0
  106. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_bench.py +0 -0
  107. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_btw.py +0 -0
  108. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_caching.py +0 -0
  109. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_channel.py +0 -0
  110. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_commands.py +0 -0
  111. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_compact.py +0 -0
  112. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_compat.py +0 -0
  113. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_copy.py +0 -0
  114. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_deepthink.py +0 -0
  115. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_diff.py +0 -0
  116. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_dist.py +0 -0
  117. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_docs.py +0 -0
  118. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_durability.py +0 -0
  119. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_encoding.py +0 -0
  120. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_fork.py +0 -0
  121. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_git_ops.py +0 -0
  122. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_hashline_edit.py +0 -0
  123. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_headless.py +0 -0
  124. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_hooks.py +0 -0
  125. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_images.py +0 -0
  126. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_instructions.py +0 -0
  127. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_interrupt.py +0 -0
  128. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_isolation.py +0 -0
  129. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_keys.py +0 -0
  130. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_loops.py +0 -0
  131. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_malformed_state.py +0 -0
  132. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_mcp_lazy.py +0 -0
  133. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_memory.py +0 -0
  134. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_mentions.py +0 -0
  135. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_modes.py +0 -0
  136. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_multi_edit.py +0 -0
  137. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_native_tools.py +0 -0
  138. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_notes.py +0 -0
  139. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_paths.py +0 -0
  140. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_permissions.py +0 -0
  141. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_platform.py +0 -0
  142. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_project_dirs.py +0 -0
  143. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_pull.py +0 -0
  144. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_qr.py +0 -0
  145. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_read_range.py +0 -0
  146. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_registry.py +0 -0
  147. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_remote.py +0 -0
  148. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_resize.py +0 -0
  149. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_resume.py +0 -0
  150. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_retry.py +0 -0
  151. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_rewind.py +0 -0
  152. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_search.py +0 -0
  153. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_select.py +0 -0
  154. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_session_ops.py +0 -0
  155. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_settings.py +0 -0
  156. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_sse.py +0 -0
  157. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_subagent.py +0 -0
  158. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_symbols.py +0 -0
  159. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_tasks.py +0 -0
  160. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_tdd.py +0 -0
  161. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_terms.py +0 -0
  162. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_todos.py +0 -0
  163. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_tool_parsing.py +0 -0
  164. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_tool_reporting.py +0 -0
  165. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_transcript.py +0 -0
  166. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_trust.py +0 -0
  167. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_usage.py +0 -0
  168. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_vault.py +0 -0
  169. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_verify.py +0 -0
  170. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_vm.py +0 -0
  171. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_window_effort.py +0 -0
  172. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_wrap.py +0 -0
  173. {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_zyris.py +0 -0
@@ -32,6 +32,18 @@ own, and out to a package of its own only when someone needs it there.
32
32
 
33
33
  ---
34
34
 
35
+ ## 1.3.1 - 2026-11-20
36
+
37
+ - **`/update` works on Windows.** pip could not replace `Scripts\aetheris.exe`
38
+ while it was the program running the session, and stopped with WinError 32.
39
+ The launcher is now renamed aside before pip runs - Windows allows that for a
40
+ running `.exe` - and put back if pip fails; the old one is deleted on a later
41
+ start. If even the rename is refused, pip is not run and the command to run
42
+ after quitting is shown instead. The fix is in the version that runs
43
+ `/update`, so getting to 1.3.1 itself from 1.3.0 or earlier on Windows still
44
+ takes quitting Aetheris and running
45
+ `python -m pip install --upgrade aetheris` once.
46
+
35
47
  ## 1.3.0 - 2026-11-20
36
48
 
37
49
  Aetheris that works while nobody is typing, and that asks less while somebody
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aetheris
3
- Version: 1.3.0
3
+ Version: 1.3.1
4
4
  Summary: A terminal AI assistant that works with small local models - two tool protocols, one tool table, and an undo for everything it writes.
5
5
  Author: minjun1177
6
6
  License-Expression: Apache-2.0
@@ -12,7 +12,7 @@ harness's implementation and changes when the harness needs it to.
12
12
 
13
13
  from typing import TYPE_CHECKING
14
14
 
15
- __version__ = "1.3.0"
15
+ __version__ = "1.3.1"
16
16
 
17
17
  __all__ = ["MCPError", "MCPServer", "ShellSession", "start_shell"]
18
18
 
@@ -11,10 +11,13 @@ worse than doing nothing: `pip install --upgrade` into a git checkout's
11
11
  interpreter installs a second copy beside the one being edited, and inside a
12
12
  pipx environment there may be no pip at all.
13
13
  """
14
+ import glob
14
15
  import json
15
16
  import os
17
+ import site
16
18
  import subprocess
17
19
  import sys
20
+ import sysconfig
18
21
  import threading
19
22
  import time
20
23
 
@@ -93,6 +96,80 @@ def how_installed(package_dir: str = "", prefix: str = "") -> tuple:
93
96
  return "pip", [sys.executable, "-m", "pip", "install", "--upgrade", PACKAGE]
94
97
 
95
98
 
99
+ # ---------------------------------------------------------------------------
100
+ # the Windows launcher
101
+ # ---------------------------------------------------------------------------
102
+ # On Windows `aetheris.exe` in Scripts is the process running this session, and
103
+ # a running .exe cannot be overwritten or deleted - pip stops with WinError 32.
104
+ # It can be renamed, though, within its own folder. So before pip runs, the
105
+ # launcher is moved aside; pip then finds nothing to remove and writes the new
106
+ # one. The renamed file is still in use until this session ends, so it is
107
+ # swept on a later start.
108
+
109
+ OLD_SUFFIX = ".old"
110
+
111
+
112
+ def _scripts_dir(package_dir: str = "") -> str:
113
+ """Where pip keeps this copy's launcher: the user scheme's Scripts for a
114
+ `--user` install, the interpreter's own otherwise."""
115
+ package_dir = os.path.normcase(os.path.abspath(
116
+ package_dir or os.path.dirname(os.path.abspath(__file__))))
117
+ try:
118
+ user_site = os.path.normcase(os.path.abspath(site.getusersitepackages()))
119
+ except Exception:
120
+ user_site = ""
121
+ if user_site and package_dir.startswith(user_site + os.sep):
122
+ return sysconfig.get_path("scripts", f"{os.name}_user")
123
+ return sysconfig.get_path("scripts")
124
+
125
+
126
+ def _launchers(scripts_dir: str) -> list:
127
+ path = os.path.join(scripts_dir, f"{PACKAGE}.exe")
128
+ return [path] if os.path.isfile(path) else []
129
+
130
+
131
+ def move_launchers_aside(scripts_dir: str) -> list:
132
+ """Rename each launcher out of pip's way. Returns [(moved_to, original)].
133
+
134
+ Raises OSError when one will not move; any already moved are put back
135
+ first, so a failure leaves Scripts as it was.
136
+ """
137
+ moved = []
138
+ for path in _launchers(scripts_dir):
139
+ aside = f"{path}.{os.getpid()}{OLD_SUFFIX}"
140
+ try:
141
+ os.replace(path, aside)
142
+ except OSError:
143
+ put_back(moved)
144
+ raise
145
+ moved.append((aside, path))
146
+ return moved
147
+
148
+
149
+ def put_back(moved: list) -> None:
150
+ """Undo `move_launchers_aside` where pip did not write a new launcher."""
151
+ for aside, path in moved:
152
+ if not os.path.exists(path):
153
+ try:
154
+ os.replace(aside, path)
155
+ except OSError:
156
+ pass
157
+
158
+
159
+ def sweep_old_launchers(scripts_dir: str = "") -> None:
160
+ """Delete launchers an earlier `/update` moved aside. One still in use -
161
+ another session running the old version - stays until a later start."""
162
+ if os.name != "nt" and not scripts_dir:
163
+ return
164
+ pattern = os.path.join(glob.escape(scripts_dir or _scripts_dir()),
165
+ f"{PACKAGE}.exe.*{OLD_SUFFIX}")
166
+ for path in glob.glob(pattern):
167
+ try:
168
+ os.remove(path)
169
+ except OSError:
170
+ pass
171
+
172
+
96
173
  # ---------------------------------------------------------------------------
97
174
  # the check at start-up
98
175
  # ---------------------------------------------------------------------------
@@ -136,6 +213,7 @@ def _check() -> None:
136
213
 
137
214
  def start_check() -> None:
138
215
  """Look in the background. Nothing waits on it; `announce` reads it."""
216
+ sweep_old_launchers()
139
217
  if not config.UPDATE_CHECK:
140
218
  return
141
219
  threading.Thread(target=_check, name="update-check", daemon=True).start()
@@ -154,10 +232,11 @@ def announce() -> None:
154
232
  # /update
155
233
  # ---------------------------------------------------------------------------
156
234
 
157
- def run(ask) -> None:
235
+ def run(ask, windows: bool = os.name == "nt", scripts_dir: str = "") -> None:
158
236
  """`/update`: find the newest version, and install it if asked to.
159
237
 
160
238
  `ask` puts a question to whoever is driving and returns the answer.
239
+ `windows` and `scripts_dir` stand in for this machine's in tests.
161
240
  """
162
241
  print(f" {S.GRAY}Asking PyPI for the newest {PACKAGE}...{S.R}")
163
242
  try:
@@ -179,12 +258,24 @@ def run(ask) -> None:
179
258
  if answer not in ("y", "yes"):
180
259
  print(f" {S.GRAY}Left as it is.{S.R}\n")
181
260
  return
261
+ moved = []
262
+ if windows and kind == "pip":
263
+ try:
264
+ moved = move_launchers_aside(scripts_dir or _scripts_dir())
265
+ except OSError as error:
266
+ print(f" {S.ERR}✗ Windows will not let the running {PACKAGE}.exe be "
267
+ f"moved aside ({error}), so pip could not replace it.{S.R}")
268
+ print(f" {S.GRAY}Quit Aetheris and run it from a new terminal:{S.R} "
269
+ f"{S.WHITE}{' '.join(command)}{S.R}\n")
270
+ return
182
271
  try:
183
272
  finished = subprocess.run(command, capture_output=True, text=True, timeout=600)
184
273
  except (OSError, subprocess.TimeoutExpired) as error:
274
+ put_back(moved)
185
275
  print(f" {S.ERR}✗ It did not run: {error}{S.R}\n")
186
276
  return
187
277
  if finished.returncode != 0:
278
+ put_back(moved)
188
279
  tail = (finished.stderr or finished.stdout or "").strip().splitlines()[-6:]
189
280
  print(f" {S.ERR}✗ It failed (exit {finished.returncode}):{S.R}")
190
281
  for line in tail:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aetheris
3
- Version: 1.3.0
3
+ Version: 1.3.1
4
4
  Summary: A terminal AI assistant that works with small local models - two tool protocols, one tool table, and an undo for everything it writes.
5
5
  Author: minjun1177
6
6
  License-Expression: Apache-2.0
@@ -172,6 +172,80 @@ finally:
172
172
  subprocess.run, update.latest, update.how_installed = real_run, real_latest, real_how
173
173
 
174
174
 
175
+ print("\n--- /update on Windows: the running launcher ---")
176
+ scripts = tempfile.mkdtemp(prefix="update-scripts-")
177
+ launcher = os.path.join(scripts, "aetheris.exe")
178
+
179
+
180
+ def write(path, text):
181
+ with open(path, "w", encoding="utf-8") as handle:
182
+ handle.write(text)
183
+
184
+
185
+ def read(path):
186
+ with open(path, encoding="utf-8") as handle:
187
+ return handle.read()
188
+
189
+
190
+ def pip_that(code, writes=True):
191
+ """Stands in for pip: what it saw in Scripts, and the new launcher it writes."""
192
+ def run(command, **k):
193
+ ran.append(os.path.exists(launcher))
194
+ if writes:
195
+ write(launcher, "new")
196
+ return Finished(code, "" if code == 0 else "ERROR: no network\n")
197
+ return run
198
+
199
+
200
+ real_run, real_latest, real_how = subprocess.run, update.latest, update.how_installed
201
+ real_replace = os.replace
202
+ update.latest = lambda timeout=update.CHECK_TIMEOUT: "99.0.0"
203
+ update.how_installed = lambda: ("pip", [sys.executable, "-m", "pip", "install",
204
+ "--upgrade", "aetheris"])
205
+ try:
206
+ write(launcher, "old")
207
+ ran = []
208
+ subprocess.run = pip_that(0)
209
+ said = said_by(update.run, lambda question: "y", True, scripts)
210
+ aside = [n for n in os.listdir(scripts) if n.endswith(update.OLD_SUFFIX)]
211
+ check("the launcher is out of pip's way while it runs", ran == [False], str(ran))
212
+ check("pip's new launcher is the one left in place, the old kept aside",
213
+ read(launcher) == "new" and len(aside) == 1 and "Installed 99.0.0" in said,
214
+ f"{os.listdir(scripts)} {said}")
215
+ update.sweep_old_launchers(scripts)
216
+ check("a later start sweeps the old one",
217
+ os.listdir(scripts) == ["aetheris.exe"], str(os.listdir(scripts)))
218
+
219
+ write(launcher, "old")
220
+ ran = []
221
+ subprocess.run = pip_that(1, writes=False)
222
+ said = said_by(update.run, lambda question: "y", True, scripts)
223
+ check("a failed pip puts the launcher back",
224
+ os.listdir(scripts) == ["aetheris.exe"] and read(launcher) == "old"
225
+ and "failed (exit 1)" in said, f"{os.listdir(scripts)} {said}")
226
+
227
+ ran = []
228
+ subprocess.run = pip_that(0)
229
+
230
+ def locked(src, dst):
231
+ raise PermissionError(32, "in use by another process")
232
+ os.replace = locked
233
+ said = said_by(update.run, lambda question: "y", True, scripts)
234
+ os.replace = real_replace
235
+ check("a launcher that will not move: pip is not run, the command is shown",
236
+ ran == [] and read(launcher) == "old" and "Quit Aetheris" in said
237
+ and "pip install --upgrade aetheris" in said, said)
238
+
239
+ ran = []
240
+ subprocess.run = pip_that(0)
241
+ write(launcher, "old")
242
+ said_by(update.run, lambda question: "y", False, scripts)
243
+ check("elsewhere nothing is moved", ran == [True]
244
+ and not [n for n in os.listdir(scripts) if n.endswith(update.OLD_SUFFIX)])
245
+ finally:
246
+ os.replace = real_replace
247
+ subprocess.run, update.latest, update.how_installed = real_run, real_latest, real_how
248
+
175
249
  print()
176
250
  if failures:
177
251
  print(f"{len(failures)} FAILURE(S): {failures}")
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes