refactor(coding-agent): fix compaction for branched sessions, consolidate hook context types
Compaction API: - prepareCompaction() now takes (pathEntries, settings) only - CompactionPreparation restructured: removed cutPoint/messagesToKeep/boundaryStart, added turnPrefixMessages/isSplitTurn/previousSummary/fileOps/settings - compact() now takes (preparation, model, apiKey, customInstructions?, signal?) - Fixed token overflow by using getPath() instead of getEntries() Hook types: - HookEventContext renamed to HookContext - HookCommandContext removed, RegisteredCommand.handler takes (args, ctx) - HookContext now includes model field - SessionBeforeCompactEvent: removed previousCompactions/model, added branchEntries - SessionBeforeTreeEvent: removed model (use ctx.model) - HookRunner.initialize() added for modes to set up callbacks
This commit is contained in:
@@ -310,7 +310,7 @@ export default function (pi: HookAPI) {
|
||||
pi.registerCommand("snake", {
|
||||
description: "Play Snake!",
|
||||
|
||||
handler: async (ctx) => {
|
||||
handler: async (_args, ctx) => {
|
||||
if (!ctx.hasUI) {
|
||||
ctx.ui.notify("Snake requires interactive mode", "error");
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user