pi-lens 3.8.18 → 3.8.21

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/index.ts CHANGED
@@ -29,7 +29,10 @@ import { captureSnapshot } from "./clients/metrics-history.js";
29
29
  import { findSimilarFunctions } from "./clients/project-index.js";
30
30
  import { RuffClient } from "./clients/ruff-client.js";
31
31
  import { RuntimeCoordinator } from "./clients/runtime-coordinator.js";
32
- import { consumeTurnEndFindings } from "./clients/runtime-context.js";
32
+ import {
33
+ consumeSessionStartGuidance,
34
+ consumeTurnEndFindings,
35
+ } from "./clients/runtime-context.js";
33
36
  import { handleSessionStart } from "./clients/runtime-session.js";
34
37
  import { handleToolResult } from "./clients/runtime-tool-result.js";
35
38
  import { handleTurnEnd } from "./clients/runtime-turn.js";
@@ -51,10 +54,12 @@ const _getExtensionDir = () => {
51
54
  return ".";
52
55
  };
53
56
 
54
- const DEBUG_LOG = path.join(os.homedir(), "pi-lens-debug.log");
57
+ const DEBUG_LOG_DIR = path.join(os.homedir(), ".pi-lens");
58
+ const DEBUG_LOG = path.join(DEBUG_LOG_DIR, "sessionstart.log");
55
59
  function dbg(msg: string) {
56
60
  const line = `[${new Date().toISOString()}] ${msg}\n`;
57
61
  try {
62
+ nodeFs.mkdirSync(DEBUG_LOG_DIR, { recursive: true });
58
63
  nodeFs.appendFileSync(DEBUG_LOG, line);
59
64
  } catch (e) {
60
65
  // Pipeline error logged
@@ -733,7 +738,14 @@ pi.on("turn_end", async (_event, ctx) => {
733
738
  (pi as any).on("context", async (_event: unknown, ctx: { cwd?: string }) => {
734
739
  try {
735
740
  const cwd = ctx.cwd ?? process.cwd();
736
- return consumeTurnEndFindings(cacheManager, cwd);
741
+ const turnEndFindings = consumeTurnEndFindings(cacheManager, cwd);
742
+ const sessionGuidance = consumeSessionStartGuidance(cacheManager, cwd);
743
+ const messages = [
744
+ ...(sessionGuidance?.messages ?? []),
745
+ ...(turnEndFindings?.messages ?? []),
746
+ ];
747
+ if (messages.length === 0) return;
748
+ return { messages };
737
749
  } catch (err) {
738
750
  dbg(`context event error: ${err}`);
739
751
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-lens",
3
- "version": "3.8.18",
3
+ "version": "3.8.21",
4
4
  "type": "module",
5
5
  "description": "Real-time code feedback for pi — LSP, linters, formatters, type-checking, structural analysis & booboo",
6
6
  "repository": {