diff options
| author | Adam Malczewski <[email protected]> | 2026-06-11 12:45:21 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-06-11 12:45:21 +0900 |
| commit | 27fd0be36b2f6395249de5aacc86e41fe4e0207f (patch) | |
| tree | 67ae766c1985344878d6a2e71da18834fa73e47d /packages/transport-http/src/index.ts | |
| parent | c2b4c05d91fa88b8d02c055a0e15c22abd8e21f3 (diff) | |
| download | dispatch-27fd0be36b2f6395249de5aacc86e41fe4e0207f.tar.gz dispatch-27fd0be36b2f6395249de5aacc86e41fe4e0207f.zip | |
feat(cache-warming): manual POST /chat/warm trigger endpoint
A frontend 'warm now' button (and fast tests) can trigger a warm on demand
instead of waiting for the automatic timer.
- transport-contract: WarmRequest / WarmResponse wire types
- transport-http: POST /chat/warm → cacheWarmHandle.warm(); 200 with cachePct,
409 when the conversation is generating, 400 on missing conversationId
Live-verified vs claude haiku: seed turn cacheWrite=6799 → POST /chat/warm
returns cacheReadTokens=6799 cachePct=100 (100% hit). 760 vitest + 109 bun green.
Diffstat (limited to 'packages/transport-http/src/index.ts')
| -rw-r--r-- | packages/transport-http/src/index.ts | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/packages/transport-http/src/index.ts b/packages/transport-http/src/index.ts index 171cf6a..64929fc 100644 --- a/packages/transport-http/src/index.ts +++ b/packages/transport-http/src/index.ts @@ -1,16 +1,29 @@ export type { CreateServerOptions } from "./app.js"; export { createApp } from "./app.js"; export { createTransportHttpExtension, manifest } from "./extension.js"; -export type { ChatCommand, ParseError, ParseResult, SinceSeqResult } from "./logic.js"; +export type { + ChatCommand, + ParseError, + ParseResult, + SinceSeqResult, + WarmBodyParsed, +} from "./logic.js"; export { + computeCachePct, isParseError, isSinceSeqError, parseChatBody, parseSinceSeq, serializeEventLine, } from "./logic.js"; -export type { ConversationStore, CredentialStore, SessionOrchestrator } from "./seam.js"; +export type { + ConversationStore, + CredentialStore, + SessionOrchestrator, + WarmService, +} from "./seam.js"; export { + cacheWarmHandle, conversationStoreHandle, credentialStoreHandle, sessionOrchestratorHandle, |
