claude-code-infinite 1.0.29 → 1.0.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/README.md +65 -7
  2. package/dist/cli-args.d.ts +10 -0
  3. package/dist/cli-args.d.ts.map +1 -1
  4. package/dist/cli-args.js +30 -0
  5. package/dist/cli-args.js.map +1 -1
  6. package/dist/cli-lifecycle.d.ts +45 -1
  7. package/dist/cli-lifecycle.d.ts.map +1 -1
  8. package/dist/cli-lifecycle.js +59 -0
  9. package/dist/cli-lifecycle.js.map +1 -1
  10. package/dist/cli-main.js +61 -16
  11. package/dist/cli-main.js.map +1 -1
  12. package/dist/count-tokens.d.ts +15 -0
  13. package/dist/count-tokens.d.ts.map +1 -1
  14. package/dist/count-tokens.js +23 -1
  15. package/dist/count-tokens.js.map +1 -1
  16. package/dist/diagnostics-schema.d.ts.map +1 -1
  17. package/dist/diagnostics-schema.js +5 -0
  18. package/dist/diagnostics-schema.js.map +1 -1
  19. package/dist/diagnostics.d.ts.map +1 -1
  20. package/dist/diagnostics.js +18 -1
  21. package/dist/diagnostics.js.map +1 -1
  22. package/dist/final-index.d.ts +7 -1
  23. package/dist/final-index.d.ts.map +1 -1
  24. package/dist/final-index.js +10 -3
  25. package/dist/final-index.js.map +1 -1
  26. package/dist/hooks.d.ts +24 -1
  27. package/dist/hooks.d.ts.map +1 -1
  28. package/dist/hooks.js +24 -2
  29. package/dist/hooks.js.map +1 -1
  30. package/dist/image-refs.d.ts +51 -0
  31. package/dist/image-refs.d.ts.map +1 -0
  32. package/dist/image-refs.js +169 -0
  33. package/dist/image-refs.js.map +1 -0
  34. package/dist/image-tokens.d.ts +37 -0
  35. package/dist/image-tokens.d.ts.map +1 -0
  36. package/dist/image-tokens.js +158 -0
  37. package/dist/image-tokens.js.map +1 -0
  38. package/dist/memtree-body.d.ts +52 -0
  39. package/dist/memtree-body.d.ts.map +1 -0
  40. package/dist/memtree-body.js +99 -0
  41. package/dist/memtree-body.js.map +1 -0
  42. package/dist/memtree-mcp.d.ts.map +1 -1
  43. package/dist/memtree-mcp.js +4 -0
  44. package/dist/memtree-mcp.js.map +1 -1
  45. package/dist/memtree.d.ts +86 -3
  46. package/dist/memtree.d.ts.map +1 -1
  47. package/dist/memtree.js +283 -53
  48. package/dist/memtree.js.map +1 -1
  49. package/dist/model-context.d.ts +80 -0
  50. package/dist/model-context.d.ts.map +1 -0
  51. package/dist/model-context.js +192 -0
  52. package/dist/model-context.js.map +1 -0
  53. package/dist/paused-session.d.ts.map +1 -1
  54. package/dist/paused-session.js +11 -8
  55. package/dist/paused-session.js.map +1 -1
  56. package/dist/payment-gate.d.ts +2 -0
  57. package/dist/payment-gate.d.ts.map +1 -1
  58. package/dist/payment-gate.js +1 -1
  59. package/dist/payment-gate.js.map +1 -1
  60. package/dist/prefix-store.d.ts +2 -0
  61. package/dist/prefix-store.d.ts.map +1 -1
  62. package/dist/prefix-store.js +4 -0
  63. package/dist/prefix-store.js.map +1 -1
  64. package/dist/prepared-compression.d.ts +78 -0
  65. package/dist/prepared-compression.d.ts.map +1 -0
  66. package/dist/prepared-compression.js +127 -0
  67. package/dist/prepared-compression.js.map +1 -0
  68. package/dist/proxy.d.ts +370 -14
  69. package/dist/proxy.d.ts.map +1 -1
  70. package/dist/proxy.js +797 -94
  71. package/dist/proxy.js.map +1 -1
  72. package/dist/reqlog.d.ts +55 -0
  73. package/dist/reqlog.d.ts.map +1 -1
  74. package/dist/reqlog.js.map +1 -1
  75. package/dist/request-sizing.d.ts +21 -2
  76. package/dist/request-sizing.d.ts.map +1 -1
  77. package/dist/request-sizing.js +57 -11
  78. package/dist/request-sizing.js.map +1 -1
  79. package/dist/route-identity.d.ts +27 -0
  80. package/dist/route-identity.d.ts.map +1 -1
  81. package/dist/route-identity.js +88 -8
  82. package/dist/route-identity.js.map +1 -1
  83. package/dist/token-estimate.d.ts +3 -20
  84. package/dist/token-estimate.d.ts.map +1 -1
  85. package/dist/token-estimate.js +9 -50
  86. package/dist/token-estimate.js.map +1 -1
  87. package/dist/tool-output-store.d.ts +12 -0
  88. package/dist/tool-output-store.d.ts.map +1 -0
  89. package/dist/tool-output-store.js +146 -0
  90. package/dist/tool-output-store.js.map +1 -0
  91. package/dist/tool-result-truncation.d.ts +32 -0
  92. package/dist/tool-result-truncation.d.ts.map +1 -0
  93. package/dist/tool-result-truncation.js +135 -0
  94. package/dist/tool-result-truncation.js.map +1 -0
  95. package/package.json +1 -1
