@grrrck/pi-clear 0.1.1 → 0.2.0
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.
- package/CHANGELOG.md +10 -0
- package/README.md +1 -1
- package/index.ts +3 -17
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.2.0] - 2026-10-02
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- A notification when `/clear` waits for the agent to become idle before clearing.
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
|
|
16
|
+
- Restore the captured thinking level as-is instead of validating against a hardcoded list of levels, so levels pi adds later are preserved rather than silently dropped.
|
|
17
|
+
|
|
8
18
|
## [0.1.1] - 2026-10-02
|
|
9
19
|
|
|
10
20
|
### Fixed
|
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@ pi -e npm:@grrrck/pi-clear
|
|
|
32
32
|
|
|
33
33
|
When `/clear` runs, the extension:
|
|
34
34
|
|
|
35
|
-
1. waits for the agent to become idle if needed
|
|
35
|
+
1. waits for the agent to become idle if needed, notifying you that it's waiting
|
|
36
36
|
2. captures the active model and thinking level
|
|
37
37
|
3. starts a new session via `ctx.newSession()`
|
|
38
38
|
4. restores the captured model and thinking level in the new session
|
package/index.ts
CHANGED
|
@@ -37,21 +37,6 @@ interface ClearHandoff {
|
|
|
37
37
|
|
|
38
38
|
const HANDOFF_KEY = "__pi_clear_handoff__";
|
|
39
39
|
|
|
40
|
-
const THINKING_LEVELS = [
|
|
41
|
-
"off",
|
|
42
|
-
"minimal",
|
|
43
|
-
"low",
|
|
44
|
-
"medium",
|
|
45
|
-
"high",
|
|
46
|
-
"xhigh",
|
|
47
|
-
"max",
|
|
48
|
-
] as const;
|
|
49
|
-
type ThinkingLevel = (typeof THINKING_LEVELS)[number];
|
|
50
|
-
|
|
51
|
-
function isThinkingLevel(value: string): value is ThinkingLevel {
|
|
52
|
-
return (THINKING_LEVELS as readonly string[]).includes(value);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
40
|
function writeHandoff(handoff: ClearHandoff): void {
|
|
56
41
|
(globalThis as Record<string, unknown>)[HANDOFF_KEY] = handoff;
|
|
57
42
|
}
|
|
@@ -70,6 +55,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
70
55
|
handler: async (_args, ctx) => {
|
|
71
56
|
try {
|
|
72
57
|
if (!ctx.isIdle()) {
|
|
58
|
+
ctx.ui.notify("Waiting for the agent to finish before clearing", "info");
|
|
73
59
|
await ctx.waitForIdle();
|
|
74
60
|
}
|
|
75
61
|
|
|
@@ -116,8 +102,8 @@ export default function (pi: ExtensionAPI) {
|
|
|
116
102
|
return;
|
|
117
103
|
}
|
|
118
104
|
|
|
119
|
-
if (handoff.thinkingLevel
|
|
120
|
-
pi.setThinkingLevel(handoff.thinkingLevel);
|
|
105
|
+
if (handoff.thinkingLevel) {
|
|
106
|
+
await pi.setThinkingLevel(handoff.thinkingLevel);
|
|
121
107
|
}
|
|
122
108
|
} catch (err) {
|
|
123
109
|
ctx.ui.notify(
|