Phase 6: add resolveDeliveryMode — defer vs immediate from integration table.
Wraps effectiveIntegration with RuntimeFlags.autoCompactDetected so reinject wiring reads delivery mode from one place. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+15
-1
@@ -1,5 +1,10 @@
|
||||
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
||||
import type { RuntimeFlags } from "./state";
|
||||
import {
|
||||
effectiveIntegration,
|
||||
type ReinjectDeliveryMode,
|
||||
type SkillReinjectSettings,
|
||||
} from "./settings";
|
||||
import type { AutoCompactIntegration, RuntimeFlags } from "./state";
|
||||
|
||||
/** Detect @capyup/pi-auto-compact via public getCommands API (SPEC §16.4). */
|
||||
export function detectPiAutoCompact(pi: ExtensionAPI): boolean {
|
||||
@@ -11,3 +16,12 @@ export function detectAndCachePiAutoCompact(pi: ExtensionAPI, runtime: RuntimeFl
|
||||
runtime.autoCompactDetected = detectPiAutoCompact(pi);
|
||||
return runtime.autoCompactDetected;
|
||||
}
|
||||
|
||||
/** Resolve re-inject delivery mode from settings, detect cache, and session override (SPEC §6.5.3). */
|
||||
export function resolveDeliveryMode(
|
||||
settings: SkillReinjectSettings,
|
||||
runtime: RuntimeFlags,
|
||||
sessionIntegrationOverride?: AutoCompactIntegration | null,
|
||||
): ReinjectDeliveryMode {
|
||||
return effectiveIntegration(settings, runtime.autoCompactDetected, sessionIntegrationOverride);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user