package/dist/proxy.d.ts CHANGED
@@ -39,12 +39,20 @@
39
39
  * upstream response bytes pass through to the client unchanged.
40
40
  */
41
41
  import { capCacheBreakpoints } from "./route-cache.js";
42
- import { estimateRequestTokens } from "./request-sizing.js";
43
- import { MemtreeClient } from "./memtree.js";
44
- import { type FirstTreeIntro } from "./hooks.js";
42
+ import { PromptAccounting } from "./prompt-accounting.js";
43
+ import { RouteFallbackFailures } from "./route-fallback.js";
44
+ import { CountTokensCooldowns, type SizeSample } from "./count-tokens.js";
45
+ import { RequestSizing, estimateRequestTokens, type RequestCandidate } from "./request-sizing.js";
46
+ import { PreparedCompressions } from "./prepared-compression.js";
47
+ import type { ToolOutputStore } from "./tool-output-store.js";
48
+ import { MemtreeClient, type CompressResult } from "./memtree.js";
49
+ import { type Message } from "./turns.js";
50
+ import { NoticeDeliveryQueue, type FirstTreeIntro } from "./hooks.js";
51
+ import { ModelContextNotices } from "./model-context.js";
52
+ import { PaymentNoticeThrottle } from "./payment-notice.js";
45
53
  import type { MemtreeLinkPlacement } from "./cli-args.js";
46
54
  import { type MemtreeLinkStore } from "./memtree-links.js";
47
- import type { StablePrefixStore } from "./prefix-store.js";
55
+ import type { PersistedEntry, StablePrefixStore } from "./prefix-store.js";
48
56
  import type { NewestTreeLookup } from "./memtree-newest.js";
49
57
  import type { TranscriptUsageSource } from "./transcript-usage.js";
50
58
  import type { ProjectMeta } from "./project-meta.js";
@@ -161,6 +169,12 @@ export interface ProxyOptions {
161
169
  * persistence (tests); the CLI passes the store under ~/.claude-code-infinite.
162
170
  */
163
171
  stablePrefixStore?: StablePrefixStore;
172
+ /**
173
+ * Where a tool result shortened to fit the window (truncatedToFit) is saved
174
+ * whole, for the model to read with its Read tool. Omitted means no such
175
+ * shortening (tests); the CLI passes the store under ~/.claude-code-infinite.
176
+ */
177
+ toolOutputs?: ToolOutputStore;
164
178
  /**
165
179
  * The session's newest completed tree, asked of the server, which the link
166
180
  * shown to the user points at (the compress page is only the tree the memory
@@ -234,22 +248,309 @@ export interface RunningProxy {
234
248
  */
235
249
  mainSessionId: () => string | undefined;
236
250
  }
