@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 +12 -0
- package/package.json +3 -3
- package/src/index.ts +23 -17
- package/src/title.ts +1 -1
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.
|
|
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
|
-
"@
|
|
41
|
-
"@
|
|
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 "@
|
|
2
|
-
import type { ExtensionAPI, ExtensionContext } from "@
|
|
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 (
|
|
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
|
|
package/src/title.ts
CHANGED