feat(prompt): implement prompt injection slice 2
This commit is contained in:
+7
-4
@@ -11,6 +11,8 @@ import {
|
||||
buildPreInitHint,
|
||||
modeAllowsPreInitHint,
|
||||
modeAllowsInjection,
|
||||
discoverContextWindow,
|
||||
buildInjectionPayload,
|
||||
} from "./src/index.js";
|
||||
import { loadConfig } from "./src/config.js";
|
||||
import { createLLMClient } from "./src/llm/llm-client.js";
|
||||
@@ -367,17 +369,18 @@ export default function (pi: ExtensionAPI) {
|
||||
}
|
||||
|
||||
// Maps exist but advisory mode does not permit automatic artifact injection yet.
|
||||
// Full root-pair injection with canonical markers comes in later slices.
|
||||
if (!modeAllowsInjection(config.promptInjectionMode)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
// Slice 2: post-init root-pair preload + budgeted expansion
|
||||
const contextWindow = discoverContextWindow(_ctx);
|
||||
const payload = buildInjectionPayload(_ctx.cwd, config, contextWindow);
|
||||
return {
|
||||
message: {
|
||||
customType: "pi-project-map-hint",
|
||||
content:
|
||||
"📋 Project map active: Start with the root `.pi-map.index.md`, use indexes first for routing, read the local `.pi-map.md` plus source before edits, run `project_map_patch` after source edits, and run `project_map_validate` before freshness-sensitive architectural handoff.",
|
||||
display: false,
|
||||
content: payload.content,
|
||||
display: payload.display,
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user