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/CHANGELOG.md +31 -0
- package/README.md +26 -17
- package/clients/dispatch/dispatcher.ts +53 -1
- package/clients/dispatch/integration.ts +37 -26
- package/clients/dispatch/plan.ts +26 -15
- package/clients/dispatch/runners/lsp.ts +6 -1
- package/clients/dispatch/runners/pyright.ts +4 -6
- package/clients/dispatch/runners/ruff.ts +52 -7
- package/clients/dispatch/runners/sqlfluff.ts +48 -1
- package/clients/dispatch/runners/yamllint.ts +50 -0
- package/clients/file-utils.ts +13 -2
- package/clients/formatters.ts +8 -4
- package/clients/installer/index.ts +371 -49
- package/clients/language-policy.ts +154 -0
- package/clients/language-profile.ts +167 -0
- package/clients/lsp/index.ts +81 -11
- package/clients/lsp/interactive-install.ts +35 -16
- package/clients/lsp/server.ts +357 -267
- package/clients/pipeline.ts +71 -40
- package/clients/runtime-context.ts +26 -0
- package/clients/runtime-coordinator.ts +30 -2
- package/clients/runtime-session.ts +293 -103
- package/clients/runtime-tool-result.ts +8 -10
- package/clients/runtime-turn.ts +21 -4
- package/clients/todo-scanner.ts +6 -1
- package/clients/type-coverage-client.ts +1 -1
- package/commands/booboo.ts +3 -1
- package/index.ts +15 -3
- package/package.json +1 -1
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 {
|
|
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
|
|
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
|
-
|
|
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
|
}
|