Phase 11: /skill-reinject now delegates to reinjectNow — SPEC §7.1.

Wire debug force re-inject through the existing immediate delivery path with registered skills from the session.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-17 12:56:36 +07:00
parent 03dcdb22de
commit 0534093f2c
2 changed files with 20 additions and 2 deletions
+13 -1
View File
@@ -1,11 +1,14 @@
import type { ExtensionAPI, ExtensionCommandContext } from "@earendil-works/pi-coding-agent"; import type { ExtensionAPI, ExtensionCommandContext, Skill } from "@earendil-works/pi-coding-agent";
import { resolveDeliveryMode } from "./auto-compact.js"; import { resolveDeliveryMode } from "./auto-compact.js";
import { reinjectNow } from "./reinject.js";
import { readSettings, writeGlobalSettings, type SkillReinjectSettings } from "./settings.js"; import { readSettings, writeGlobalSettings, type SkillReinjectSettings } from "./settings.js";
import type { AutoCompactIntegration, ExtensionState, RuntimeFlags } from "./state.js"; import type { AutoCompactIntegration, ExtensionState, RuntimeFlags } from "./state.js";
export interface SkillReinjectCommandDeps { export interface SkillReinjectCommandDeps {
pi: ExtensionAPI;
state: ExtensionState; state: ExtensionState;
runtime: RuntimeFlags; runtime: RuntimeFlags;
getRegisteredSkills: () => readonly Skill[];
persistState: () => void; persistState: () => void;
} }
@@ -120,6 +123,10 @@ async function handleSkillReinjectCommand(
handleIntegrationOverride(trimmed, ctx, deps); handleIntegrationOverride(trimmed, ctx, deps);
return; return;
} }
if (subcommand === "now") {
handleReinjectNow(ctx, deps);
return;
}
if (ctx.hasUI) { if (ctx.hasUI) {
ctx.ui.notify(`skill-reinject: unknown subcommand "${subcommand}"`, "warning"); ctx.ui.notify(`skill-reinject: unknown subcommand "${subcommand}"`, "warning");
@@ -219,3 +226,8 @@ function handleIntegrationOverride(
const settings = readSettings(ctx); const settings = readSettings(ctx);
ctx.ui.notify(formatDeliveryLine(settings, deps.runtime, mode), "info"); ctx.ui.notify(formatDeliveryLine(settings, deps.runtime, mode), "info");
} }
function handleReinjectNow(ctx: ExtensionCommandContext, deps: SkillReinjectCommandDeps): void {
const settings = readSettings(ctx);
reinjectNow(deps.pi, deps.state, settings, ctx, deps.getRegisteredSkills());
}
+7 -1
View File
@@ -45,7 +45,13 @@ export default function skillReinject(pi: ExtensionAPI): void {
saveState(pi, state); saveState(pi, state);
} }
registerSkillReinjectCommand(pi, { state, runtime, persistState }); registerSkillReinjectCommand(pi, {
pi,
state,
runtime,
getRegisteredSkills: () => registeredSkills,
persistState,
});
function trackSkillAndPersist(input: TrackSkillInput): void { function trackSkillAndPersist(input: TrackSkillInput): void {
trackSkill(state, input); trackSkill(state, input);