@agnishc/edb-auto-name-session 0.5.1 → 0.8.1

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
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.8.1] - 2026-05-11
4
+
5
+ ## [0.7.0] - 2026-05-11
6
+
7
+ ### Changed
8
+ - Auto-naming now runs asynchronously in the background instead of blocking the main thread. The `message_end` handler returns immediately, so the assistant can begin responding while the title generation is in flight.
9
+
10
+ ## [0.6.0] - 2026-05-11
11
+
12
+ ### Changed
13
+ - Migrated all imports and peerDependencies from `@mariozechner/pi-*` to `@earendil-works/pi-*` namespace
14
+
3
15
  ## [0.5.1] - 2026-05-05
4
16
 
5
17
  ### Added
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agnishc/edb-auto-name-session",
3
- "version": "0.5.1",
3
+ "version": "0.8.1",
4
4
  "description": "Pi extension: replace Pi's first-message session label with a generated title",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -37,7 +37,7 @@
37
37
  ]
38
38
  },
39
39
  "peerDependencies": {
40
- "@mariozechner/pi-ai": "*",
41
- "@mariozechner/pi-coding-agent": "*"
40
+ "@earendil-works/pi-ai": "*",
41
+ "@earendil-works/pi-coding-agent": "*"
42
42
  }
43
43
  }
package/src/index.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { complete } from "@mariozechner/pi-ai";
2
- import type { ExtensionAPI, ExtensionContext } from "@mariozechner/pi-coding-agent";
1
+ import { complete } from "@earendil-works/pi-ai";
2
+ import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
3
3
  import { extractUserText, sanitizeSessionName, shouldArmAutoNaming } from "./title";
4
4
 
5
5
  const MODEL_PROVIDER = "opencode";
@@ -52,25 +52,31 @@ export default function autoNameSessionExtension(pi: ExtensionAPI): void {
52
52
 
53
53
  pending = true;
54
54
  const token = sessionToken;
55
+ const hasUI = ctx.hasUI;
55
56
 
56
- if (ctx.hasUI) {
57
+ if (hasUI) {
57
58
  ctx.ui.notify("Auto-naming session…", "info");
58
59
  }
59
60
 
60
- try {
61
- const name = await generateSessionName(prompt, ctx);
62
- if (!name) return;
63
- if (token !== sessionToken) return;
64
- if (pi.getSessionName()) return;
65
- pi.setSessionName(name);
66
- if (ctx.hasUI) {
67
- ctx.ui.notify(`Session named: ${name}`, "info");
68
- }
69
- } catch (error: unknown) {
70
- console.error("[edb-auto-name-session] Failed to generate session name:", error);
71
- } finally {
72
- if (token === sessionToken) pending = false;
73
- }
61
+ // Fire-and-forget: generate name asynchronously without blocking
62
+ // the main thread. The handler returns immediately, and the name
63
+ // is applied when the LLM call resolves in the background.
64
+ generateSessionName(prompt, ctx)
65
+ .then((name) => {
66
+ if (!name) return;
67
+ if (token !== sessionToken) return;
68
+ if (pi.getSessionName()) return;
69
+ pi.setSessionName(name);
70
+ if (hasUI) {
71
+ ctx.ui.notify(`Session named: ${name}`, "info");
72
+ }
73
+ })
74
+ .catch((error: unknown) => {
75
+ console.error("[edb-auto-name-session] Failed to generate session name:", error);
76
+ })
77
+ .finally(() => {
78
+ if (token === sessionToken) pending = false;
79
+ });
74
80
  });
75
81
  }
76
82
 
package/src/title.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { SessionEntry } from "@mariozechner/pi-coding-agent";
1
+ import type { SessionEntry } from "@earendil-works/pi-coding-agent";
2
2
 
3
3
  const MAX_PROMPT_CHARS = 4_000;
4
4
  const MAX_TITLE_CHARS = 60;