xindex 1.0.16 → 1.0.18

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
@@ -104,12 +104,12 @@ name: ask-xi
104
104
  description: Discovers relevant files via xindex semantic search — preps queries, auto-indexes on empty, returns file links with keywords. Triggered by @xi.
105
105
  argument-hint: "[question]"
106
106
  ---
107
- Surface-level codebase discovery via xindex. Tool: `xindex_search` (natural-language, meaning-based).
107
+ Surface-level codebase discovery via xindex. Tool: `xindex_search` (natural-language, meaning-based). Must trigger search when a session starts, a new task starts, or any codebase lookup is needed.
108
108
 
109
109
  **Steps:**
110
- 1. Draft 1–5 queries from $ARGUMENTS (entry points, routing, config, tests, patterns); run `xindex_search` in parallel.
110
+ 1. Draft 3–5 queries from $ARGUMENTS (entry points, routing, config, tests, patterns); run `xindex_search` in parallel.
111
111
  2. If empty/sparse/stale → scoped `xindex_index` on relevant root folders (one path per call, e.g. `src`, `skills`, `agents`), then re-search. Prefer scoped over full-repo.
112
- 3. Think, then run 2+ narrower follow-ups in parallel based on round-1 hits.
112
+ 3. Think, then run 3+ narrower follow-ups in parallel based on round-1 hits.
113
113
  4. Return file paths + brief keywords showing why each matched.
114
114
 
115
115
  Output = file links + keywords, not analysis. **Escalate to `/ask-cursor` by default** (cheap codebase reasoning); only go to `/ask-claude` for multi-file/pattern analysis or `/ask-claude-opus` for trade-offs. For reset or full re-index, delegate to `/xindex` (owns safety rules).
package/apps/mcpApp.ts CHANGED
@@ -35,18 +35,18 @@ export function McpApp({
35
35
  }): IMcpApp {
36
36
  return async function mcpApp() {
37
37
  const server = new McpServer({name: "xindex", version: "1.0.0"}, {
38
- instructions: "@xi triggers this. Run `xindex_search` at session/task start. 1–5 parallel queries think 2+ follow-ups; empty `xindex_index` scoped root.",
38
+ instructions: "@xi must trigger search when a session starts, a new task starts, or any codebase lookup is needed. Run `xindex_search`: 3–5 parallel queries, then think, then 3+ narrowed follow-ups. If results are sparse, run scoped `xindex_index` (one path per call) and re-search.",
39
39
  });
40
40
 
41
41
  // --- search ---
42
42
 
43
43
  server.registerTool("xindex_search", {
44
44
  title: "Search codebase (semantic)",
45
- description: "Semantic codebase search by meaning. " +
46
- "@xi triggers this; run at session/task start. " +
47
- "1–5 parallel queries think → 2+ narrower follow-ups. " +
48
- "Returns ranked file paths + keywords (links, not analysis). " +
49
- "If sparse, `xindex_index` scoped root first (one path per call).",
45
+ description: "Semantic codebase discovery by meaning. " +
46
+ "Must trigger when a session starts, a new task starts, or any codebase lookup is needed. " +
47
+ "Start with 3–5 parallel queries, then 3+ narrowed follow-ups. " +
48
+ "Return ranked file paths + keywords (links, not analysis). " +
49
+ "If sparse, run scoped `xindex_index` first (one path per call).",
50
50
  inputSchema: z.object({
51
51
  query: z.string()
52
52
  .describe("Natural language search query"),
package/apps/run.mcp.ts CHANGED
@@ -45,16 +45,22 @@ const watch = watchDisabled ? undefined : {
45
45
  watcherLock,
46
46
  };
47
47
 
48
- process.on("SIGINT", async () => {
49
- log(`shutting down stopping heartbeat...`);
48
+ let shuttingDown = false;
49
+ const shutdown = async (reason: string) => {
50
+ if (shuttingDown) return;
51
+ shuttingDown = true;
52
+ log(`shutdown (${reason}) — stopping heartbeat...`);
50
53
  watcherLock.stopHeartbeat();
51
54
  log(`releasing lock...`);
52
55
  await watcherLock.release();
53
- log(`waiting 7s for another watcher to take over...`);
54
- await new Promise(r => setTimeout(r, 7000));
55
56
  log(`exiting`);
56
57
  process.exit(0);
57
- });
58
+ };
59
+ process.on("SIGINT", () => shutdown("SIGINT"));
60
+ process.on("SIGTERM", () => shutdown("SIGTERM"));
61
+ process.on("SIGHUP", () => shutdown("SIGHUP"));
62
+ process.stdin.on("close", () => shutdown("stdin-close"));
63
+ process.stdin.on("end", () => shutdown("stdin-end"));
58
64
 
59
65
  log(`[${appId}] started`);
60
66
  const mcpApp = McpApp({search, indexApp, getIndexStats, resetIndex, log, watch, config});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xindex",
3
- "version": "1.0.16",
3
+ "version": "1.0.18",
4
4
  "description": "Local semantic code search — index codebase, search by meaning or keywords",
5
5
  "type": "module",
6
6
  "main": "xindex.ts",