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.
- {aetheris-1.3.0 → aetheris-1.3.1}/CHANGELOG.md +12 -0
- {aetheris-1.3.0/aetheris.egg-info → aetheris-1.3.1}/PKG-INFO +1 -1
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/__init__.py +1 -1
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/update.py +92 -1
- {aetheris-1.3.0 → aetheris-1.3.1/aetheris.egg-info}/PKG-INFO +1 -1
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_update.py +74 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/.github/check_dist.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/.github/check_version.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/.github/workflows/ci.yml +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/.github/workflows/publish.yml +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/.gitignore +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/.mcp.json.example +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/.permissions.json.example +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/ARCHITECTURE.md +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/LICENSE +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/MANIFEST.in +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/README.md +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/TODO.md +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/__main__.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/app.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/atomic.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/attacca.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/background.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/channel.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/commands.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/config.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/connect.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/context.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/deepthink.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/events.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/git_ops.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/hooks.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/images.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/keystore.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/llm_client.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/mcp_client.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/mentions.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/modes.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/netguard.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/notes.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/paths.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/permissions.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/promptkeys.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/providers.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/py.typed +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/qr.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/remote.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/renderer.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/rewind.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/scheduler.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/screen.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/session.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/shell_session.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/skills.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/sse.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/subagent.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/symbols.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/systemprompt.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/terms.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/todos.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/tools.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/toolspec.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/transcript.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/trust.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/tui.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/vault.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/verify.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/vm.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/websearch.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/worktree.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris/zyris.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris.egg-info/SOURCES.txt +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris.egg-info/dependency_links.txt +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris.egg-info/entry_points.txt +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris.egg-info/requires.txt +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/aetheris.egg-info/top_level.txt +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/bench/.gitignore +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/bench/fixtures/stats.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/bench/run.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/docs/agents.md +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/docs/configuration.md +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/docs/deepthink.md +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/docs/demo.md +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/docs/design.md +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/docs/features.md +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/docs/hooks.md +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/docs/library.md +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/docs/permissions.md +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/docs/providers.md +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/docs/remote.md +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/docs/running-commands.md +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/docs/setup.md +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/docs/skills-and-mcp.md +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/docs/slash-commands.md +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/docs/tools.md +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/docs/undo-and-verify.md +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/docs/web-search.md +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/pyproject.toml +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/requirements.txt +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/setup.cfg +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/skills/README.md +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/skills/code-review/SKILL.md +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/skills/git-commit/SKILL.md +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/skills/git-commit/types.md +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_attacca.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_bench.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_btw.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_caching.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_channel.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_commands.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_compact.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_compat.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_copy.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_deepthink.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_diff.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_dist.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_docs.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_durability.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_encoding.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_fork.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_git_ops.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_hashline_edit.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_headless.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_hooks.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_images.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_instructions.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_interrupt.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_isolation.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_keys.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_loops.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_malformed_state.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_mcp_lazy.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_memory.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_mentions.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_modes.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_multi_edit.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_native_tools.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_notes.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_paths.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_permissions.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_platform.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_project_dirs.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_pull.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_qr.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_read_range.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_registry.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_remote.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_resize.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_resume.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_retry.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_rewind.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_search.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_select.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_session_ops.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_settings.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_sse.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_subagent.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_symbols.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_tasks.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_tdd.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_terms.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_todos.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_tool_parsing.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_tool_reporting.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_transcript.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_trust.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_usage.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_vault.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_verify.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_vm.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_window_effort.py +0 -0
- {aetheris-1.3.0 → aetheris-1.3.1}/tests/test_wrap.py +0 -0
- {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.
|
|
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
|
|
@@ -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.
|
|
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
|
|
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
|