pi-context-engine 0.5.0 → 0.5.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/README.md CHANGED
@@ -103,6 +103,12 @@ unchanged repo took 237 ms.
103
103
  - **Switches**: `indexer.auto_index: false` disables the session-start and
104
104
  lazy kicks; `indexer.watch: false` disables the file watcher. Use
105
105
  `/context-index` for manual builds.
106
+ - **Cold-start visibility**: the first build on an empty index announces its
107
+ start (`building the first index…`) and always closes with a result line
108
+ (`updated: N file(s)` or `no files to index`). This is the one background
109
+ run that can take minutes, so a pause reads as "indexing", not as a hung
110
+ session. Warm incremental runs stay quiet on start: they finish in a few
111
+ hundred ms, and a toast per session would be noise.
106
112
  - **Why it matters**: incremental runs are cheap (a few hundred ms on an
107
113
  unchanged repo), so this removes the classic cold-start failure of searching
108
114
  an empty index, without ever blocking the UI.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-context-engine",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "Semantic code context for pi: tree-sitter index + hybrid vector/BM25 retrieval + cross-session memory, all local. Port of code-context-engine (MIT, elara-labs) as a native pi extension.",
5
5
  "keywords": [
6
6
  "pi-package",
package/src/extension.ts CHANGED
@@ -137,6 +137,14 @@ export default function contextEngineExtension(pi: ExtensionAPI) {
137
137
  const kickBackgroundIndex = (eng: ContextEngine, notify?: (msg: string, level: "info" | "warning") => void) => {
138
138
  lazyIndexStarted = true;
139
139
  indexInFlight = true;
140
+ // Cold-start visibility: the first build on an empty index is the only
141
+ // background run that can take minutes (every file gets chunked and
142
+ // embedded), and it used to stay invisible until the completion line.
143
+ // Announce the start so a long pause reads as "indexing", not as a hung
144
+ // session. Warm incremental runs are NOT announced: they finish in a few
145
+ // hundred ms and a toast on every session start would be noise.
146
+ const announcedStart = eng.chunkCount() === 0 && notify !== undefined;
147
+ if (announcedStart) notify?.(`Context index: building the first index for ${eng.projectName}…`, "info");
140
148
  void eng
141
149
  .autoIndexOnce()
142
150
  .then((result) => {
@@ -145,6 +153,11 @@ export default function contextEngineExtension(pi: ExtensionAPI) {
145
153
  notify(`Context index: background index hit ${result.errors.length} error(s)`, "warning");
146
154
  } else if (result.indexed > 0) {
147
155
  notify(`Context index updated: ${result.indexed} file(s), ${result.chunks} chunk(s)`, "info");
156
+ } else if (announcedStart) {
157
+ // The start toast promised feedback — close the loop even when
158
+ // there is nothing to index (empty project), instead of leaving
159
+ // "building…" hanging without a result.
160
+ notify(`Context index: no files to index for ${eng.projectName}`, "info");
148
161
  }
149
162
  })
150
163
  .catch((err: unknown) => {