From c2b4c05d91fa88b8d02c055a0e15c22abd8e21f3 Mon Sep 17 00:00:00 2001 From: Adam Malczewski Date: Thu, 11 Jun 2026 12:23:06 +0900 Subject: feat(cache-warming): per-conversation prompt-cache warming + warm() service Backend-driven warming targeting whatever provider a conversation uses (incl. the external Claude provider-anthropic). Core engine + on/off + last-cache-% done; interval-as-view-control pending a ui-contract NumberField (surface-system gap). Mechanism: - kernel: expose HostAPI.emit (typed bus event emit; counterpart of on) - session-orchestrator: turnStarted/turnSettled event hooks (conversationId/cwd/model); warm() service (cacheWarmHandle) reusing the real-turn assembly (byte-identical prefix, provider-agnostic), refuses mid-turn, never persists/emits, returns Usage - cache-warming (new ext): per-conversation timers (arm on settle, cancel on start, in-flight invalidation), calls warm(), pct=round(clamp(cacheRead/input,0,1)*100), persists {enabled,intervalMs} (default on/240s), registers a controls surface - host-bin: register cache-warming; transport-http: HostAPI stub +emit (fan-out) Honors old-code invariants. 760 vitest + 109 bun = 869 tests; tsc -b EXIT 0; biome clean. --- bun.lock | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'bun.lock') diff --git a/bun.lock b/bun.lock index e1c62d6..9b63971 100644 --- a/bun.lock +++ b/bun.lock @@ -18,6 +18,16 @@ "@dispatch/kernel": "workspace:*", }, }, + "packages/cache-warming": { + "name": "@dispatch/cache-warming", + "version": "0.0.0", + "dependencies": { + "@dispatch/kernel": "workspace:*", + "@dispatch/session-orchestrator": "workspace:*", + "@dispatch/surface-registry": "workspace:*", + "@dispatch/ui-contract": "workspace:*", + }, + }, "packages/cli": { "name": "@dispatch/cli", "version": "0.0.0", @@ -45,6 +55,7 @@ "version": "0.0.0", "dependencies": { "@dispatch/auth-apikey": "workspace:*", + "@dispatch/cache-warming": "workspace:*", "@dispatch/conversation-store": "workspace:*", "@dispatch/credential-store": "workspace:*", "@dispatch/journal-sink": "workspace:*", @@ -243,6 +254,8 @@ "@dispatch/auth-apikey": ["@dispatch/auth-apikey@workspace:packages/auth-apikey"], + "@dispatch/cache-warming": ["@dispatch/cache-warming@workspace:packages/cache-warming"], + "@dispatch/cli": ["@dispatch/cli@workspace:packages/cli"], "@dispatch/conversation-store": ["@dispatch/conversation-store@workspace:packages/conversation-store"], -- cgit v1.2.3