@agnishc/edb-auto-name-session 0.6.1 → 0.8.2
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 +9 -0
- package/package.json +1 -1
- package/src/index.ts +21 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.8.2] - 2026-05-11
|
|
4
|
+
|
|
5
|
+
## [0.8.1] - 2026-05-11
|
|
6
|
+
|
|
7
|
+
## [0.7.0] - 2026-05-11
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
- 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.
|
|
11
|
+
|
|
3
12
|
## [0.6.0] - 2026-05-11
|
|
4
13
|
|
|
5
14
|
### Changed
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -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 (
|
|
57
|
+
if (hasUI) {
|
|
57
58
|
ctx.ui.notify("Auto-naming session…", "info");
|
|
58
59
|
}
|
|
59
60
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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
|
|