251
+ /**
252
+ * A MemTree page the server stamped on a main-conversation compress, with
253
+ * the completed index that turn was compressed against. The page shows that
254
+ * index until the request's own tree is built, so it is safe to link at once.
255
+ */
256
+ interface MemtreePage {
257
+ sessionId?: string;
258
+ url: string;
259
+ /** `X-Polychat-Memtree-Index`: what the link is news about. */
260
+ index: string;
261
+ /**
262
+ * Whether the call behind the page actually compressed. False means the
263
+ * conversation fit the model's budget and went out whole; the trailer says
264
+ * so, since the link alone reads as "MemTree rewrote this turn".
265
+ */
266
+ compressed: boolean;
267
+ seq: number;
268
+ }
269
+ /** Per-server mutable state (one server per ccc process). */
270
+ interface ProxyState {
271
+ /** Unpaid-key notice throttle; marked only when a hook delivers the notice. */
272
+ paymentNotice: PaymentNoticeThrottle;
273
+ /** Invalid-key (401/403) notice throttle, on the payment notice's interval. */
274
+ keyNotice: PaymentNoticeThrottle;
275
+ /** Whether MemTree's latest answer refused the key (MemtreeClient.keyInvalid). */
276
+ keyInvalid: () => boolean;
277
+ /** Where to get a new MemTree key (MemtreeClient.keyPageUrl). */
278
+ keyPageUrl: string;
279
+ /**
280
+ * Sessions shown the paused notice's near-the-window line: once per session,
281
+ * past the throttle, since /compact only works while the conversation fits.
282
+ */
283
+ pausedNearWindowWarned: Set<string>;
284
+ /** The queued near-window line, so a refusal can withdraw it undelivered. */
285
+ nearWindowNotice?: object;
286
+ /** The MemTree client's last 402 detail, or null while the key is paid. */
287
+ unpaidDetail: () => string | null;
288
+ /** The 402 detail only while MemTree's latest answer was that 402 (MemtreeClient.pausedDetail). */
289
+ pausedDetail: () => string | null;
290
+ /** Why the key is paused, when the server said (MemtreeClient.pausedReason). */
291
+ pausedReason: () => string | null;
292
+ /** Whether MemTree's latest answer was a success (MemtreeClient.answering). */
293
+ memtreeAnswering: () => boolean | undefined;
294
+ /** What each session's model was told about MemTree's state; blocked /compacts. */
295
+ modelNotices: ModelContextNotices;
296
+ /** polychat's usage dashboard for the MemTree environment, if known. */
297
+ usageUrl: string | undefined;
298
+ /** ProxyOptions.sessionStartNotice. */
299
+ sessionStartNotice?: () => string | undefined;
300
+ /** ProxyOptions.promptSubmitNotice. */
301
+ promptSubmitNotice?: () => string | undefined;
302
+ /** ProxyOptions.projectTrees. */
303
+ projectTrees?: ProjectTreesHint;
304
+ /** ProxyOptions.diagnostics. */
305
+ diagnostics?: DiagnosticsRecorder;
306
+ notices: NoticeDeliveryQueue;
307
+ /** RunningProxy.mainSessionId. */
308
+ resumableMainSession?: string;
309
+ /** Hook state affects notices only, never routing. */
310
+ mainNoticePending: boolean;
311
+ mainPromptId?: string;
312
+ mainPromptText?: string;
313
+ mainPromptGeneration: number;
314
+ promptAccounting: PromptAccounting;
315
+ fallbackFailures: RouteFallbackFailures;
316
+ /** Suppress producer-side state changes while agent API traffic is active. */
317
+ activeSubagents: Set<string>;
318
+ /** Validated prefixes per API session/lane, LRU-bounded to MEMORY_ROUTE_MAX_LANES. */
319
+ memoryRoutes: Map<string, MemoryRoute>;
320
+ /** Latest main route for validated away-summary forks, independent of hook events. */
321
+ lastMainRoute?: MemoryRoute;
322
+ /**
323
+ * Index coverage (MemTree `cached_tokens`) observed on the last compression
324
+ * this session displayed a notice for. Only a turn whose coverage GREW
325
+ * indexed newer messages; equal coverage means MemTree re-unfolded the same
326
+ * index behind the current question and appended this turn verbatim, which
327
+ * is not something to announce.
328
+ *
329
+ * Coverage, not the rendered memory text, is the signal: the server unfolds
330
+ * the index per question (expanding the sections relevant to it), so the
331
+ * memory message differs byte-wise on nearly every turn even when nothing
332
+ * new was indexed.
333
+ */
334
+ lastNoticedIndexCoverage?: {
335
+ sessionId?: string;
336
+ indexedTokens: number;
337
+ };
338
+ /**
339
+ * The newest MemTree page per session, linked from the success
340
+ * line once per new served index. `seq` orders calls by submission so a
341
+ * slow older call that settles after a newer one cannot roll the link back
342
+ * to a staler tree.
343
+ */
344
+ memtreePages: Map<string, MemtreePage>;
345
+ /**
346
+ * Per session, the page whose memory the prompt carries: set only when a
347
+ * main-lane compress answer's route is installed after a complete upstream
348
+ * response (the prefix later requests reuse), so `/memtree/current`
349
+ * (the MCP tools' "current" tree, where bare node ids resolve) never moves to
350
+ * a tree whose memory was rejected while an older prefix rides on. The link
351
+ * (memtreePages) still follows every answer.
352
+ */
353
+ memorySourcePages: Map<string, MemtreePage>;
354
+ /** Submission counter behind the pages' `seq`. */
355
+ memtreeCallSeq: number;
356
+ memtreeLinkStore?: MemtreeLinkStore;
357
+ stablePrefixStore?: StablePrefixStore;
358
+ /**
359
+ * Session → its persisted prefix as loaded (null: none, or already adopted
360
+ * or discarded), so the disk is read once per session. Bounded.
361
+ */
362
+ storedPrefixLookups: Map<string, PersistedEntry | null>;
363
+ /** MemtreeClient.storageIdentity: whose persisted prefixes this process may use. */
364
+ storageOwner?: string;
365
+ newestTrees?: NewestTreeLookup;
366
+ memtreeLinkPlacement: MemtreeLinkPlacement;
367
+ /**
368
+ * `/memtree-compact` targets by Claude Code session: every compression for
369
+ * that session asks the server for this whole-request size instead of the
370
+ * model-based budget, so it stays compressed while it would still fit.
371
+ */
372
+ /**
373
+ * Per-session `/memtree-compact` target; null means explicitly off, and
374
+ * undefined the automatic target (half the budget) even when
375
+ * `CCC_COMPACT_TARGET=off` made off the default.
376
+ */
377
+ compactTargets: Map<string, number | null | undefined>;
378
+ /** `CCC_COMPACT_TARGET=off`: sessions start with compaction off. */
379
+ defaultCompactOff: boolean;
380
+ /**
381
+ * Sessions that ran `/memtree-compact [N]` and have not compacted since:
382
+ * their next main human turn compresses whatever its size (reason
383
+ * "manual").
384
+ */
385
+ compactNow: Set<string>;
386
+ /**
387
+ * Each session's stable compressed prefix (edge compaction): the bytes of
388
+ * its last compaction, reused unchanged on every later main-thread request
389
+ * — human turns included — until prefix + newer turns reach the budget
390
+ * again or the messages it covers change. Unlike memoryRoutes it survives
391
+ * turn boundaries, which is what makes it a prompt-cache read on every
392
+ * human turn after the one that compacted. LRU-bounded.
393
+ */
394
+ stablePrefixes: Map<string, StablePrefix>;
395
+ /**
396
+ * Each session's prepared compressed prefix (prepared-compression.ts): made
397
+ * in the background once the main thread's request nears the budget, and
398
+ * installed as the stable prefix, with no compress call, on the turn that
399
+ * would cross it.
400
+ */
401
+ prepared: PreparedCompressions<StablePrefix>;
402
+ /** Each session's preparation still in flight (maybePrepareCompression). */
403
+ preparing: Map<string, Promise<void>>;
404
+ /**
405
+ * Conversations with an under-budget background compress in flight
406
+ * (compressInBackground), each with the newest call waiting for it, if any.
407
+ * An entry lives only while its call runs, so this holds no more than the calls.
408
+ */
409
+ backgroundCompress: Map<string, {
410
+ waiting?: BackgroundCompressArgs;
411
+ }>;
412
+ /**
413
+ * Model budgets the server reported (`model_budget_tokens`), keyed by
414
+ * model and context window (serverBudgetKey).
415
+ */
416
+ serverBudgets: Map<string, number>;
417
+ /**
418
+ * True once any compress response carried `model_budget_tokens`: the
419
+ * server understands `compression_threshold_tokens`, so it can make the
420
+ * over-budget decision itself. Until then the proxy decides from its own
421
+ * size estimate.
422
+ */
423
+ serverReportsBudget: boolean;
424
+ countTokensCooldowns: CountTokensCooldowns;
425
+ /**
426
+ * Per session and model (sessionSizeKey): Anthropic's reported size of the
427
+ * last main-thread request forwarded whole (no prefix), with its body bytes,
428
+ * to estimate the next one while the session is still passing through. The
429
+ * model is part of the key because the ratio is its tokenizer's: a Haiku
430
+ * side request on the main lane once replaced the Opus sample (2026-10-13).
431
+ */
432
+ passthroughSizes: Map<string, SizeSample>;
433
+ /**
434
+ * The same for requests other than the main thread's (subagents), keyed by
435
+ * laneSizeKey: the lane, the requester's own agent id and the model, so a
436
+ * helper sharing a subagent's lane (a web-search call reporting server tool
437
+ * results as input) cannot teach that subagent its ratio (2026-10-05).
438
+ */
439
+ laneSizes: Map<string, SizeSample>;
440
+ /** Process lifetime identity; hooks never advance it. */
441
+ mainRouteEpoch: number;
442
+ /** Monotonically orders asynchronous replacements within each request lane. */
443
+ mainRouteDecisionGeneration: number;
444
+ /** Live and committed lane generations. At most 128 lanes; evicted generations fail closed. */
445
+ routeDecisionsLive: Map<string, Set<number>>;
446
+ retiredRouteDecisionFloor: number;
447
+ /** At most 128 recovery attempts; failed attempts retry after growth or their deadline. */
448
+ toolRecoveryAttemptedLanes: Map<string, ToolRecoveryAttempt>;
449
+ /**
450
+ * Epoch-ms deadline until which tool-route miss recovery skips its blocking
451
+ * attempt, set when an attempt returns null. Zero means no cooldown.
452
+ */
453
+ toolRecoveryCooldownUntil: number;
454
+ /** Fired by drain after its grace period so every forwarding path can stop. */
455
+ shutdownSignal: AbortSignal;
456
+ /**
457
+ * Fired as drain starts: background compress and prepare calls (not awaited by any
458
+ * request) stop, and none starts, so the exit drain is left to the final index.
459
+ */
460
+ backgroundSignal: AbortSignal;
461
+ /** Test-only fault-injection seam; see ProxyOptions.routeInstallFault. */
462
+ routeInstallFault?: () => void;
463
+ }
464
+ interface MemoryRoute {
465
+ sessionId: string;
466
+ originalSystemHash: string;
467
+ originalPrefixHashes: string[];
468
+ /** Media-free identities of the same messages (prefixMessageMatches); absent on old stores. */
469
+ originalMediaFreeHashes?: string[];
470
+ compressedMessages: Message[];
471
+ compressedSystem: unknown;
472
+ hasCompressedSystem: boolean;
473
+ routeEpoch: number;
474
+ /**
475
+ * The stable prefix this route's compressed messages start with, when the
476
+ * route came from a main-thread compaction or prefix ride. Tool turns that
477
+ * ride the route report their Anthropic usage to it (lastSize).
478
+ */
479
+ stablePrefix?: StablePrefix;
480
+ /**
481
+ * Newest reported size of a tool turn sent on this route, for a route with
482
+ * no stable prefix (subagent lanes; sessions with compaction off). The
483
+ * tool-turn budget check (planToolCompaction) starts from it.
484
+ */
485
+ lastSize?: SizeSample;
486
+ }
487
+ /**
488
+ * A session's stable compressed prefix (see ProxyState.stablePrefixes). The
489
+ * route fields mean what they mean on MemoryRoute: the hashes of the original
490
+ * messages the prefix stands for, and the compressed bytes sent instead.
491
+ */
492
+ interface StablePrefix {
493
+ sessionId: string;
494
+ originalSystemHash: string;
495
+ originalPrefixHashes: string[];
496
+ /** Media-free identities of the same messages (prefixMessageMatches); absent on old stores. */
497
+ originalMediaFreeHashes?: string[];
498
+ compressedMessages: Message[];
499
+ compressedSystem: unknown;
500
+ hasCompressedSystem: boolean;
501
+ /** The compaction target this prefix was built with. */
502
+ targetTokens: number;
503
+ /** Whether that target was explicit (N / CCC_COMPACT_TARGET) or budget/2. */
504
+ explicitTarget: boolean;
505
+ /** Context window of the request that built it; a change recompresses. */
506
+ modelContextLimit: number;
507
+ /** Newest reported size of a request sent on this prefix. */
508
+ lastSize?: SizeSample;
509
+ }
237
510
  /**
238
511
  * Budget fallback until the server reports `model_budget_tokens`, mirroring the
239
- * server's ccc policy (polychat index_budget.py): every Claude model compresses
240
- * near its window, NEAR_WINDOW_FALLBACK_RATIO of it but no later than Claude
241
- * Code's own auto-compact point (window - CLAUDE_CODE_AUTOCOMPACT_RESERVE_TOKENS)
242
- * and never below FALLBACK_BUDGET_WINDOW_RATIO: 900k of 1M, 167k of 200k; at
243
- * most a Sonnet's usable-context ceiling (SONNET_CEILINGS). Other models get
244
- * FALLBACK_BUDGET_WINDOW_RATIO. Plain Claude Code 2.1.302 auto-compacts a 1M
245
- * window at 967k, so MemTree compresses no earlier than ~70k before it would;
246
- * ccc lifts Claude Code's own 977k refusal (claude-env.ts) so a tool turn that
247
- * jumps past the budget reaches the proxy and is compressed here.
512
+ * server's ccc policy (polychat index_budget.py near_window_budget_tokens):
513
+ * every Claude model compresses near its window, at the window less the
514
+ * reply's room (COMPRESSION_RESERVE_TOKENS, 40k) and never below
515
+ * FALLBACK_BUDGET_WINDOW_RATIO of it: 960k of 1M, 160k of 200k; at most a
516
+ * Sonnet's usable-context ceiling (SONNET_CEILINGS). Other models get
517
+ * FALLBACK_BUDGET_WINDOW_RATIO. Plain Claude Code 2.1.302 auto-compacts at
518
+ * window - 33k (967k of 1M), so MemTree compresses just before it would; ccc
519
+ * lifts Claude Code's own 977k refusal (claude-env.ts) so a tool turn that
520
+ * jumps past the budget reaches the proxy and is compressed here, on a
521
+ * prepared prefix when there is one (prepared-compression.ts).
248
522
  */
