Phase 11: session on/off/reset toggle — SPEC §5.1, §7.1.
Persist sessionOverride via saveState and confirm the effective enabled layer after each toggle. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -100,7 +100,37 @@ async function handleSkillReinjectCommand(
|
||||
}
|
||||
|
||||
const subcommand = trimmed.split(/\s+/)[0];
|
||||
if (subcommand === "on" || subcommand === "off" || subcommand === "reset") {
|
||||
handleSessionToggle(subcommand, ctx, deps);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ctx.hasUI) {
|
||||
ctx.ui.notify(`skill-reinject: unknown subcommand "${subcommand}"`, "warning");
|
||||
}
|
||||
}
|
||||
|
||||
function handleSessionToggle(
|
||||
subcommand: "on" | "off" | "reset",
|
||||
ctx: ExtensionCommandContext,
|
||||
deps: SkillReinjectCommandDeps,
|
||||
): void {
|
||||
switch (subcommand) {
|
||||
case "on":
|
||||
deps.state.sessionOverride = true;
|
||||
break;
|
||||
case "off":
|
||||
deps.state.sessionOverride = false;
|
||||
break;
|
||||
case "reset":
|
||||
deps.state.sessionOverride = null;
|
||||
break;
|
||||
}
|
||||
deps.persistState();
|
||||
if (!ctx.hasUI) {
|
||||
return;
|
||||
}
|
||||
const settings = readSettings(ctx);
|
||||
const enabledLine = formatEnabledLine(deps.state.sessionOverride, settings);
|
||||
ctx.ui.notify(enabledLine, "info");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user