asdu 0.4.2__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.
- asdu-0.4.2/LICENSE +21 -0
- asdu-0.4.2/MANIFEST.in +1 -0
- asdu-0.4.2/PKG-INFO +147 -0
- asdu-0.4.2/README.md +133 -0
- asdu-0.4.2/asdu.egg-info/PKG-INFO +147 -0
- asdu-0.4.2/asdu.egg-info/SOURCES.txt +26 -0
- asdu-0.4.2/asdu.egg-info/dependency_links.txt +1 -0
- asdu-0.4.2/asdu.egg-info/entry_points.txt +2 -0
- asdu-0.4.2/asdu.egg-info/requires.txt +1 -0
- asdu-0.4.2/asdu.egg-info/top_level.txt +6 -0
- asdu-0.4.2/asdu.py +198 -0
- asdu-0.4.2/asdu_browser.py +424 -0
- asdu-0.4.2/asdu_sessions.py +352 -0
- asdu-0.4.2/asdu_sources/__init__.py +90 -0
- asdu-0.4.2/asdu_sources/claude.py +300 -0
- asdu-0.4.2/asdu_sources/codex.py +316 -0
- asdu-0.4.2/asdu_sources/omp.py +202 -0
- asdu-0.4.2/asdu_tui.py +1564 -0
- asdu-0.4.2/asdu_views.py +715 -0
- asdu-0.4.2/pyproject.toml +27 -0
- asdu-0.4.2/setup.cfg +4 -0
- asdu-0.4.2/tests/fixtures/asdu/claude-test.jsonl +4 -0
- asdu-0.4.2/tests/fixtures/asdu/omp-test.jsonl +5 -0
- asdu-0.4.2/tests/fixtures/asdu/rollout-codex.jsonl +3 -0
- asdu-0.4.2/tests/smoke_install.py +87 -0
- asdu-0.4.2/tests/test_asdu.py +778 -0
- asdu-0.4.2/tests/test_pty.py +222 -0
- asdu-0.4.2/tests/test_sources.py +233 -0
asdu-0.4.2/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 The asdu contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
asdu-0.4.2/MANIFEST.in
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
recursive-include tests *.py *.jsonl
|
asdu-0.4.2/PKG-INFO
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: asdu
|
|
3
|
+
Version: 0.4.2
|
|
4
|
+
Summary: A terminal disk-usage browser for Codex, Claude, and OMP sessions
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
Project-URL: Homepage, https://github.com/tekkac/asdu
|
|
7
|
+
Project-URL: Repository, https://github.com/tekkac/asdu
|
|
8
|
+
Project-URL: Issues, https://github.com/tekkac/asdu/issues
|
|
9
|
+
Requires-Python: >=3.11
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Requires-Dist: send2trash>=1.8.3
|
|
13
|
+
Dynamic: license-file
|
|
14
|
+
|
|
15
|
+
# asdu
|
|
16
|
+
|
|
17
|
+
```text
|
|
18
|
+
█████╗ ███████╗██████╗ ██╗ ██╗
|
|
19
|
+
██╔══██╗██╔════╝██╔══██╗██║ ██║
|
|
20
|
+
███████║███████╗██║ ██║██║ ██║
|
|
21
|
+
██╔══██║╚════██║██║ ██║██║ ██║
|
|
22
|
+
██║ ██║███████║██████╔╝╚██████╔╝
|
|
23
|
+
╚═╝ ╚═╝╚══════╝╚═════╝ ╚═════╝
|
|
24
|
+
|
|
25
|
+
agent session disk usage
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
`asdu` shows where Codex, Claude, and OMP sessions use disk space.
|
|
29
|
+
|
|
30
|
+
It works like a file browser. Start in a folder, inspect its sessions, and move
|
|
31
|
+
up or down the directory tree. Everything stays local.
|
|
32
|
+
|
|
33
|
+
## Install
|
|
34
|
+
|
|
35
|
+
Install with [uv](https://docs.astral.sh/uv/):
|
|
36
|
+
|
|
37
|
+
```sh
|
|
38
|
+
uv tool install asdu
|
|
39
|
+
asdu
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Update an existing installation:
|
|
43
|
+
|
|
44
|
+
```sh
|
|
45
|
+
uv tool upgrade asdu
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Use
|
|
49
|
+
|
|
50
|
+
Run `asdu` inside any project:
|
|
51
|
+
|
|
52
|
+
```sh
|
|
53
|
+
asdu
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Start somewhere else:
|
|
57
|
+
|
|
58
|
+
```sh
|
|
59
|
+
asdu --project ~/
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The initial view shows folders. Press `g` for one flat list, then sources
|
|
63
|
+
of sessions in the current folder. Press `t` to show session trees; they open
|
|
64
|
+
folded.
|
|
65
|
+
|
|
66
|
+
```text
|
|
67
|
+
asdu ~/Code/demo 143.9 MiB 12 sessions size↓
|
|
68
|
+
74.2 MiB ████████████ 5 /api
|
|
69
|
+
38.1 MiB ██████▏░░░░░ 3 /docs
|
|
70
|
+
|
|
71
|
+
› 23.5 MiB ████████████ codex main now ▸ Fix flaky tests (+2)
|
|
72
|
+
8.1 MiB ████▏░░░░░░░ claude main 12m ago Review the release notes
|
|
73
|
+
|
|
74
|
+
codex 019bcb82-bef5-7503 | 2026-09-09 11:52 | ~/.codex/sessions/…jsonl
|
|
75
|
+
Enter open Backspace back a action t tree / find g group f source F type s sort ? help q quit
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
- Arrow keys select rows. In trees, `↑↓` select siblings and `←→` move between
|
|
79
|
+
parents and children.
|
|
80
|
+
- `Enter` opens a folder or session brief.
|
|
81
|
+
- `Backspace` goes back or moves to the parent folder.
|
|
82
|
+
- `/` or `Ctrl-F` searches every scanned session by title, folder, or ID.
|
|
83
|
+
- `g` switches between folder, source, and all-session views.
|
|
84
|
+
- `f` filters by source.
|
|
85
|
+
- `F` filters by session type: main, child, review, or `?` when unknown.
|
|
86
|
+
- `s` changes the sort order.
|
|
87
|
+
- `t` toggles trees. `Space` folds one branch and `z` folds or opens all.
|
|
88
|
+
- `a` shows the actions supported by the selected source.
|
|
89
|
+
- `r` rescans.
|
|
90
|
+
- `q` quits.
|
|
91
|
+
|
|
92
|
+
Press `?` for help. Run `asdu --help` for command-line options.
|
|
93
|
+
|
|
94
|
+
## Session briefs
|
|
95
|
+
|
|
96
|
+
Press `Enter` on a session to see its folder, size, ID, activity, recent request,
|
|
97
|
+
last reply, and resume command.
|
|
98
|
+
|
|
99
|
+
```text
|
|
100
|
+
Center the login form
|
|
101
|
+
|
|
102
|
+
18.2 MiB claude main 2h ago
|
|
103
|
+
Folder: /demo/web-app
|
|
104
|
+
24 messages across 384 events; 0 compactions.
|
|
105
|
+
|
|
106
|
+
╭ Latest request
|
|
107
|
+
│ Why did the login page disappear?
|
|
108
|
+
│
|
|
109
|
+
├ Last reply
|
|
110
|
+
│ The login page is back and the form is centered.
|
|
111
|
+
│
|
|
112
|
+
├ First request
|
|
113
|
+
│ Move the form two pixels to the left.
|
|
114
|
+
╰
|
|
115
|
+
|
|
116
|
+
ID: demo-css-001
|
|
117
|
+
Resume: claude --resume demo-css-001
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Session actions
|
|
121
|
+
|
|
122
|
+
Browsing never changes a session. Press `a` to review an action before it runs.
|
|
123
|
+
|
|
124
|
+
Codex archive and restore use Codex itself. Codex delete is permanent. Claude
|
|
125
|
+
sessions can move to the system Trash. Tree actions include folded descendants.
|
|
126
|
+
Active Claude sessions are refused.
|
|
127
|
+
|
|
128
|
+
Successful actions append a content-free record to
|
|
129
|
+
`$XDG_STATE_HOME/asdu/actions.jsonl`, normally
|
|
130
|
+
`~/.local/state/asdu/actions.jsonl`.
|
|
131
|
+
|
|
132
|
+
## Contributing
|
|
133
|
+
|
|
134
|
+
Bug reports, UI improvements, and new session sources are welcome. Keep changes
|
|
135
|
+
small and use fictional session data in tests.
|
|
136
|
+
|
|
137
|
+
```sh
|
|
138
|
+
uv run pytest
|
|
139
|
+
uv run ruff check .
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
New sources start read-only. Add file-changing actions only when their lifecycle
|
|
143
|
+
is understood and tested.
|
|
144
|
+
|
|
145
|
+
## License
|
|
146
|
+
|
|
147
|
+
[MIT](LICENSE)
|
asdu-0.4.2/README.md
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# asdu
|
|
2
|
+
|
|
3
|
+
```text
|
|
4
|
+
█████╗ ███████╗██████╗ ██╗ ██╗
|
|
5
|
+
██╔══██╗██╔════╝██╔══██╗██║ ██║
|
|
6
|
+
███████║███████╗██║ ██║██║ ██║
|
|
7
|
+
██╔══██║╚════██║██║ ██║██║ ██║
|
|
8
|
+
██║ ██║███████║██████╔╝╚██████╔╝
|
|
9
|
+
╚═╝ ╚═╝╚══════╝╚═════╝ ╚═════╝
|
|
10
|
+
|
|
11
|
+
agent session disk usage
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
`asdu` shows where Codex, Claude, and OMP sessions use disk space.
|
|
15
|
+
|
|
16
|
+
It works like a file browser. Start in a folder, inspect its sessions, and move
|
|
17
|
+
up or down the directory tree. Everything stays local.
|
|
18
|
+
|
|
19
|
+
## Install
|
|
20
|
+
|
|
21
|
+
Install with [uv](https://docs.astral.sh/uv/):
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
uv tool install asdu
|
|
25
|
+
asdu
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Update an existing installation:
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
uv tool upgrade asdu
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Use
|
|
35
|
+
|
|
36
|
+
Run `asdu` inside any project:
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
asdu
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Start somewhere else:
|
|
43
|
+
|
|
44
|
+
```sh
|
|
45
|
+
asdu --project ~/
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
The initial view shows folders. Press `g` for one flat list, then sources
|
|
49
|
+
of sessions in the current folder. Press `t` to show session trees; they open
|
|
50
|
+
folded.
|
|
51
|
+
|
|
52
|
+
```text
|
|
53
|
+
asdu ~/Code/demo 143.9 MiB 12 sessions size↓
|
|
54
|
+
74.2 MiB ████████████ 5 /api
|
|
55
|
+
38.1 MiB ██████▏░░░░░ 3 /docs
|
|
56
|
+
|
|
57
|
+
› 23.5 MiB ████████████ codex main now ▸ Fix flaky tests (+2)
|
|
58
|
+
8.1 MiB ████▏░░░░░░░ claude main 12m ago Review the release notes
|
|
59
|
+
|
|
60
|
+
codex 019bcb82-bef5-7503 | 2026-09-09 11:52 | ~/.codex/sessions/…jsonl
|
|
61
|
+
Enter open Backspace back a action t tree / find g group f source F type s sort ? help q quit
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
- Arrow keys select rows. In trees, `↑↓` select siblings and `←→` move between
|
|
65
|
+
parents and children.
|
|
66
|
+
- `Enter` opens a folder or session brief.
|
|
67
|
+
- `Backspace` goes back or moves to the parent folder.
|
|
68
|
+
- `/` or `Ctrl-F` searches every scanned session by title, folder, or ID.
|
|
69
|
+
- `g` switches between folder, source, and all-session views.
|
|
70
|
+
- `f` filters by source.
|
|
71
|
+
- `F` filters by session type: main, child, review, or `?` when unknown.
|
|
72
|
+
- `s` changes the sort order.
|
|
73
|
+
- `t` toggles trees. `Space` folds one branch and `z` folds or opens all.
|
|
74
|
+
- `a` shows the actions supported by the selected source.
|
|
75
|
+
- `r` rescans.
|
|
76
|
+
- `q` quits.
|
|
77
|
+
|
|
78
|
+
Press `?` for help. Run `asdu --help` for command-line options.
|
|
79
|
+
|
|
80
|
+
## Session briefs
|
|
81
|
+
|
|
82
|
+
Press `Enter` on a session to see its folder, size, ID, activity, recent request,
|
|
83
|
+
last reply, and resume command.
|
|
84
|
+
|
|
85
|
+
```text
|
|
86
|
+
Center the login form
|
|
87
|
+
|
|
88
|
+
18.2 MiB claude main 2h ago
|
|
89
|
+
Folder: /demo/web-app
|
|
90
|
+
24 messages across 384 events; 0 compactions.
|
|
91
|
+
|
|
92
|
+
╭ Latest request
|
|
93
|
+
│ Why did the login page disappear?
|
|
94
|
+
│
|
|
95
|
+
├ Last reply
|
|
96
|
+
│ The login page is back and the form is centered.
|
|
97
|
+
│
|
|
98
|
+
├ First request
|
|
99
|
+
│ Move the form two pixels to the left.
|
|
100
|
+
╰
|
|
101
|
+
|
|
102
|
+
ID: demo-css-001
|
|
103
|
+
Resume: claude --resume demo-css-001
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Session actions
|
|
107
|
+
|
|
108
|
+
Browsing never changes a session. Press `a` to review an action before it runs.
|
|
109
|
+
|
|
110
|
+
Codex archive and restore use Codex itself. Codex delete is permanent. Claude
|
|
111
|
+
sessions can move to the system Trash. Tree actions include folded descendants.
|
|
112
|
+
Active Claude sessions are refused.
|
|
113
|
+
|
|
114
|
+
Successful actions append a content-free record to
|
|
115
|
+
`$XDG_STATE_HOME/asdu/actions.jsonl`, normally
|
|
116
|
+
`~/.local/state/asdu/actions.jsonl`.
|
|
117
|
+
|
|
118
|
+
## Contributing
|
|
119
|
+
|
|
120
|
+
Bug reports, UI improvements, and new session sources are welcome. Keep changes
|
|
121
|
+
small and use fictional session data in tests.
|
|
122
|
+
|
|
123
|
+
```sh
|
|
124
|
+
uv run pytest
|
|
125
|
+
uv run ruff check .
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
New sources start read-only. Add file-changing actions only when their lifecycle
|
|
129
|
+
is understood and tested.
|
|
130
|
+
|
|
131
|
+
## License
|
|
132
|
+
|
|
133
|
+
[MIT](LICENSE)
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: asdu
|
|
3
|
+
Version: 0.4.2
|
|
4
|
+
Summary: A terminal disk-usage browser for Codex, Claude, and OMP sessions
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
Project-URL: Homepage, https://github.com/tekkac/asdu
|
|
7
|
+
Project-URL: Repository, https://github.com/tekkac/asdu
|
|
8
|
+
Project-URL: Issues, https://github.com/tekkac/asdu/issues
|
|
9
|
+
Requires-Python: >=3.11
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Requires-Dist: send2trash>=1.8.3
|
|
13
|
+
Dynamic: license-file
|
|
14
|
+
|
|
15
|
+
# asdu
|
|
16
|
+
|
|
17
|
+
```text
|
|
18
|
+
█████╗ ███████╗██████╗ ██╗ ██╗
|
|
19
|
+
██╔══██╗██╔════╝██╔══██╗██║ ██║
|
|
20
|
+
███████║███████╗██║ ██║██║ ██║
|
|
21
|
+
██╔══██║╚════██║██║ ██║██║ ██║
|
|
22
|
+
██║ ██║███████║██████╔╝╚██████╔╝
|
|
23
|
+
╚═╝ ╚═╝╚══════╝╚═════╝ ╚═════╝
|
|
24
|
+
|
|
25
|
+
agent session disk usage
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
`asdu` shows where Codex, Claude, and OMP sessions use disk space.
|
|
29
|
+
|
|
30
|
+
It works like a file browser. Start in a folder, inspect its sessions, and move
|
|
31
|
+
up or down the directory tree. Everything stays local.
|
|
32
|
+
|
|
33
|
+
## Install
|
|
34
|
+
|
|
35
|
+
Install with [uv](https://docs.astral.sh/uv/):
|
|
36
|
+
|
|
37
|
+
```sh
|
|
38
|
+
uv tool install asdu
|
|
39
|
+
asdu
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Update an existing installation:
|
|
43
|
+
|
|
44
|
+
```sh
|
|
45
|
+
uv tool upgrade asdu
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Use
|
|
49
|
+
|
|
50
|
+
Run `asdu` inside any project:
|
|
51
|
+
|
|
52
|
+
```sh
|
|
53
|
+
asdu
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Start somewhere else:
|
|
57
|
+
|
|
58
|
+
```sh
|
|
59
|
+
asdu --project ~/
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The initial view shows folders. Press `g` for one flat list, then sources
|
|
63
|
+
of sessions in the current folder. Press `t` to show session trees; they open
|
|
64
|
+
folded.
|
|
65
|
+
|
|
66
|
+
```text
|
|
67
|
+
asdu ~/Code/demo 143.9 MiB 12 sessions size↓
|
|
68
|
+
74.2 MiB ████████████ 5 /api
|
|
69
|
+
38.1 MiB ██████▏░░░░░ 3 /docs
|
|
70
|
+
|
|
71
|
+
› 23.5 MiB ████████████ codex main now ▸ Fix flaky tests (+2)
|
|
72
|
+
8.1 MiB ████▏░░░░░░░ claude main 12m ago Review the release notes
|
|
73
|
+
|
|
74
|
+
codex 019bcb82-bef5-7503 | 2026-09-09 11:52 | ~/.codex/sessions/…jsonl
|
|
75
|
+
Enter open Backspace back a action t tree / find g group f source F type s sort ? help q quit
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
- Arrow keys select rows. In trees, `↑↓` select siblings and `←→` move between
|
|
79
|
+
parents and children.
|
|
80
|
+
- `Enter` opens a folder or session brief.
|
|
81
|
+
- `Backspace` goes back or moves to the parent folder.
|
|
82
|
+
- `/` or `Ctrl-F` searches every scanned session by title, folder, or ID.
|
|
83
|
+
- `g` switches between folder, source, and all-session views.
|
|
84
|
+
- `f` filters by source.
|
|
85
|
+
- `F` filters by session type: main, child, review, or `?` when unknown.
|
|
86
|
+
- `s` changes the sort order.
|
|
87
|
+
- `t` toggles trees. `Space` folds one branch and `z` folds or opens all.
|
|
88
|
+
- `a` shows the actions supported by the selected source.
|
|
89
|
+
- `r` rescans.
|
|
90
|
+
- `q` quits.
|
|
91
|
+
|
|
92
|
+
Press `?` for help. Run `asdu --help` for command-line options.
|
|
93
|
+
|
|
94
|
+
## Session briefs
|
|
95
|
+
|
|
96
|
+
Press `Enter` on a session to see its folder, size, ID, activity, recent request,
|
|
97
|
+
last reply, and resume command.
|
|
98
|
+
|
|
99
|
+
```text
|
|
100
|
+
Center the login form
|
|
101
|
+
|
|
102
|
+
18.2 MiB claude main 2h ago
|
|
103
|
+
Folder: /demo/web-app
|
|
104
|
+
24 messages across 384 events; 0 compactions.
|
|
105
|
+
|
|
106
|
+
╭ Latest request
|
|
107
|
+
│ Why did the login page disappear?
|
|
108
|
+
│
|
|
109
|
+
├ Last reply
|
|
110
|
+
│ The login page is back and the form is centered.
|
|
111
|
+
│
|
|
112
|
+
├ First request
|
|
113
|
+
│ Move the form two pixels to the left.
|
|
114
|
+
╰
|
|
115
|
+
|
|
116
|
+
ID: demo-css-001
|
|
117
|
+
Resume: claude --resume demo-css-001
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Session actions
|
|
121
|
+
|
|
122
|
+
Browsing never changes a session. Press `a` to review an action before it runs.
|
|
123
|
+
|
|
124
|
+
Codex archive and restore use Codex itself. Codex delete is permanent. Claude
|
|
125
|
+
sessions can move to the system Trash. Tree actions include folded descendants.
|
|
126
|
+
Active Claude sessions are refused.
|
|
127
|
+
|
|
128
|
+
Successful actions append a content-free record to
|
|
129
|
+
`$XDG_STATE_HOME/asdu/actions.jsonl`, normally
|
|
130
|
+
`~/.local/state/asdu/actions.jsonl`.
|
|
131
|
+
|
|
132
|
+
## Contributing
|
|
133
|
+
|
|
134
|
+
Bug reports, UI improvements, and new session sources are welcome. Keep changes
|
|
135
|
+
small and use fictional session data in tests.
|
|
136
|
+
|
|
137
|
+
```sh
|
|
138
|
+
uv run pytest
|
|
139
|
+
uv run ruff check .
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
New sources start read-only. Add file-changing actions only when their lifecycle
|
|
143
|
+
is understood and tested.
|
|
144
|
+
|
|
145
|
+
## License
|
|
146
|
+
|
|
147
|
+
[MIT](LICENSE)
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
MANIFEST.in
|
|
3
|
+
README.md
|
|
4
|
+
asdu.py
|
|
5
|
+
asdu_browser.py
|
|
6
|
+
asdu_sessions.py
|
|
7
|
+
asdu_tui.py
|
|
8
|
+
asdu_views.py
|
|
9
|
+
pyproject.toml
|
|
10
|
+
asdu.egg-info/PKG-INFO
|
|
11
|
+
asdu.egg-info/SOURCES.txt
|
|
12
|
+
asdu.egg-info/dependency_links.txt
|
|
13
|
+
asdu.egg-info/entry_points.txt
|
|
14
|
+
asdu.egg-info/requires.txt
|
|
15
|
+
asdu.egg-info/top_level.txt
|
|
16
|
+
asdu_sources/__init__.py
|
|
17
|
+
asdu_sources/claude.py
|
|
18
|
+
asdu_sources/codex.py
|
|
19
|
+
asdu_sources/omp.py
|
|
20
|
+
tests/smoke_install.py
|
|
21
|
+
tests/test_asdu.py
|
|
22
|
+
tests/test_pty.py
|
|
23
|
+
tests/test_sources.py
|
|
24
|
+
tests/fixtures/asdu/claude-test.jsonl
|
|
25
|
+
tests/fixtures/asdu/omp-test.jsonl
|
|
26
|
+
tests/fixtures/asdu/rollout-codex.jsonl
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
send2trash>=1.8.3
|
asdu-0.4.2/asdu.py
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
#!/usr/bin/env -S uv run --script
|
|
2
|
+
# /// script
|
|
3
|
+
# requires-python = ">=3.11"
|
|
4
|
+
# dependencies = ["send2trash>=1.8.3"]
|
|
5
|
+
# ///
|
|
6
|
+
"""Command-line entry point for the local agent-session disk browser."""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
import argparse
|
|
11
|
+
import curses
|
|
12
|
+
import os
|
|
13
|
+
import sys
|
|
14
|
+
from collections.abc import Callable
|
|
15
|
+
from pathlib import Path
|
|
16
|
+
|
|
17
|
+
import asdu_sessions as store
|
|
18
|
+
import asdu_sources as sources_api
|
|
19
|
+
import asdu_tui as ui
|
|
20
|
+
import asdu_views as view
|
|
21
|
+
|
|
22
|
+
__version__ = "0.4.2"
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def default_root(variable: str, directory: str, leaf: str) -> Path:
|
|
26
|
+
home = Path(os.environ.get(variable) or Path.home() / directory)
|
|
27
|
+
return home.expanduser() / leaf
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def main() -> int:
|
|
31
|
+
try:
|
|
32
|
+
return run_main()
|
|
33
|
+
except curses.error as error:
|
|
34
|
+
print(f"asdu: terminal error: {error}", file=sys.stderr)
|
|
35
|
+
return 1
|
|
36
|
+
except KeyboardInterrupt:
|
|
37
|
+
ui.clear_terminal()
|
|
38
|
+
return 130
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def parser() -> argparse.ArgumentParser:
|
|
42
|
+
result = argparse.ArgumentParser(
|
|
43
|
+
description="ncdu-style browser for local agent session storage."
|
|
44
|
+
)
|
|
45
|
+
result.add_argument("--version", action="version", version=f"asdu {__version__}")
|
|
46
|
+
result.add_argument(
|
|
47
|
+
"command",
|
|
48
|
+
nargs="?",
|
|
49
|
+
choices=("browse", "summary", "digest"),
|
|
50
|
+
default="browse",
|
|
51
|
+
)
|
|
52
|
+
result.add_argument(
|
|
53
|
+
"--codex-root",
|
|
54
|
+
type=Path,
|
|
55
|
+
default=default_root("CODEX_HOME", ".codex", "sessions"),
|
|
56
|
+
help="Codex session storage directory",
|
|
57
|
+
)
|
|
58
|
+
result.add_argument(
|
|
59
|
+
"--claude-root",
|
|
60
|
+
type=Path,
|
|
61
|
+
default=default_root("CLAUDE_CONFIG_DIR", ".claude", "projects"),
|
|
62
|
+
help="Claude session storage directory",
|
|
63
|
+
)
|
|
64
|
+
result.add_argument(
|
|
65
|
+
"--omp-root",
|
|
66
|
+
type=Path,
|
|
67
|
+
default=Path.home() / ".omp" / "agent" / "sessions",
|
|
68
|
+
help="OMP session storage directory (read-only)",
|
|
69
|
+
)
|
|
70
|
+
result.add_argument(
|
|
71
|
+
"--source",
|
|
72
|
+
choices=("codex", "claude", "omp"),
|
|
73
|
+
action="append",
|
|
74
|
+
help="Repeat to select sources; default is all available",
|
|
75
|
+
)
|
|
76
|
+
result.add_argument(
|
|
77
|
+
"--project",
|
|
78
|
+
type=Path,
|
|
79
|
+
help="Start in this directory instead of the current directory",
|
|
80
|
+
)
|
|
81
|
+
result.add_argument(
|
|
82
|
+
"--group",
|
|
83
|
+
choices=("folder", "source", "all"),
|
|
84
|
+
default="folder",
|
|
85
|
+
help="Browse by folder, source, or all sessions",
|
|
86
|
+
)
|
|
87
|
+
result.add_argument(
|
|
88
|
+
"--sort", choices=("size", "updated", "count", "name"), default="size"
|
|
89
|
+
)
|
|
90
|
+
result.add_argument(
|
|
91
|
+
"--session", help="With 'digest', an exact session ID or unique ID prefix"
|
|
92
|
+
)
|
|
93
|
+
result.add_argument(
|
|
94
|
+
"--no-progress", action="store_true", help="Suppress scan progress"
|
|
95
|
+
)
|
|
96
|
+
result.add_argument(
|
|
97
|
+
"--ascii",
|
|
98
|
+
action="store_true",
|
|
99
|
+
help="Use plain ASCII boxes, tree markers, and ncdu-style size bars",
|
|
100
|
+
)
|
|
101
|
+
result.add_argument(
|
|
102
|
+
"--no-color",
|
|
103
|
+
action="store_true",
|
|
104
|
+
help="Disable colors; retain bold, dim, and selection (also respects NO_COLOR)",
|
|
105
|
+
)
|
|
106
|
+
return result
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
def run_main() -> int:
|
|
110
|
+
argument_parser = parser()
|
|
111
|
+
args = argument_parser.parse_args()
|
|
112
|
+
view.ASCII_UI = args.ascii
|
|
113
|
+
args.group = {"folder": "cwd"}.get(args.group, args.group)
|
|
114
|
+
args.sort = {"updated": "date"}.get(args.sort, args.sort)
|
|
115
|
+
if args.command == "summary" and args.group == "all":
|
|
116
|
+
argument_parser.error(
|
|
117
|
+
"summary cannot be grouped by all sessions; use folder or source"
|
|
118
|
+
)
|
|
119
|
+
if args.group == "all" and args.sort == "count":
|
|
120
|
+
argument_parser.error(
|
|
121
|
+
"--sort count applies to folder and source groups, not sessions"
|
|
122
|
+
)
|
|
123
|
+
|
|
124
|
+
adapters = sources_api.source_adapters(
|
|
125
|
+
args.codex_root, args.claude_root, args.omp_root
|
|
126
|
+
)
|
|
127
|
+
sources = tuple(dict.fromkeys(args.source or adapters))
|
|
128
|
+
source_roots = {
|
|
129
|
+
source: adapters[source].root
|
|
130
|
+
for source in sources
|
|
131
|
+
if adapters[source].root.exists()
|
|
132
|
+
}
|
|
133
|
+
if args.source:
|
|
134
|
+
for source in sources:
|
|
135
|
+
root = adapters[source].root
|
|
136
|
+
if not root.exists():
|
|
137
|
+
argument_parser.error(f"{source} session root does not exist: {root}")
|
|
138
|
+
elif not source_roots:
|
|
139
|
+
argument_parser.error(
|
|
140
|
+
"no supported session roots found; pass --codex-root, --claude-root, or --omp-root"
|
|
141
|
+
)
|
|
142
|
+
start = (args.project or Path.cwd()).resolve()
|
|
143
|
+
|
|
144
|
+
def scan_current(
|
|
145
|
+
render: Callable[[str, int, int, int, int], None] | None = None,
|
|
146
|
+
) -> list[store.Session]:
|
|
147
|
+
progress = ui.ScanProgress(
|
|
148
|
+
render is not None
|
|
149
|
+
or (
|
|
150
|
+
not args.no_progress
|
|
151
|
+
and args.command == "browse"
|
|
152
|
+
and sys.stderr.isatty()
|
|
153
|
+
),
|
|
154
|
+
render,
|
|
155
|
+
)
|
|
156
|
+
try:
|
|
157
|
+
return sources_api.scan(sources, adapters, progress)
|
|
158
|
+
finally:
|
|
159
|
+
progress.finish()
|
|
160
|
+
|
|
161
|
+
sessions = scan_current()
|
|
162
|
+
if args.command == "summary":
|
|
163
|
+
scoped = (
|
|
164
|
+
sessions
|
|
165
|
+
if start == Path("/")
|
|
166
|
+
else [session for session in sessions if store.in_scope(session, start)]
|
|
167
|
+
)
|
|
168
|
+
view.print_summary(scoped, args.group, args.sort)
|
|
169
|
+
elif args.command == "digest":
|
|
170
|
+
if not args.session:
|
|
171
|
+
argument_parser.error("digest requires --session SESSION_ID")
|
|
172
|
+
matches = [
|
|
173
|
+
session
|
|
174
|
+
for session in sessions
|
|
175
|
+
if session.session_id.startswith(args.session)
|
|
176
|
+
]
|
|
177
|
+
if not matches:
|
|
178
|
+
argument_parser.error(f"no session begins with: {args.session}")
|
|
179
|
+
if len(matches) > 1:
|
|
180
|
+
argument_parser.error(
|
|
181
|
+
f"session prefix is ambiguous ({len(matches)} matches); provide more characters"
|
|
182
|
+
)
|
|
183
|
+
print(view.session_brief(matches[0], sessions))
|
|
184
|
+
else:
|
|
185
|
+
ui.tui(
|
|
186
|
+
sessions,
|
|
187
|
+
args.group,
|
|
188
|
+
args.sort,
|
|
189
|
+
start,
|
|
190
|
+
scan_current,
|
|
191
|
+
no_color=args.no_color,
|
|
192
|
+
source_roots=source_roots,
|
|
193
|
+
)
|
|
194
|
+
return 0
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
if __name__ == "__main__":
|
|
198
|
+
raise SystemExit(main())
|