249
523
  export declare const FALLBACK_BUDGET_WINDOW_RATIO = 0.8;
250
- export declare const NEAR_WINDOW_FALLBACK_RATIO = 0.9;
251
524
  /** The fallback whole-request budget for `model` on this window (see above). */
252
525
  export declare function fallbackBudgetTokens(model: unknown, modelContextLimit: number): number;
526
+ interface ToolRecoveryAttempt {
527
+ retryDeadline?: number;
528
+ modelContextLimit: number;
529
+ inFlight: boolean;
530
+ /**
531
+ * Set when the attempt produced no prefix (failure, no-op, no gain, ...):
532
+ * the lane's next attempt this human turn waits until the estimate reaches
533
+ * this size, so a lane that cannot compress does not pay a blocking call on
534
+ * every tool turn (routeRecovery outcome "backoff").
535
+ */
536
+ retryAtTokens?: number;
537
+ /**
538
+ * Set when the attempt's reply showed no finished tree for the conversation
539
+ * (a no-op with no indexed tokens), or a reply whose index trails the
540
+ * conversation (indexLagEvidence). Until the
541
+ * tree catches up a compress call cannot shrink that history: the server
542
+ * keeps every unindexed message verbatim. The lane
543
+ * makes no compress call (routeRecovery outcome "awaiting-index") and
544
+ * instead checks, in the background and one at a time, whether that
545
+ * reply's MemTree page has finished building. A window overflow still
546
+ * attempts.
547
+ */
548
+ awaitingIndex?: {
549
+ pageId: string;
550
+ checking: boolean;
551
+ deadline: number;
552
+ };
553
+ }
253
554
  export declare function startProxy(opts: ProxyOptions): Promise<RunningProxy>;
