@grrrck/pi-clear 0.1.0 → 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 CHANGED
@@ -5,6 +5,22 @@ 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
+
18
+ ## [0.1.1] - 2026-10-02
19
+
20
+ ### Fixed
21
+
22
+ - Corrected the package name in install instructions (`@grrrck`, not `@gadenbuie`).
23
+
8
24
  ## [0.1.0] - 2026-10-02
9
25
 
10
26
  ### Added
package/README.md CHANGED
@@ -13,13 +13,13 @@ If you switched models mid-session — with `/model`, model cycling, or an exten
13
13
  ## Install
14
14
 
15
15
  ```sh
16
- pi install npm:@gadenbuie/pi-clear
16
+ pi install npm:@grrrck/pi-clear
17
17
  ```
18
18
 
19
19
  Or try it without installing:
20
20
 
21
21
  ```sh
22
- pi -e npm:@gadenbuie/pi-clear
22
+ pi -e npm:@grrrck/pi-clear
23
23
  ```
24
24
 
25
25
  ## Usage
@@ -32,7 +32,7 @@ pi -e npm:@gadenbuie/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 && isThinkingLevel(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(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grrrck/pi-clear",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Pi extension that starts a fresh session with /clear while keeping your current model and thinking level",
5
5
  "keywords": [
6
6
  "pi-package",