klaude-code 2.5.3__py3-none-any.whl → 2.7.0__py3-none-any.whl
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.
- klaude_code/app/runtime.py +1 -1
- klaude_code/auth/__init__.py +10 -0
- klaude_code/auth/env.py +81 -0
- klaude_code/cli/auth_cmd.py +87 -8
- klaude_code/cli/config_cmd.py +5 -5
- klaude_code/cli/cost_cmd.py +159 -60
- klaude_code/cli/main.py +146 -65
- klaude_code/cli/self_update.py +7 -7
- klaude_code/config/builtin_config.py +23 -9
- klaude_code/config/config.py +19 -9
- klaude_code/const.py +10 -1
- klaude_code/core/reminders.py +4 -5
- klaude_code/core/turn.py +8 -9
- klaude_code/llm/google/client.py +12 -0
- klaude_code/llm/openai_compatible/stream.py +5 -1
- klaude_code/llm/openrouter/client.py +1 -0
- klaude_code/protocol/commands.py +0 -1
- klaude_code/protocol/events.py +214 -0
- klaude_code/protocol/sub_agent/image_gen.py +0 -4
- klaude_code/session/session.py +51 -18
- klaude_code/skill/loader.py +12 -13
- klaude_code/skill/manager.py +3 -3
- klaude_code/tui/command/__init__.py +1 -4
- klaude_code/tui/command/copy_cmd.py +1 -1
- klaude_code/tui/command/fork_session_cmd.py +4 -4
- klaude_code/tui/commands.py +0 -5
- klaude_code/tui/components/command_output.py +1 -1
- klaude_code/tui/components/metadata.py +4 -5
- klaude_code/tui/components/rich/markdown.py +60 -0
- klaude_code/tui/components/rich/theme.py +8 -0
- klaude_code/tui/components/sub_agent.py +6 -0
- klaude_code/tui/components/user_input.py +38 -27
- klaude_code/tui/display.py +11 -1
- klaude_code/tui/input/AGENTS.md +44 -0
- klaude_code/tui/input/completers.py +21 -21
- klaude_code/tui/input/drag_drop.py +197 -0
- klaude_code/tui/input/images.py +227 -0
- klaude_code/tui/input/key_bindings.py +173 -19
- klaude_code/tui/input/paste.py +71 -0
- klaude_code/tui/input/prompt_toolkit.py +13 -3
- klaude_code/tui/machine.py +90 -56
- klaude_code/tui/renderer.py +1 -62
- klaude_code/tui/runner.py +1 -1
- klaude_code/tui/terminal/image.py +40 -9
- klaude_code/tui/terminal/selector.py +52 -2
- {klaude_code-2.5.3.dist-info → klaude_code-2.7.0.dist-info}/METADATA +32 -40
- {klaude_code-2.5.3.dist-info → klaude_code-2.7.0.dist-info}/RECORD +49 -54
- klaude_code/cli/session_cmd.py +0 -87
- klaude_code/protocol/events/__init__.py +0 -63
- klaude_code/protocol/events/base.py +0 -18
- klaude_code/protocol/events/chat.py +0 -30
- klaude_code/protocol/events/lifecycle.py +0 -23
- klaude_code/protocol/events/metadata.py +0 -16
- klaude_code/protocol/events/streaming.py +0 -43
- klaude_code/protocol/events/system.py +0 -56
- klaude_code/protocol/events/tools.py +0 -27
- klaude_code/tui/command/terminal_setup_cmd.py +0 -248
- klaude_code/tui/input/clipboard.py +0 -152
- {klaude_code-2.5.3.dist-info → klaude_code-2.7.0.dist-info}/WHEEL +0 -0
- {klaude_code-2.5.3.dist-info → klaude_code-2.7.0.dist-info}/entry_points.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: klaude-code
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.7.0
|
|
4
4
|
Summary: Minimal code agent CLI
|
|
5
5
|
Requires-Dist: anthropic>=0.66.0
|
|
6
6
|
Requires-Dist: chardet>=5.2.0
|
|
@@ -9,15 +9,13 @@ Requires-Dist: diff-match-patch>=20241021
|
|
|
9
9
|
Requires-Dist: google-genai>=1.56.0
|
|
10
10
|
Requires-Dist: markdown-it-py>=4.0.0
|
|
11
11
|
Requires-Dist: openai>=1.102.0
|
|
12
|
-
Requires-Dist: pillow>=9.1,<11.0
|
|
13
12
|
Requires-Dist: prompt-toolkit>=3.0.52
|
|
14
13
|
Requires-Dist: pydantic>=2.11.7
|
|
15
14
|
Requires-Dist: pyyaml>=6.0.2
|
|
16
15
|
Requires-Dist: rich>=14.1.0
|
|
17
|
-
Requires-Dist: term-image>=0.7.2
|
|
18
16
|
Requires-Dist: trafilatura>=2.0.0
|
|
19
17
|
Requires-Dist: typer>=0.17.3
|
|
20
|
-
Requires-Python: >=3.13
|
|
18
|
+
Requires-Python: >=3.13
|
|
21
19
|
Description-Content-Type: text/markdown
|
|
22
20
|
|
|
23
21
|
# Klaude Code
|
|
@@ -52,32 +50,31 @@ To update:
|
|
|
52
50
|
uv tool upgrade klaude-code
|
|
53
51
|
```
|
|
54
52
|
|
|
55
|
-
Or use the built-in
|
|
53
|
+
Or use the built-in command:
|
|
56
54
|
|
|
57
55
|
```bash
|
|
58
|
-
klaude update
|
|
59
56
|
klaude upgrade
|
|
60
|
-
klaude --version
|
|
61
|
-
|
|
62
57
|
```
|
|
63
58
|
|
|
64
59
|
## Usage
|
|
65
60
|
|
|
66
61
|
```bash
|
|
67
|
-
klaude [--model <name>] [--
|
|
62
|
+
klaude [--model [<name>]] [--continue] [--resume [<id>]]
|
|
68
63
|
```
|
|
69
64
|
|
|
70
65
|
**Options:**
|
|
71
|
-
- `--model`/`-m`:
|
|
72
|
-
- `--
|
|
66
|
+
- `--model`/`-m`: Choose a model.
|
|
67
|
+
- `--model` (no value): opens the interactive selector.
|
|
68
|
+
- `--model <value>`: resolves `<value>` to a single model; if it can't, it opens the interactive selector filtered by `<value>`.
|
|
73
69
|
- `--continue`/`-c`: Resume the most recent session.
|
|
74
|
-
- `--resume`/`-r`:
|
|
75
|
-
- `--resume
|
|
70
|
+
- `--resume`/`-r`: Resume a session.
|
|
71
|
+
- `--resume` (no value): select a session to resume for this project.
|
|
72
|
+
- `--resume <id>`: resume a session by its ID directly.
|
|
76
73
|
- `--vanilla`: Minimal mode with only basic tools (Bash, Read, Edit, Write) and no system prompts.
|
|
77
74
|
|
|
78
75
|
**Model selection behavior:**
|
|
79
76
|
- Default: uses `main_model` from config.
|
|
80
|
-
- `--
|
|
77
|
+
- `--model` (no value): always prompts you to pick.
|
|
81
78
|
- `--model <value>`: tries to resolve `<value>` to a single model; if it can't, it prompts with a filtered list (and falls back to showing all models if there are no matches).
|
|
82
79
|
|
|
83
80
|
**Debug Options:**
|
|
@@ -125,24 +122,34 @@ klaude list
|
|
|
125
122
|
|
|
126
123
|
Models from providers without a valid API key are shown as dimmed/unavailable.
|
|
127
124
|
|
|
128
|
-
####
|
|
125
|
+
#### Authentication
|
|
129
126
|
|
|
130
|
-
|
|
127
|
+
Use the auth command to configure API keys or login to subscription-based providers:
|
|
131
128
|
|
|
132
129
|
```bash
|
|
133
130
|
# Interactive provider selection
|
|
134
|
-
klaude login
|
|
135
|
-
|
|
136
|
-
#
|
|
137
|
-
klaude login
|
|
138
|
-
klaude login
|
|
131
|
+
klaude auth login
|
|
132
|
+
|
|
133
|
+
# Configure API keys
|
|
134
|
+
klaude auth login anthropic # Set ANTHROPIC_API_KEY
|
|
135
|
+
klaude auth login openai # Set OPENAI_API_KEY
|
|
136
|
+
klaude auth login google # Set GOOGLE_API_KEY
|
|
137
|
+
klaude auth login openrouter # Set OPENROUTER_API_KEY
|
|
138
|
+
klaude auth login deepseek # Set DEEPSEEK_API_KEY
|
|
139
|
+
klaude auth login moonshot # Set MOONSHOT_API_KEY
|
|
140
|
+
|
|
141
|
+
# OAuth login for subscription-based providers
|
|
142
|
+
klaude auth login claude # Claude Pro/Max subscription
|
|
143
|
+
klaude auth login codex # ChatGPT Pro subscription
|
|
139
144
|
```
|
|
140
145
|
|
|
141
|
-
|
|
146
|
+
API keys are stored in `~/.klaude/klaude-auth.json` and used as fallback when environment variables are not set.
|
|
147
|
+
|
|
148
|
+
To logout from OAuth providers:
|
|
142
149
|
|
|
143
150
|
```bash
|
|
144
|
-
klaude logout claude
|
|
145
|
-
klaude logout codex
|
|
151
|
+
klaude auth logout claude
|
|
152
|
+
klaude auth logout codex
|
|
146
153
|
```
|
|
147
154
|
|
|
148
155
|
#### Custom Configuration
|
|
@@ -152,7 +159,7 @@ User config file: `~/.klaude/klaude-config.yaml`
|
|
|
152
159
|
Open in editor:
|
|
153
160
|
|
|
154
161
|
```bash
|
|
155
|
-
klaude
|
|
162
|
+
klaude conf
|
|
156
163
|
```
|
|
157
164
|
|
|
158
165
|
##### Model Configuration
|
|
@@ -208,21 +215,6 @@ List configured providers and models:
|
|
|
208
215
|
klaude list
|
|
209
216
|
```
|
|
210
217
|
|
|
211
|
-
### Session Management
|
|
212
|
-
|
|
213
|
-
Clean up sessions with few messages:
|
|
214
|
-
|
|
215
|
-
```bash
|
|
216
|
-
# Remove sessions with fewer than 5 messages (default)
|
|
217
|
-
klaude session clean
|
|
218
|
-
|
|
219
|
-
# Remove sessions with fewer than 10 messages
|
|
220
|
-
klaude session clean --min 10
|
|
221
|
-
|
|
222
|
-
# Remove all sessions for the current project
|
|
223
|
-
klaude session clean-all
|
|
224
|
-
```
|
|
225
|
-
|
|
226
218
|
### Cost Tracking
|
|
227
219
|
|
|
228
220
|
View aggregated usage statistics across all sessions:
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
klaude_code/.DS_Store,sha256=cLWFbSgdN0bXEd3_tz93BJSposEPafUBqSr7t-3lPbA,6148
|
|
2
2
|
klaude_code/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
3
|
klaude_code/app/__init__.py,sha256=7mgWpN9SFDqe8AW44bBn9M19nVsBcZURrsGB_8l2hrU,264
|
|
4
|
-
klaude_code/app/runtime.py,sha256=
|
|
5
|
-
klaude_code/auth/__init__.py,sha256=
|
|
4
|
+
klaude_code/app/runtime.py,sha256=xo5_oxc80kjoF1h5IWSEWukRwdA257JzakC_VgcikII,5976
|
|
5
|
+
klaude_code/auth/__init__.py,sha256=4Rlp-JkYkmYu38oifN79PNHyFU2WzzcDDp7pG0QmlAE,677
|
|
6
6
|
klaude_code/auth/base.py,sha256=ccH2sC0TWB5lPpGm4FSjCgnehwn9riYiXxHCh2iFJe0,3011
|
|
7
7
|
klaude_code/auth/claude/__init__.py,sha256=h1oyqEttDM5TAF6w1Stk6YXYMsbATjODCsi6GhU4zAA,218
|
|
8
8
|
klaude_code/auth/claude/exceptions.py,sha256=_3KbC6W7_gWpxTsSqI0Bxk5Q_v3Fad6dBjweEsoFun4,246
|
|
@@ -13,24 +13,24 @@ klaude_code/auth/codex/exceptions.py,sha256=TcAKPozsY3SCh_krTYFlJ8FU5jepgSTg-5UO
|
|
|
13
13
|
klaude_code/auth/codex/jwt_utils.py,sha256=tuaJKT4vAIGeaQjNzgNcHWGrYYSDrDeaQT9h4cw5Us8,1134
|
|
14
14
|
klaude_code/auth/codex/oauth.py,sha256=4hAGZ2Dv87NC3loEws7U5yNyPyIrryGm5YXY2FkHeyo,7840
|
|
15
15
|
klaude_code/auth/codex/token_manager.py,sha256=EiEdxEErh_mcnW8USWbvdbN91LK7nyk0PZJZGmdUTG8,1405
|
|
16
|
+
klaude_code/auth/env.py,sha256=QLqV2QjVCAAPSaH2xm2W0KvQ-RSbRxk_Y_FSH_MGDNY,2550
|
|
16
17
|
klaude_code/cli/__init__.py,sha256=YzlAoWAr5rx5oe6B_4zPxRFS4QaZauuy1AFwampP5fg,45
|
|
17
|
-
klaude_code/cli/auth_cmd.py,sha256=
|
|
18
|
-
klaude_code/cli/config_cmd.py,sha256=
|
|
19
|
-
klaude_code/cli/cost_cmd.py,sha256=
|
|
18
|
+
klaude_code/cli/auth_cmd.py,sha256=mgnFav918Mx5KyXNX3dAFC3Ps-CW4Ym3LYHK_ro6nBs,8721
|
|
19
|
+
klaude_code/cli/config_cmd.py,sha256=7BmZpKeiO24mKKLKGO46WvSQzSaNwuZ3KtCV4GH-Yh0,3306
|
|
20
|
+
klaude_code/cli/cost_cmd.py,sha256=NNykvNxQn3QvFTe5FYM2RIRskZi97rrbKhAxC5o8Fag,17579
|
|
20
21
|
klaude_code/cli/debug.py,sha256=vEHOjObhrIHDAXk3q6cOgeW2NZxCx5AWM1rJ6FiJnVU,1901
|
|
21
22
|
klaude_code/cli/list_model.py,sha256=dzXwahAZZv8NHPD4pvOTLaTJTEWnCjS1B-K52n3OHOs,13603
|
|
22
|
-
klaude_code/cli/main.py,sha256=
|
|
23
|
-
klaude_code/cli/self_update.py,sha256=
|
|
24
|
-
klaude_code/cli/session_cmd.py,sha256=eZv6sx45bA1GDW_VA0_171-S4JBUB4jfW5tpOPako_g,2995
|
|
23
|
+
klaude_code/cli/main.py,sha256=IHw0syuJW6cFPurghM9w_X_t-m5PUOvWxlcoefhYvXc,12224
|
|
24
|
+
klaude_code/cli/self_update.py,sha256=1xdG9ifvRZQDSx6RAtSSgXmw9hZNXMLvqC2zu4bS-GY,2622
|
|
25
25
|
klaude_code/config/__init__.py,sha256=Qe1BeMekBfO2-Zd30x33lB70hdM1QQZGrp4DbWSQ-II,353
|
|
26
26
|
klaude_code/config/assets/__init__.py,sha256=uMUfmXT3I-gYiI-HVr1DrE60mx5cY1o8V7SYuGqOmvY,32
|
|
27
27
|
klaude_code/config/assets/builtin_config.yaml,sha256=iTD_GfQ2pgo_fYe_2vfs6nmEf-oABbWdF2wCXzW8yDY,7782
|
|
28
|
-
klaude_code/config/builtin_config.py,sha256=
|
|
29
|
-
klaude_code/config/config.py,sha256=
|
|
28
|
+
klaude_code/config/builtin_config.py,sha256=olAP0lRHMn4gCjCFu3K6l6rGqdRm0YMmgAdwqDOZp_w,2080
|
|
29
|
+
klaude_code/config/config.py,sha256=MinPsZH6h2MdmnJiX9F6VpaZHkKb1iG-zV90i6dJq1s,25665
|
|
30
30
|
klaude_code/config/model_matcher.py,sha256=3IlLU5h3NDh_bURbCW-PV027C3irG3hyitwj1cj99Ig,6179
|
|
31
31
|
klaude_code/config/sub_agent_model_helper.py,sha256=fI-OIZWFI4116qjalsZj2pIi0waPR1cXE-OKrVMFS6g,8064
|
|
32
32
|
klaude_code/config/thinking.py,sha256=RDWH8UYbeDoIKPXaCIcvVwPAh07Ntaq8w5Zn_fhm-Fk,9329
|
|
33
|
-
klaude_code/const.py,sha256=
|
|
33
|
+
klaude_code/const.py,sha256=PxQg86WxcTy58Yq9TtsbU4nVkiWhV7RIcai-ZoP_P6Q,11487
|
|
34
34
|
klaude_code/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
35
35
|
klaude_code/core/agent.py,sha256=5TNzzzHgKLKpEcFhaM0d136kaGUn_mESC8b1nLoxS2o,3913
|
|
36
36
|
klaude_code/core/agent_profile.py,sha256=EAsAHj9Jd_JaL_ydr13I3uVoBN4RIm9zmKPn3H7NYu8,12817
|
|
@@ -50,7 +50,7 @@ klaude_code/core/prompts/prompt-sub-agent-explore.md,sha256=21kFodjhvN0L-c_ZFo4y
|
|
|
50
50
|
klaude_code/core/prompts/prompt-sub-agent-image-gen.md,sha256=tXYKSzFd04OiC0dmVO9suMKeD5f9qo_4NsvqGo7irfI,78
|
|
51
51
|
klaude_code/core/prompts/prompt-sub-agent-web.md,sha256=UwrO5M_jPUbee_8lL7gB-2VFFLxvzEejluXDkMzmR5A,3625
|
|
52
52
|
klaude_code/core/prompts/prompt-sub-agent.md,sha256=dmmdsOenbAOfqG6FmdR88spOLZkXmntDBs-cmZ9DN_g,897
|
|
53
|
-
klaude_code/core/reminders.py,sha256=
|
|
53
|
+
klaude_code/core/reminders.py,sha256=_hD2n_QOuKZvty9o6UtndAOirhntfoO1EmmNCohrSOQ,24350
|
|
54
54
|
klaude_code/core/task.py,sha256=rAgulw45GT1NMhe2P5aLCdCnAa_hOZxKzEAaPYMc6Jk,13982
|
|
55
55
|
klaude_code/core/tool/__init__.py,sha256=ABUzLwQbBoZPirCcgYbI88GEtswfy1JBDkFUsGpQ-zc,1415
|
|
56
56
|
klaude_code/core/tool/context.py,sha256=lHMjbLE--WVek8gAPOvaHz4CdeRGzLXSusMyEdEU5ss,2961
|
|
@@ -89,7 +89,7 @@ klaude_code/core/tool/web/web_fetch_tool.md,sha256=i0IwsZ6r9vAQeCpwDBtEGrWmHPzZk
|
|
|
89
89
|
klaude_code/core/tool/web/web_fetch_tool.py,sha256=jXbJTgpI_RvyXy5ac8qIrC-AKOUX1fJ3TpqXq_BfkS4,9596
|
|
90
90
|
klaude_code/core/tool/web/web_search_tool.md,sha256=l5gGPx-fXHFel1zLBljm8isy9pwEYXGrq5cFzzw1VBw,1135
|
|
91
91
|
klaude_code/core/tool/web/web_search_tool.py,sha256=ljkgXxP6L5nJnbYB_IOUtPUN9zA_h5hBD55lhNAja08,4293
|
|
92
|
-
klaude_code/core/turn.py,sha256=
|
|
92
|
+
klaude_code/core/turn.py,sha256=YW1tpMqCz4jEtLej0cpDy9tbs4vTFV7Cl8-5vTPCrQc,18526
|
|
93
93
|
klaude_code/llm/__init__.py,sha256=b4AsqnrMIs0a5qR_ti6rZcHwFzAReTwOW96EqozEoSo,287
|
|
94
94
|
klaude_code/llm/anthropic/__init__.py,sha256=PWETvaeNAAX3ue0ww1uRUIxTJG0RpWiutkn7MlwKxBs,67
|
|
95
95
|
klaude_code/llm/anthropic/client.py,sha256=RpYw4UQnhLzAsp6i-FU7cDW4deqngdAoQaTPGnCeO5U,17346
|
|
@@ -102,17 +102,17 @@ klaude_code/llm/client.py,sha256=2PRxcKBHRk7csw-swglsmLJfYUpbJn6tzNqMb5fJBvE,182
|
|
|
102
102
|
klaude_code/llm/codex/__init__.py,sha256=8vN2j2ezWB_UVpfqQ8ooStsBeLL5SY4SUMXOXdWiMaI,132
|
|
103
103
|
klaude_code/llm/codex/client.py,sha256=d2pDHKokQAaMfnWRoliBtTtjeyElQiPjSwNWyjW_PRs,5389
|
|
104
104
|
klaude_code/llm/google/__init__.py,sha256=tQtf_mh_mC3E4S9XAsnhS2JZXGRnYUsBKF0jpXZTvM0,61
|
|
105
|
-
klaude_code/llm/google/client.py,sha256=
|
|
105
|
+
klaude_code/llm/google/client.py,sha256=nBkAyB_LFtEpdFE8NmD64kEZI1Ft24P2U1_yAeYaEPw,21154
|
|
106
106
|
klaude_code/llm/google/input.py,sha256=ErbpSmmv8wOaxSO7b2KSZqPgKvRJo1m4deW-JTzN5CU,8798
|
|
107
107
|
klaude_code/llm/image.py,sha256=jt9FBPFhAIo48pauIEJMIhB9WuDt4wwNs9s3LiEsETE,4272
|
|
108
108
|
klaude_code/llm/input_common.py,sha256=-GnZ87BfzyGqXTP3WYflFOqbRcbKpJjE9mjIv8qKWsQ,6228
|
|
109
109
|
klaude_code/llm/openai_compatible/__init__.py,sha256=ACGpnki7k53mMcCl591aw99pm9jZOZk0ghr7atOfNps,81
|
|
110
110
|
klaude_code/llm/openai_compatible/client.py,sha256=9epE7B58UX-Rr8Zw62AwVv1uonajzcT2RLjreQTQ_PU,4683
|
|
111
111
|
klaude_code/llm/openai_compatible/input.py,sha256=VpgT2wbph6bFsB6OFWKnIdjE32W_gKA_p39T-xuJPrE,3217
|
|
112
|
-
klaude_code/llm/openai_compatible/stream.py,sha256=
|
|
112
|
+
klaude_code/llm/openai_compatible/stream.py,sha256=QBmhhQT7b1WjlDd8VfpNjbnbjxuao5cBa78vM8vxucQ,16057
|
|
113
113
|
klaude_code/llm/openai_compatible/tool_call_accumulator.py,sha256=quajimkUR1uSIPVXYsVNiQSTnOSVt7WuyZ23RyT7lJs,4906
|
|
114
114
|
klaude_code/llm/openrouter/__init__.py,sha256=_As8lHjwj6vapQhLorZttTpukk5ZiCdhFdGT38_ASPo,69
|
|
115
|
-
klaude_code/llm/openrouter/client.py,sha256=
|
|
115
|
+
klaude_code/llm/openrouter/client.py,sha256=P_mDQK4_i1MLF0jK4p_bKhh15ACXgw6Ie0rUrtbfsdM,5738
|
|
116
116
|
klaude_code/llm/openrouter/input.py,sha256=Z_Cf6TnMZ5KQNJ0E5IIDCKK2OWlzi8IW0S5A72BBGT0,6176
|
|
117
117
|
klaude_code/llm/openrouter/reasoning.py,sha256=u7ccfnGxJ4Ws8P3X5FW91d8HXie29JjeWz0hZ1r0oFg,3320
|
|
118
118
|
klaude_code/llm/partial_message.py,sha256=-sjlpV-et4ViBtBpdtihK5QBjAlwS47-mBpVbRQPP3s,142
|
|
@@ -124,15 +124,8 @@ klaude_code/llm/stream_parts.py,sha256=kU40BaWyiKOqzrIwF0_IwogWgKRRqVEt-6MvwMi5J
|
|
|
124
124
|
klaude_code/llm/usage.py,sha256=L6w-DlZ3oF8lOR_SEudPBM9idzIy7__f5FZ4ZJ2smi8,5957
|
|
125
125
|
klaude_code/log.py,sha256=i9iVCmp4dxqxqH_7XPMVjZt8umiH1KPhRbX4Ao93mSM,11382
|
|
126
126
|
klaude_code/protocol/__init__.py,sha256=TTPnuyQ22RypoTGKdoiS7ZEgHzinuaRHUrauzHDh7Xo,246
|
|
127
|
-
klaude_code/protocol/commands.py,sha256=
|
|
128
|
-
klaude_code/protocol/events
|
|
129
|
-
klaude_code/protocol/events/base.py,sha256=QfqgksjA2Hj-ClmwKVeJ7QA6Z7YdzjswO1NfAVnPCoI,335
|
|
130
|
-
klaude_code/protocol/events/chat.py,sha256=mI_Ks5IIU1ZiywclQYxzhSsGA3ga7ACKShU6d9_KqSs,731
|
|
131
|
-
klaude_code/protocol/events/lifecycle.py,sha256=gykOiAvdxMrvZ9Jm2T_qlve6Iw70C23o2HRooR0rHg4,389
|
|
132
|
-
klaude_code/protocol/events/metadata.py,sha256=VcktYa6k51vIQ1H_KeOqQYCZkX0K9gaCQR1neOAOENs,313
|
|
133
|
-
klaude_code/protocol/events/streaming.py,sha256=U1plGQSTeGZa3E4fIxW_fHXJpuv_DSIBrmGh1l4Fm54,708
|
|
134
|
-
klaude_code/protocol/events/system.py,sha256=FjAnZso1jpOY2nY7DgehuFvBtu_gh5uZqimmpgKbaMA,1392
|
|
135
|
-
klaude_code/protocol/events/tools.py,sha256=8ds_8Zj-wQWvHNAvNt1-fSIHeDffw1dsLWI7ByrAqcM,617
|
|
127
|
+
klaude_code/protocol/commands.py,sha256=ZgD0GoAT6j5yfF29FIupiKCcP9bq5wxUeDaqFoReOHc,733
|
|
128
|
+
klaude_code/protocol/events.py,sha256=hn0mM0AOu8nF5lOPoTMQNMsVXOGbBVLh4M5Y9lTE3a0,4284
|
|
136
129
|
klaude_code/protocol/llm_param.py,sha256=mFdAcbzJrIFB4T2QCbLyeZxZQ_38lUNCclEZIH3eWtQ,5191
|
|
137
130
|
klaude_code/protocol/message.py,sha256=pu-wvInS781y-qSKbl9MqO7k3CtAN7Yu4hUHJCXKjZQ,6210
|
|
138
131
|
klaude_code/protocol/model.py,sha256=KboyTyfG5DntRMK98oDHomgJfUpHBdeiq51dWXRSqeM,9923
|
|
@@ -141,7 +134,7 @@ klaude_code/protocol/op_handler.py,sha256=B-dmye-6fgQNUDSa2s9cnHogz_Jl4yoQ9EiNgk
|
|
|
141
134
|
klaude_code/protocol/sub_agent/AGENTS.md,sha256=DHeHl11PYprTOQxInENCEnwnh3kIztBLjvETkwWAO08,1299
|
|
142
135
|
klaude_code/protocol/sub_agent/__init__.py,sha256=RKPFJawd0AB7nRYBxdwuG-14D8pT6HF1-DPCTAxwohI,3784
|
|
143
136
|
klaude_code/protocol/sub_agent/explore.py,sha256=f3fHTyxVeEH4vxJtEts0FbZhdrhOR-_x94QMfNicuUI,1859
|
|
144
|
-
klaude_code/protocol/sub_agent/image_gen.py,sha256=
|
|
137
|
+
klaude_code/protocol/sub_agent/image_gen.py,sha256=npNEOIsMV-1QOvewdb3NFMkG25Fz8wTJe7cxpPO2mWs,4234
|
|
145
138
|
klaude_code/protocol/sub_agent/task.py,sha256=ZOjzK1itxehlva6WfGKKAJq8FvBOKAywrlgGgfb4Tp4,3441
|
|
146
139
|
klaude_code/protocol/sub_agent/web.py,sha256=XOQdqlIp_xno7Q7YVFPFo4AyKU1wbrVKhIi-NxY8eYM,2506
|
|
147
140
|
klaude_code/protocol/tools.py,sha256=T0mzW9EhidVMNkwH-KTeB5FgwMvXBnV_MYE5ytrU1TM,343
|
|
@@ -149,7 +142,7 @@ klaude_code/session/__init__.py,sha256=4sw81uQvEd3YUOOjamKk1KqGmxeb4Ic9T1Tee5zzt
|
|
|
149
142
|
klaude_code/session/codec.py,sha256=a374UZkOusn9MgFCc--yznDljK_4Qfy6yDPfhQq5_P0,1889
|
|
150
143
|
klaude_code/session/export.py,sha256=znoTUCw2tVGgDpl-sT-ba_2Bb2HaH6pvsl4EpLUdYJQ,46102
|
|
151
144
|
klaude_code/session/selector.py,sha256=snBpnz9UQCe_0K8HttSGCJECCE4YEzpWs_Fdmk2P9nI,2195
|
|
152
|
-
klaude_code/session/session.py,sha256=
|
|
145
|
+
klaude_code/session/session.py,sha256=7C_zMIrJGYQw-opeQdLP23OAf3wxjHTVEg7Xe2QM-C4,25029
|
|
153
146
|
klaude_code/session/store.py,sha256=HRrmFzwEVdExqDQlT9FBZOhlFtQmM9Im9zco8pzvUMY,6455
|
|
154
147
|
klaude_code/session/templates/export_session.html,sha256=y4H2DwYx29MuSeKgT8JWdZKNguemaDKN-b75x0sr0eU,127667
|
|
155
148
|
klaude_code/session/templates/mermaid_viewer.html,sha256=Y_wEWFm4mKWpfAz3YMis5DdLEkhw_2d8CpU6jbvGZow,27842
|
|
@@ -160,18 +153,18 @@ klaude_code/skill/assets/create-plan/SKILL.md,sha256=g_SLyBid2dwj56FBzh87lZGu1t0
|
|
|
160
153
|
klaude_code/skill/assets/deslop/SKILL.md,sha256=XMBER6gOyYnZof_u7l30CZSzmDcINe8XP-n_loah0EQ,873
|
|
161
154
|
klaude_code/skill/assets/handoff/SKILL.md,sha256=GDHrEqWUeAQy7gGhha_y5jzjpv8C-xhk0hqMH5h59v8,1712
|
|
162
155
|
klaude_code/skill/assets/skill-creator/SKILL.md,sha256=0ByoWb9ao0UKSoM5Tmz-Qe5CAPliTrVpUK0gPd9TFqo,5520
|
|
163
|
-
klaude_code/skill/loader.py,sha256=
|
|
164
|
-
klaude_code/skill/manager.py,sha256=
|
|
156
|
+
klaude_code/skill/loader.py,sha256=g3MNDBq4B4_hf_d1NXf0Zhw3Xu9M2GIiaUZIN6S1ikM,8706
|
|
157
|
+
klaude_code/skill/manager.py,sha256=6N1sfa0a5a7NgQgj3M_rRO2aj0vecyeBp_kWOZg211c,3452
|
|
165
158
|
klaude_code/skill/system_skills.py,sha256=ryGN07t0Xv2Yn_Prfq072tdIN0Dp4ZpdXLTl7O7rCkg,6122
|
|
166
159
|
klaude_code/tui/__init__.py,sha256=Q8-0D-uesw3oFwHcFLD5UaWlTFbrj8qV7dSn6C6_g_o,274
|
|
167
|
-
klaude_code/tui/command/__init__.py,sha256=
|
|
160
|
+
klaude_code/tui/command/__init__.py,sha256=SyEvpvytaRTv-6sJpJzlv142GUfLRYc2k5z2ZqWKxD8,3305
|
|
168
161
|
klaude_code/tui/command/clear_cmd.py,sha256=9stN0blD24sME_xvTae0gN1r9caZA7QmLWnxzhTB4iA,744
|
|
169
162
|
klaude_code/tui/command/command_abc.py,sha256=sTzn0LAJguDKPrXK-0wkiadf0jQuAtuXbDMfDZJ4pqk,2438
|
|
170
|
-
klaude_code/tui/command/copy_cmd.py,sha256=
|
|
163
|
+
klaude_code/tui/command/copy_cmd.py,sha256=2gjKYTbOspmVotD8FrU7oQgwyNxdcjYP0iLKs6AXcL4,1792
|
|
171
164
|
klaude_code/tui/command/debug_cmd.py,sha256=cXi2ymcsbcJVCKfVKPvtUFPOmgNFEpwG-IcLlnkiyZY,2698
|
|
172
165
|
klaude_code/tui/command/export_cmd.py,sha256=KdFlOMJ6gruKYnd_24eWJJb21t9gLVwI1FnN1s08m5U,1609
|
|
173
166
|
klaude_code/tui/command/export_online_cmd.py,sha256=34De0K486wNOC5yjjPemcGTILrKQhWld2qfV3c0PUQ8,5664
|
|
174
|
-
klaude_code/tui/command/fork_session_cmd.py,sha256=
|
|
167
|
+
klaude_code/tui/command/fork_session_cmd.py,sha256=mBLrRCbBYW5en73gmNBDu0AuN_AvUs_mOEpJL7Sr37k,9220
|
|
175
168
|
klaude_code/tui/command/model_cmd.py,sha256=EnUcr_nnUm433G2HwEKKNssVE767IgQFNoc9etxPpmY,1734
|
|
176
169
|
klaude_code/tui/command/model_picker.py,sha256=CQ5tb9sThFRon6cbibtLAtK1VR6fxmecdLUX1_h4Cng,5127
|
|
177
170
|
klaude_code/tui/command/prompt-init.md,sha256=a4_FQ3gKizqs2vl9oEY5jtG6HNhv3f-1b5RSCFq0A18,1873
|
|
@@ -181,49 +174,51 @@ klaude_code/tui/command/registry.py,sha256=2HDrC6ZqGKSdzQAYra2TSFt1kc3tDliobjrWf
|
|
|
181
174
|
klaude_code/tui/command/resume_cmd.py,sha256=XaQyoB00_TiimUNl__z5ZvRg5EdG16LXvkGAZ3H6YxU,3359
|
|
182
175
|
klaude_code/tui/command/status_cmd.py,sha256=yALYGxyUX7iVdSRAKdG526YkqOvGV9F0CJNwk8nmzu4,5164
|
|
183
176
|
klaude_code/tui/command/sub_agent_model_cmd.py,sha256=iz9_bdxHBSOQjjMWPP4RBW58V_HhWREweG-4cXuotk0,5610
|
|
184
|
-
klaude_code/tui/command/terminal_setup_cmd.py,sha256=DfusD9c8eVkWPKGtQI0JvTgJnU_686huyzXsYE9TSEM,10639
|
|
185
177
|
klaude_code/tui/command/thinking_cmd.py,sha256=QV3YjcyNRTrmYrujvxfR6Dt05gTK7_uompT9BNWUfgg,2684
|
|
186
|
-
klaude_code/tui/commands.py,sha256=
|
|
178
|
+
klaude_code/tui/commands.py,sha256=EvUzo0b8zL1NerR7gzqU-w7ehJHWY_yXMxsty9JGKKo,3261
|
|
187
179
|
klaude_code/tui/components/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
188
180
|
klaude_code/tui/components/assistant.py,sha256=3VUIGf_BJhmoWZ5bHw-QUTMElUxp-MZQKUMWNimHKLE,904
|
|
189
181
|
klaude_code/tui/components/bash_syntax.py,sha256=0Pceo8w7jbK56smaVSBzkZYgCXzqqy7Qnx6kDZOh1yA,7450
|
|
190
|
-
klaude_code/tui/components/command_output.py,sha256=
|
|
182
|
+
klaude_code/tui/components/command_output.py,sha256=IC8smn6k6C6DGgDdlhG2prvsw2V2ZW092jifKqVMc5c,3731
|
|
191
183
|
klaude_code/tui/components/common.py,sha256=dhUYLVVOSKxg5GCoS4eyUeKZ3E8Kpt4nqft4njuvPaI,4698
|
|
192
184
|
klaude_code/tui/components/developer.py,sha256=1hDr7boJN1z_JyvvFNn8m7MAf4lPDN3eoqmofE0lv4Y,5414
|
|
193
185
|
klaude_code/tui/components/diffs.py,sha256=JUokkkJeTIoKD0b-c-chMzIDmMjivBQqH8DYXIA3hHs,10411
|
|
194
186
|
klaude_code/tui/components/errors.py,sha256=_9ojf-23ThR-BoMwNEYG68rzILwA_O59muGvofYL10w,669
|
|
195
187
|
klaude_code/tui/components/mermaid_viewer.py,sha256=MstufMnTauMKzI8cKngXpFqVo-qya20P8ReNkplYtEw,3098
|
|
196
|
-
klaude_code/tui/components/metadata.py,sha256=
|
|
188
|
+
klaude_code/tui/components/metadata.py,sha256=5C3zcK7JSHIDojF5Em2bSMoVYeO_W7m-zOAh9N_6XOQ,7275
|
|
197
189
|
klaude_code/tui/components/rich/__init__.py,sha256=zEZjnHR3Fnv_sFMxwIMjoJfwDoC4GRGv3lHJzAGRq_o,236
|
|
198
190
|
klaude_code/tui/components/rich/cjk_wrap.py,sha256=eMqBxftUtll7zrytUb9WtJ6naYLyax0W4KJRpGwWulM,7602
|
|
199
191
|
klaude_code/tui/components/rich/code_panel.py,sha256=ZKuJHh-kh-hIkBXSGLERLaDbJ7I9hvtvmYKocJn39_w,4744
|
|
200
192
|
klaude_code/tui/components/rich/live.py,sha256=xiMT6dPsxM_jaazddKrV9CMJQWwpe2t9OdjffHvo1JU,2821
|
|
201
|
-
klaude_code/tui/components/rich/markdown.py,sha256=
|
|
193
|
+
klaude_code/tui/components/rich/markdown.py,sha256=RqNfrbQ8sXbuLh9Zay1MLdl6SzLoLbfglTCyXi54wR8,21682
|
|
202
194
|
klaude_code/tui/components/rich/quote.py,sha256=u6sBmGdp0ckaZLw_XgJk7iHW4zxnWikUaB3GX2tkhlM,5375
|
|
203
195
|
klaude_code/tui/components/rich/searchable_text.py,sha256=PUe6MotKxSBY4FlPeojVjVQgxCsx_jiQ41bCzLp8WvE,2271
|
|
204
196
|
klaude_code/tui/components/rich/status.py,sha256=kNt08FQGvMZJB-zUhT5UyVFA7jvuRBNqf6yDXLEhb9c,14756
|
|
205
|
-
klaude_code/tui/components/rich/theme.py,sha256=
|
|
206
|
-
klaude_code/tui/components/sub_agent.py,sha256=
|
|
197
|
+
klaude_code/tui/components/rich/theme.py,sha256=aAXJhRlo0sESy59-bKbdwTPpbqD4kaZWdyb84D6mM9A,15830
|
|
198
|
+
klaude_code/tui/components/sub_agent.py,sha256=byCyRPq0xfit55cLwmp7SfRbCmyiXL77JklvFcbKW4M,6598
|
|
207
199
|
klaude_code/tui/components/thinking.py,sha256=AXC7Xpyiu7ST-eWGLRGY7N8Dak2ny3lV3mvznmfqKmM,2890
|
|
208
200
|
klaude_code/tui/components/tools.py,sha256=Up8DQbXuiPfcbiFVZD6gmZO0YBz2SExWS-tE_xeriX4,25060
|
|
209
|
-
klaude_code/tui/components/user_input.py,sha256=
|
|
201
|
+
klaude_code/tui/components/user_input.py,sha256=2H-H99NtvAa3cMKl9wgxZKdWPRDg50GjDJ47OWXE08s,3693
|
|
210
202
|
klaude_code/tui/components/welcome.py,sha256=ZSCcT-wFdSp3L1Fq7shWWz4Rk-BAXvsKisfvIUnP8a4,3665
|
|
211
|
-
klaude_code/tui/display.py,sha256=
|
|
203
|
+
klaude_code/tui/display.py,sha256=JfMETvb1gcgymQVXPy5tH2c-B0cHjXn9PtwSiYlP-1Q,3506
|
|
204
|
+
klaude_code/tui/input/AGENTS.md,sha256=2RBLz7H0JbUJv6OBzeadLOlGUF5EBqvtwTGBf6nZuN0,1633
|
|
212
205
|
klaude_code/tui/input/__init__.py,sha256=cAB38ypo7dHo_jgXUCnoBTUKHtiriVaKCv4YepSU9SU,276
|
|
213
|
-
klaude_code/tui/input/
|
|
214
|
-
klaude_code/tui/input/
|
|
215
|
-
klaude_code/tui/input/
|
|
216
|
-
klaude_code/tui/input/
|
|
217
|
-
klaude_code/tui/
|
|
218
|
-
klaude_code/tui/
|
|
219
|
-
klaude_code/tui/
|
|
206
|
+
klaude_code/tui/input/completers.py,sha256=RHf8dFDRxLlCG7Pw5feNjtKvH3yCYET1fKB7p44yICY,32869
|
|
207
|
+
klaude_code/tui/input/drag_drop.py,sha256=7O4CfIGnduNbDikwpr6I4ZFRPnUBg_far6_S2dZ-cvw,5265
|
|
208
|
+
klaude_code/tui/input/images.py,sha256=DqDKl2yt-pNzkfhKKo_ApTjJTccBCvuYDufpMeGM0d4,7090
|
|
209
|
+
klaude_code/tui/input/key_bindings.py,sha256=pM-sFonUzRE56H4XGVrEOuSXqGzLuvckBHnAD0fRAz4,24676
|
|
210
|
+
klaude_code/tui/input/paste.py,sha256=kELg5jC0WdBXWHJUsEjIhZ67KCvHMbN1XzyGmevVSNM,1888
|
|
211
|
+
klaude_code/tui/input/prompt_toolkit.py,sha256=dEAYw1ACvb1RjUIW8MZVlzz0dBvQGazmBoCMCVqkYkA,29012
|
|
212
|
+
klaude_code/tui/machine.py,sha256=xvKlbwiWRi5-RXOiPeCeed-cj5a2BYCXpNMCO0g5hcU,27541
|
|
213
|
+
klaude_code/tui/renderer.py,sha256=LRF1VtUA5qLweUSlzWFEkyMcSCUwBxqExoWwY5xNE_M,26110
|
|
214
|
+
klaude_code/tui/runner.py,sha256=Wc0agoPSoRKbdpR-1oTnFa3tYbmF9Nkr0mkK9qltjqQ,11264
|
|
220
215
|
klaude_code/tui/terminal/__init__.py,sha256=GIMnsEcIAGT_vBHvTlWEdyNmAEpruyscUA6M_j3GQZU,1412
|
|
221
216
|
klaude_code/tui/terminal/color.py,sha256=6SJR2RA8cqJINNoRz65w0HL3x9g46ydIvDOGWMeNnQU,7195
|
|
222
217
|
klaude_code/tui/terminal/control.py,sha256=m2fL6uHum5Li25X2IPnI4z_oVzMpVYcSldB-r0NLLzk,4920
|
|
223
|
-
klaude_code/tui/terminal/image.py,sha256=
|
|
218
|
+
klaude_code/tui/terminal/image.py,sha256=hhBKJLbgeN-BFOsMdIJXKch-hdYusCzrKV2CTAIje2s,2275
|
|
224
219
|
klaude_code/tui/terminal/notifier.py,sha256=-aTtgRvpzQcfbkOfbeDOfUs3l9smNBZX-60G9f0326Y,4643
|
|
225
220
|
klaude_code/tui/terminal/progress_bar.py,sha256=Go-0_ZodrmJVaQodaPnyxVU2nkpkBaYLnZBqwAUQukE,2133
|
|
226
|
-
klaude_code/tui/terminal/selector.py,sha256=
|
|
221
|
+
klaude_code/tui/terminal/selector.py,sha256=7zVlZ6HIiN-Hhx79jnpeOIw5nf12NuTOaRos57m-UII,31259
|
|
227
222
|
klaude_code/ui/__init__.py,sha256=3k9Sbesq0nNN3jcSMDqJ4zUcys4PKzGg4Xsum-6dZis,451
|
|
228
223
|
klaude_code/ui/common.py,sha256=_KmCNM-U8VowObYkfq8e9cyuvN1dF85P56hG8tGYlts,4309
|
|
229
224
|
klaude_code/ui/core/__init__.py,sha256=2NakrTDcxem5D0atyEY_Rxv1BbKCeZweF63L6AAq6r8,23
|
|
@@ -233,7 +228,7 @@ klaude_code/ui/debug_mode.py,sha256=ZvqbOx4c_rUerMbEZzOfcbNf9leqEDFjqJUlALtzF9Y,
|
|
|
233
228
|
klaude_code/ui/terminal/__init__.py,sha256=5OeAzr994r8-peWsLON0iXsAvJ2pexwMp36JY7FKGDc,179
|
|
234
229
|
klaude_code/ui/terminal/title.py,sha256=EZpLXTMhunsZPVGaxP317lH0Ad2oOh7OsjbV3yRD5is,1115
|
|
235
230
|
klaude_code/update.py,sha256=QER816AZe9u3RhRvP0Z37Jh2Ch5RLy9PREyDsI0e1dA,4480
|
|
236
|
-
klaude_code-2.
|
|
237
|
-
klaude_code-2.
|
|
238
|
-
klaude_code-2.
|
|
239
|
-
klaude_code-2.
|
|
231
|
+
klaude_code-2.7.0.dist-info/WHEEL,sha256=eh7sammvW2TypMMMGKgsM83HyA_3qQ5Lgg3ynoecH3M,79
|
|
232
|
+
klaude_code-2.7.0.dist-info/entry_points.txt,sha256=kkXIXedaTOtjXPr2rVjRVVXZYlFUcBHELaqmyVlWUFA,92
|
|
233
|
+
klaude_code-2.7.0.dist-info/METADATA,sha256=9t7misNdZMZ4SItRwvxxMWn9UBVSRplqmG_0VjiPyw0,10379
|
|
234
|
+
klaude_code-2.7.0.dist-info/RECORD,,
|
klaude_code/cli/session_cmd.py
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import time
|
|
2
|
-
|
|
3
|
-
import typer
|
|
4
|
-
|
|
5
|
-
from klaude_code.log import log
|
|
6
|
-
from klaude_code.session import Session
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
def _session_confirm(sessions: list[Session.SessionMetaBrief], message: str) -> bool:
|
|
10
|
-
"""Show session list and confirm deletion using prompt_toolkit."""
|
|
11
|
-
|
|
12
|
-
from klaude_code.tui.terminal.selector import DEFAULT_PICKER_STYLE, SelectItem, select_one
|
|
13
|
-
|
|
14
|
-
def _fmt(ts: float) -> str:
|
|
15
|
-
try:
|
|
16
|
-
return time.strftime("%m-%d %H:%M:%S", time.localtime(ts))
|
|
17
|
-
except (OSError, OverflowError, ValueError):
|
|
18
|
-
return str(ts)
|
|
19
|
-
|
|
20
|
-
log(f"Sessions to delete ({len(sessions)}):")
|
|
21
|
-
for s in sessions:
|
|
22
|
-
msg_count_display = "N/A" if s.messages_count == -1 else str(s.messages_count)
|
|
23
|
-
first_msg_text = s.user_messages[0] if s.user_messages else ""
|
|
24
|
-
first_msg = first_msg_text.strip().replace("\n", " ")[:50]
|
|
25
|
-
if len(first_msg_text) > 50:
|
|
26
|
-
first_msg += "…"
|
|
27
|
-
log(f" {_fmt(s.updated_at)} {msg_count_display:>3} msgs {first_msg}")
|
|
28
|
-
|
|
29
|
-
items: list[SelectItem[bool]] = [
|
|
30
|
-
SelectItem(title=[("class:text", "No\n")], value=False, search_text="No"),
|
|
31
|
-
SelectItem(title=[("class:text", "Yes\n")], value=True, search_text="Yes"),
|
|
32
|
-
]
|
|
33
|
-
|
|
34
|
-
result = select_one(
|
|
35
|
-
message=message,
|
|
36
|
-
items=items,
|
|
37
|
-
pointer="→",
|
|
38
|
-
style=DEFAULT_PICKER_STYLE,
|
|
39
|
-
use_search_filter=False,
|
|
40
|
-
)
|
|
41
|
-
return bool(result)
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
def session_clean(
|
|
45
|
-
min_messages: int = typer.Option(5, "--min", "-n", help="Minimum messages to keep a session"),
|
|
46
|
-
yes: bool = typer.Option(False, "--yes", "-y", help="Skip confirmation prompt"),
|
|
47
|
-
) -> None:
|
|
48
|
-
"""Remove sessions with fewer than N messages (default: 5)"""
|
|
49
|
-
sessions = Session.list_sessions()
|
|
50
|
-
to_delete = [s for s in sessions if 0 <= s.messages_count < min_messages]
|
|
51
|
-
|
|
52
|
-
if not to_delete:
|
|
53
|
-
log(f"No sessions with fewer than {min_messages} messages found.")
|
|
54
|
-
return
|
|
55
|
-
|
|
56
|
-
if not yes and not _session_confirm(to_delete, "Delete these sessions?"):
|
|
57
|
-
log("Aborted.")
|
|
58
|
-
return
|
|
59
|
-
|
|
60
|
-
deleted = Session.clean_small_sessions(min_messages)
|
|
61
|
-
log(f"Deleted {deleted} session(s).")
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
def session_clean_all(
|
|
65
|
-
yes: bool = typer.Option(False, "--yes", "-y", help="Skip confirmation prompt"),
|
|
66
|
-
) -> None:
|
|
67
|
-
"""Remove all sessions for the current project"""
|
|
68
|
-
sessions = Session.list_sessions()
|
|
69
|
-
|
|
70
|
-
if not sessions:
|
|
71
|
-
log("No sessions found.")
|
|
72
|
-
return
|
|
73
|
-
|
|
74
|
-
if not yes and not _session_confirm(sessions, "Delete ALL sessions? This cannot be undone."):
|
|
75
|
-
log("Aborted.")
|
|
76
|
-
return
|
|
77
|
-
|
|
78
|
-
deleted = Session.clean_all_sessions()
|
|
79
|
-
log(f"Deleted {deleted} session(s).")
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
def register_session_commands(app: typer.Typer) -> None:
|
|
83
|
-
"""Register session subcommands to the given Typer app."""
|
|
84
|
-
session_app = typer.Typer(help="Manage sessions for the current project")
|
|
85
|
-
session_app.command("clean")(session_clean)
|
|
86
|
-
session_app.command("clean-all")(session_clean_all)
|
|
87
|
-
app.add_typer(session_app, name="session")
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from klaude_code.protocol.events.base import Event, ResponseEvent
|
|
4
|
-
from klaude_code.protocol.events.chat import (
|
|
5
|
-
CommandOutputEvent,
|
|
6
|
-
DeveloperMessageEvent,
|
|
7
|
-
TodoChangeEvent,
|
|
8
|
-
UserMessageEvent,
|
|
9
|
-
)
|
|
10
|
-
from klaude_code.protocol.events.lifecycle import TaskFinishEvent, TaskStartEvent, TurnEndEvent, TurnStartEvent
|
|
11
|
-
from klaude_code.protocol.events.metadata import TaskMetadataEvent, UsageEvent
|
|
12
|
-
from klaude_code.protocol.events.streaming import (
|
|
13
|
-
AssistantImageDeltaEvent,
|
|
14
|
-
AssistantTextDeltaEvent,
|
|
15
|
-
AssistantTextEndEvent,
|
|
16
|
-
AssistantTextStartEvent,
|
|
17
|
-
ResponseCompleteEvent,
|
|
18
|
-
ThinkingDeltaEvent,
|
|
19
|
-
ThinkingEndEvent,
|
|
20
|
-
ThinkingStartEvent,
|
|
21
|
-
ToolCallStartEvent,
|
|
22
|
-
)
|
|
23
|
-
from klaude_code.protocol.events.system import (
|
|
24
|
-
EndEvent,
|
|
25
|
-
ErrorEvent,
|
|
26
|
-
InterruptEvent,
|
|
27
|
-
ReplayEventUnion,
|
|
28
|
-
ReplayHistoryEvent,
|
|
29
|
-
WelcomeEvent,
|
|
30
|
-
)
|
|
31
|
-
from klaude_code.protocol.events.tools import ToolCallEvent, ToolResultEvent
|
|
32
|
-
|
|
33
|
-
__all__ = [
|
|
34
|
-
"AssistantImageDeltaEvent",
|
|
35
|
-
"AssistantTextDeltaEvent",
|
|
36
|
-
"AssistantTextEndEvent",
|
|
37
|
-
"AssistantTextStartEvent",
|
|
38
|
-
"CommandOutputEvent",
|
|
39
|
-
"DeveloperMessageEvent",
|
|
40
|
-
"EndEvent",
|
|
41
|
-
"ErrorEvent",
|
|
42
|
-
"Event",
|
|
43
|
-
"InterruptEvent",
|
|
44
|
-
"ReplayEventUnion",
|
|
45
|
-
"ReplayHistoryEvent",
|
|
46
|
-
"ResponseCompleteEvent",
|
|
47
|
-
"ResponseEvent",
|
|
48
|
-
"TaskFinishEvent",
|
|
49
|
-
"TaskMetadataEvent",
|
|
50
|
-
"TaskStartEvent",
|
|
51
|
-
"ThinkingDeltaEvent",
|
|
52
|
-
"ThinkingEndEvent",
|
|
53
|
-
"ThinkingStartEvent",
|
|
54
|
-
"TodoChangeEvent",
|
|
55
|
-
"ToolCallEvent",
|
|
56
|
-
"ToolCallStartEvent",
|
|
57
|
-
"ToolResultEvent",
|
|
58
|
-
"TurnEndEvent",
|
|
59
|
-
"TurnStartEvent",
|
|
60
|
-
"UsageEvent",
|
|
61
|
-
"UserMessageEvent",
|
|
62
|
-
"WelcomeEvent",
|
|
63
|
-
]
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
import time
|
|
4
|
-
|
|
5
|
-
from pydantic import BaseModel, Field
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class Event(BaseModel):
|
|
9
|
-
"""Base event."""
|
|
10
|
-
|
|
11
|
-
session_id: str
|
|
12
|
-
timestamp: float = Field(default_factory=time.time)
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
class ResponseEvent(Event):
|
|
16
|
-
"""Event associated with a single model response."""
|
|
17
|
-
|
|
18
|
-
response_id: str | None = None
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from klaude_code.protocol import message, model
|
|
4
|
-
from klaude_code.protocol.commands import CommandName
|
|
5
|
-
|
|
6
|
-
from .base import Event
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class UserMessageEvent(Event):
|
|
10
|
-
content: str
|
|
11
|
-
images: list[message.ImageURLPart] | None = None
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class DeveloperMessageEvent(Event):
|
|
15
|
-
"""DeveloperMessages are reminders in user messages or tool results."""
|
|
16
|
-
|
|
17
|
-
item: message.DeveloperMessage
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
class TodoChangeEvent(Event):
|
|
21
|
-
todos: list[model.TodoItem]
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
class CommandOutputEvent(Event):
|
|
25
|
-
"""Event for command output display. Not persisted to session history."""
|
|
26
|
-
|
|
27
|
-
command_name: CommandName | str
|
|
28
|
-
content: str = ""
|
|
29
|
-
ui_extra: model.ToolResultUIExtra | None = None
|
|
30
|
-
is_error: bool = False
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from klaude_code.protocol import model
|
|
4
|
-
|
|
5
|
-
from .base import Event
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class TaskStartEvent(Event):
|
|
9
|
-
sub_agent_state: model.SubAgentState | None = None
|
|
10
|
-
model_id: str | None = None
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
class TaskFinishEvent(Event):
|
|
14
|
-
task_result: str
|
|
15
|
-
has_structured_output: bool = False
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
class TurnStartEvent(Event):
|
|
19
|
-
pass
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
class TurnEndEvent(Event):
|
|
23
|
-
pass
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"""Metadata-related protocol events."""
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
from klaude_code.protocol import model
|
|
6
|
-
|
|
7
|
-
from .base import Event, ResponseEvent
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class UsageEvent(ResponseEvent):
|
|
11
|
-
usage: model.Usage
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class TaskMetadataEvent(Event):
|
|
15
|
-
metadata: model.TaskMetadataItem
|
|
16
|
-
cancelled: bool = False
|