254
555
  /** The page id in a server-stamped link (`…/m/<id>` or `…/usage/memtree/<id>`). */
255
556
  export declare function memtreePageId(pageUrl: string): string | undefined;
@@ -273,9 +574,64 @@ export declare function parseTokenCount(text: string): number | undefined;
273
574
  * never bytes/4, which reads base64 images as text.
274
575
  */
275
576
  declare function compressedResultExceedsWindow(body: Record<string, any>, rec: MessagesRecord, compressedRaw: Buffer, modelContextLimit: number, exactTokens?: number): boolean;
577
+ interface BlockingCompressionOutcome {
578
+ result: CompressResult | null;
579
+ /** Current server-health evidence contributed by this blocking operation. */
580
+ liveHealth: "success" | "failure" | "none";
581
+ }
582
+ /**
583
+ * The blocking-compression step, shared by the main followup path and
584
+ * tool-route miss recovery: the compress call plus the `compress` telemetry
585
+ * record. Callers own downstream-close tracking (compression promises are
586
+ * hash-deduped and may serve another live retry, so a per-request disconnect
587
+ * signal must never feed compress()) and all decisions about the returned
588
+ * result: both `didMemtreeCompress(result)` and
589
+ * `checkCompressedHistory(result, msgsForMemtree).usable` must hold before
590
+ * the result may be forwarded or become a route.
591
+ */
592
+ declare function runBlockingCompression(args: {
593
+ opts: ProxyOptions;
594
+ state: ProxyState;
595
+ body: Record<string, any>;
596
+ msgsForMemtree: Message[];
597
+ hash: string;
598
+ modelContextLimit: number;
599
+ rec: MessagesRecord;
600
+ sessionId: string | undefined;
601
+ /** The subagent this request belongs to: its transcript has the usage and times. */
602
+ agentId?: string;
603
+ clientMeta?: Record<string, string>;
604
+ sizing: RequestSizing;
605
+ inputCandidate?: RequestCandidate;
606
+ /**
607
+ * compression_target_tokens / compression_threshold_tokens for this call.
608
+ * Omitted: laneCompaction's (never a bare forcing target).
609
+ */
610
+ compaction?: {
611
+ target?: number;
612
+ threshold?: number;
613
+ };
614
+ /**
615
+ * Nothing else could be sent if this compress fails (no prefix to ride, raw
616
+ * request known over the window): use the long budget. See longCompressFor.
617
+ */
618
+ longBudget?: boolean;
619
+ /** Aborts the compress call; default state.shutdownSignal. */
620
+ signal?: AbortSignal;
621
+ }): Promise<BlockingCompressionOutcome>;
622
+ type BackgroundCompressArgs = Omit<Parameters<typeof runBlockingCompression>[0], "longBudget"> & {
623
+ linkSeq?: number;
624
+ };
625
+ /**
626
+ * Run a delivery-time compression as the lane's in-flight operation, so a
627
+ * concurrent request of the lane neither starts its own (planning sees
628
+ * "in-flight") nor races it; the lane's own attempt state is kept.
629
+ */
630
+ declare function holdingLane<T>(state: ProxyState, routeKey: string, run: () => Promise<T>): Promise<T>;
276
631
  /** Test seam. */
277
632
  export declare const __testCapCacheBreakpoints: typeof capCacheBreakpoints;
278
633
  export declare const __testEstimateRequestTokens: typeof estimateRequestTokens;
279
634
  export declare const __testCompressedResultExceedsWindow: typeof compressedResultExceedsWindow;
635
+ export declare const __testHoldingLane: typeof holdingLane;
280
636
  export {};
281
637
  //# sourceMappingURL=proxy.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"proxy.d.ts","sourceRoot":"","sources":["../src/proxy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAUvD,OAAO,EAAiB,qBAAqB,EACD,MAAM,qBAAqB,CAAC;AAiBxE,OAAO,EAKL,aAAa,EAMd,MAAM,cAAc,CAAC;AAwBtB,OAAO,EAYL,KAAK,cAAc,EAGpB,MAAM,YAAY,CAAC;AAMpB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAA8B,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACvF,OAAO,KAAK,EAAkB,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAW5D,OAAO,KAAK,EAAgB,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACjF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,K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