@khorsheed/dsh-context-lens 0.0.0-stage → 0.1.0

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 (94) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.en.md +53 -0
  3. package/README.i18n.yaml +6 -0
  4. package/README.md +52 -2
  5. package/cordis.patch.yml +13 -0
  6. package/lib/client.js +26953 -0
  7. package/lib/index.js +3943 -0
  8. package/lib/typert.host.d.ts +3 -0
  9. package/lib/typert.host.js +1569 -0
  10. package/lib/typert.remote-client.d.ts +40 -0
  11. package/lib/typert.remote-client.js +1202 -0
  12. package/lib/types/changes.d.ts +72 -0
  13. package/lib/types/changes.js +328 -0
  14. package/lib/types/client/AgentTabs.d.ts +34 -0
  15. package/lib/types/client/AgentTabs.js +89 -0
  16. package/lib/types/client/ChangeList.d.ts +28 -0
  17. package/lib/types/client/ChangeList.js +109 -0
  18. package/lib/types/client/ConfigFacts.d.ts +21 -0
  19. package/lib/types/client/ConfigFacts.js +30 -0
  20. package/lib/types/client/HeaderUtility.d.ts +12 -0
  21. package/lib/types/client/HeaderUtility.js +8 -0
  22. package/lib/types/client/InspectorPanel.d.ts +5 -0
  23. package/lib/types/client/InspectorPanel.js +486 -0
  24. package/lib/types/client/RawView.d.ts +18 -0
  25. package/lib/types/client/RawView.js +8 -0
  26. package/lib/types/client/RequestFacts.d.ts +19 -0
  27. package/lib/types/client/RequestFacts.js +39 -0
  28. package/lib/types/client/RoomDecisionsView.d.ts +24 -0
  29. package/lib/types/client/RoomDecisionsView.js +52 -0
  30. package/lib/types/client/SchemaFields.d.ts +13 -0
  31. package/lib/types/client/SchemaFields.js +96 -0
  32. package/lib/types/client/SegCtl.d.ts +32 -0
  33. package/lib/types/client/SegCtl.js +12 -0
  34. package/lib/types/client/SegmentBlocks.d.ts +28 -0
  35. package/lib/types/client/SegmentBlocks.js +225 -0
  36. package/lib/types/client/TimingView.d.ts +17 -0
  37. package/lib/types/client/TimingView.js +98 -0
  38. package/lib/types/client/TokenView.d.ts +21 -0
  39. package/lib/types/client/TokenView.js +22 -0
  40. package/lib/types/client/ToolCatalog.d.ts +9 -0
  41. package/lib/types/client/ToolCatalog.js +51 -0
  42. package/lib/types/client/Trend.d.ts +25 -0
  43. package/lib/types/client/Trend.js +100 -0
  44. package/lib/types/client/TurnAction.d.ts +14 -0
  45. package/lib/types/client/TurnAction.js +31 -0
  46. package/lib/types/client/TurnMenu.d.ts +36 -0
  47. package/lib/types/client/TurnMenu.js +50 -0
  48. package/lib/types/client/aggregate.d.ts +141 -0
  49. package/lib/types/client/aggregate.js +213 -0
  50. package/lib/types/client/contract.d.ts +58 -0
  51. package/lib/types/client/contract.js +1 -0
  52. package/lib/types/client/definition.d.ts +47 -0
  53. package/lib/types/client/definition.js +25 -0
  54. package/lib/types/client/icons-local.d.ts +19 -0
  55. package/lib/types/client/icons-local.js +3 -0
  56. package/lib/types/client/icons.d.ts +18 -0
  57. package/lib/types/client/icons.js +2 -0
  58. package/lib/types/client/index.d.ts +42 -0
  59. package/lib/types/client/index.js +139 -0
  60. package/lib/types/client/locales.d.ts +365 -0
  61. package/lib/types/client/locales.js +705 -0
  62. package/lib/types/client/preset-visibility.d.ts +99 -0
  63. package/lib/types/client/preset-visibility.js +108 -0
  64. package/lib/types/client/scroll-sync.d.ts +54 -0
  65. package/lib/types/client/scroll-sync.js +118 -0
  66. package/lib/types/client/timing.d.ts +29 -0
  67. package/lib/types/client/timing.js +117 -0
  68. package/lib/types/client/wire.d.ts +13 -0
  69. package/lib/types/client/wire.js +11 -0
  70. package/lib/types/index.d.ts +32 -0
  71. package/lib/types/index.js +25 -0
  72. package/lib/types/log-lane.d.ts +198 -0
  73. package/lib/types/log-lane.js +841 -0
  74. package/lib/types/messages.d.ts +96 -0
  75. package/lib/types/messages.js +254 -0
  76. package/lib/types/prefix-diff.d.ts +4 -0
  77. package/lib/types/prefix-diff.js +20 -0
  78. package/lib/types/remote.d.ts +45 -0
  79. package/lib/types/remote.js +99 -0
  80. package/lib/types/room.d.ts +66 -0
  81. package/lib/types/room.js +101 -0
  82. package/lib/types/segmenter.d.ts +100 -0
  83. package/lib/types/segmenter.js +184 -0
  84. package/lib/types/service.d.ts +145 -0
  85. package/lib/types/service.js +493 -0
  86. package/lib/types/store.d.ts +424 -0
  87. package/lib/types/store.js +1920 -0
  88. package/lib/types/tool-summary.d.ts +6 -0
  89. package/lib/types/tool-summary.js +7 -0
  90. package/lib/types/types.d.ts +703 -0
  91. package/lib/types/types.js +18 -0
  92. package/locale/en.json +6 -0
  93. package/locale/zh.json +6 -0
  94. package/package.json +133 -3
@@ -0,0 +1,424 @@
1
+ import type { BackfillInfo, CapturedRequest, CapturedResponse, ListTurnsResult, SessionTrend, RequestConfig, RequestTiming, RequestUsage, ResponseSummary, ScopeFilter, ScopedRefusal, TurnOverview, TurnTiming } from './types.ts';
2
+ import { type CapturedToolSchema, type ScopeFingerprint, type AssemblyRecord } from './segmenter.ts';
3
+ import { type CapturedMessage } from './messages.ts';
4
+ import type { LogTurn } from './log-lane.ts';
5
+ import { type ReplacementFact } from './changes.ts';
6
+ /** Retention knobs (InspectorConfig in the service mirrors these). */
7
+ export interface StoreConfig {
8
+ /** Turns retained per session (oldest closed first, backfilled before live). Default 30. */
9
+ maxTurnsPerSession?: number;
10
+ /** Log-reconstructed main-scope requests retained per session. Default 500. */
11
+ maxBackfillRequestsPerSession?: number;
12
+ /**
13
+ * Global budget of stored segment text characters across all sessions — the
14
+ * real memory driver is the segments' `full` text (~200KB per request), not
15
+ * the row count. Default 150M chars (~150MB).
16
+ */
17
+ maxStoredCharsTotal?: number;
18
+ }
19
+ /** One streamed content block's open/closed time span. */
20
+ export interface BlockSpan {
21
+ kind: string;
22
+ index: number;
23
+ start: number;
24
+ end?: number;
25
+ /** tool-call blocks: call id, name, and raw arguments (the response hint's source). */
26
+ callId?: string;
27
+ toolName?: string;
28
+ args?: string;
29
+ /**
30
+ * text/reasoning content: delta-accumulated while streaming, overwritten by
31
+ * the authoritative assembled block at block-end. This is what makes a
32
+ * cancelled mid-block response partially visible.
33
+ */
34
+ text?: string;
35
+ }
36
+ /** One tool execution interval attributed to the request that issued the call. */
37
+ export interface ToolExecSpan {
38
+ callId: string;
39
+ name: string;
40
+ start: number;
41
+ end?: number;
42
+ isError?: boolean;
43
+ result?: string;
44
+ }
45
+ /** A request row as the store keeps it — the wire shapes assemble on query. */
46
+ export interface StoredRequest {
47
+ requestNumber?: number;
48
+ /** The request's own session turn (log lane): a member child's run is one of these. */
49
+ hostTurn?: number;
50
+ seq: number;
51
+ sessionId: string;
52
+ scopeId: string;
53
+ turnSeq: number;
54
+ purpose?: string;
55
+ compaction?: CapturedRequest['compaction'];
56
+ startedAt: number;
57
+ status: 'streaming' | 'ok' | 'failed';
58
+ error?: string;
59
+ config: RequestConfig;
60
+ usage?: RequestUsage;
61
+ responseSummary: ResponseSummary;
62
+ segments: CapturedRequest['segments'];
63
+ totalChars: number;
64
+ /** The response's own char weight (counted in the store budget, not in 请求体 totalChars). */
65
+ responseChars?: number;
66
+ /** Execution result storage, excluded from request/input metrics. */
67
+ executionChars?: number;
68
+ /** The request's own response, set at settle (see CapturedRequest.response). */
69
+ response?: CapturedResponse;
70
+ firstChunkAt?: number;
71
+ settledAt?: number;
72
+ finishKind?: string;
73
+ blocks: BlockSpan[];
74
+ execs: ToolExecSpan[];
75
+ fingerprint: ScopeFingerprint;
76
+ /** Live capture preceded availability of its conversation-history baseline. */
77
+ needsHistoryBaseline?: boolean;
78
+ }
79
+ /** One scope row's internal record (exported via {@link TurnRecord}). */
80
+ export interface ScopeRecord {
81
+ scopeId: string;
82
+ /** Per-session 1-based ordinal in scope-creation order (the chip's `#N`). */
83
+ scopeSeq: number;
84
+ kind: 'main' | 'subagent';
85
+ label?: string;
86
+ status: 'running' | 'ok' | 'failed';
87
+ error?: string;
88
+ config: RequestConfig;
89
+ requests: StoredRequest[];
90
+ startedAt: number;
91
+ endedAt?: number;
92
+ /** Fingerprint of the scope's latest request — the next request's diff baseline. */
93
+ previous?: ScopeFingerprint;
94
+ /** True once a live (in-process) request landed; the log lane then stays out. */
95
+ live: boolean;
96
+ /** True once the log lane reconstructed requests here; live capture then stays out. */
97
+ logFilled: boolean;
98
+ /** The delegation call this scope answers, when bound. */
99
+ callId?: string;
100
+ /** The child's `subagent/descriptor` provider (`dsh-cli`, `codex-local`, …), once seen. */
101
+ provider?: string;
102
+ }
103
+ /** One turn row's internal record (exported for the eviction hook's signature). */
104
+ export interface TurnRecord {
105
+ /**
106
+ * The panel-facing address. Real turns key on the host's own turn number
107
+ * (the `turn/start` payload — a stable per-session ordinal shared with the
108
+ * log lane, so live-captured and log-reconstructed turns can never
109
+ * duplicate); purpose pseudo-turns take negative addresses from the
110
+ * session's bucket counter.
111
+ */
112
+ turnSeq: number;
113
+ /** The host's own turn number; absent on purpose pseudo-turns. */
114
+ hostTurn?: number;
115
+ /** Purpose key on pseudo-turns (`compaction`, `session-title`, …). */
116
+ purpose?: string;
117
+ /** True once any live (in-process) request or bracket landed here — backfill never merges into such a turn. */
118
+ liveContent: boolean;
119
+ /** Capture observed the turn opening, so this turn’s live request order is complete. */
120
+ liveStartObserved?: boolean;
121
+ query: string;
122
+ /** A room round: the dispatch's targets (see room.ts). */
123
+ room?: {
124
+ targets: string[];
125
+ };
126
+ /** First non-human message of the turn (see LogTurn.trigger). */
127
+ trigger?: {
128
+ source: string;
129
+ text: string;
130
+ };
131
+ /** The `turn/start` event's log seq. */
132
+ startSeq?: number;
133
+ startedAt: number;
134
+ endedAt?: number;
135
+ closingMessageId?: string;
136
+ scopes: Map<string, ScopeRecord>;
137
+ }
138
+ /** The eviction hook's view of a turn (the log lane drops child cursors on it). */
139
+ export type EvictedTurn = TurnRecord;
140
+ /** Snapshot one request needs at dispatch — the normalized GenerateOptions face. */
141
+ export interface RequestSnapshot {
142
+ sessionId?: string;
143
+ purpose?: string;
144
+ config: RequestConfig;
145
+ messages: CapturedMessage[];
146
+ systemSlot?: string;
147
+ tools?: CapturedToolSchema[];
148
+ }
149
+ /** The clock and the eviction hook are injectable; everything else is internal. */
150
+ export interface StoreDeps {
151
+ now?: () => number;
152
+ /** Turn-eviction notice (the log lane closes its per-child handles here). */
153
+ onTurnEvicted?: (sessionId: string, turn: TurnRecord) => void;
154
+ /** The instance epoch stamped on query results (restart invalidation); a mount-time id by default. */
155
+ generation?: string;
156
+ }
157
+ /**
158
+ * Whether one scope passes a read's allow-list: unfiltered when the filter
159
+ * carries no `scopes`, otherwise membership. Shared by the store's query
160
+ * methods and the service's child-log gate.
161
+ */
162
+ export declare function scopeAuthorized(scopeId: string, filter?: ScopeFilter): boolean;
163
+ /** The in-memory capture store. All mutation enters through the `note*`/`observe*` methods. */
164
+ export declare class InspectorStore {
165
+ private readonly sessions;
166
+ private readonly childToParent;
167
+ /** A session opened on its own that its log header names as a child (`parentSession`). */
168
+ private readonly parents;
169
+ /** callId → the request whose response issued the call (exec attribution). */
170
+ private readonly callOwners;
171
+ private readonly callNames;
172
+ /** Recently observed rendered assemblies (system-section attribution). */
173
+ private readonly assemblies;
174
+ private readonly now;
175
+ private readonly onTurnEvicted;
176
+ private readonly maxTurnsPerSession;
177
+ private readonly maxBackfillRequestsPerSession;
178
+ private readonly maxStoredCharsTotal;
179
+ /** The instance epoch stamped on every query result (restart invalidation). */
180
+ private readonly generation;
181
+ private seqCounter;
182
+ /** Stored segment text characters across all sessions (the memory driver). */
183
+ private totalChars;
184
+ constructor(config?: StoreConfig, deps?: StoreDeps);
185
+ /** The shared assembly ring (service feeds it from the assemble waterfall). */
186
+ get assemblyRing(): AssemblyRecord[];
187
+ /** Whether `sessionId` is a known subagent child of some captured session. */
188
+ isChild(sessionId: string): boolean;
189
+ /** The root session one request/event belongs to (children resolve up). */
190
+ private rootOf;
191
+ private session;
192
+ /** Allocate one turn row; the caller sets the address (`turnSeq`) in `init`. */
193
+ private mintTurn;
194
+ private mainScope;
195
+ /** Observe durable compression boundaries without manufacturing model calls. */
196
+ noteCompaction(sessionId: string, type: string, data: Record<string, unknown>): void;
197
+ /** Preserve pruning metadata across later requests, with bounded observation state. */
198
+ notePruning(sessionId: string, messageId: string, beforeChars: number, afterChars: number): void;
199
+ /** Record one host surface replacement (live event or log backfill) for the change list. */
200
+ noteReplacement(sessionId: string, fact: ReplacementFact): void;
201
+ /**
202
+ * Begin one captured request: correlate session/turn/scope, split the
203
+ * segments against the scope's previous fingerprint, assign the sequence.
204
+ *
205
+ * @returns the stored row, or `undefined` when the request carries no
206
+ * session identity the capture can place (a host call with no sessionId
207
+ * and no purpose is out of the panel's scope).
208
+ */
209
+ beginRequest(snapshot: RequestSnapshot, startedAt: number): StoredRequest | undefined;
210
+ /** Attach a purpose-built (log-lane) request row to an existing child scope. */
211
+ appendLogRequest(rootSessionId: string, scopeId: string, built: Omit<StoredRequest, 'seq' | 'sessionId' | 'scopeId' | 'turnSeq'>): StoredRequest | undefined;
212
+ private findScope;
213
+ /** One stream chunk observed on a live request's tee. */
214
+ observeChunk(request: StoredRequest, chunk: {
215
+ type: string;
216
+ index?: number;
217
+ blockType?: string;
218
+ text?: string;
219
+ argumentsDelta?: string;
220
+ block?: {
221
+ type: string;
222
+ id?: string;
223
+ name?: string;
224
+ arguments?: string;
225
+ text?: string;
226
+ };
227
+ usage?: RequestUsage;
228
+ reason?: {
229
+ kind: string;
230
+ failure?: {
231
+ message: string;
232
+ };
233
+ };
234
+ }, at: number): void;
235
+ /** Settle one request: ok on a clean finish, failed on an error finish or a raised error. */
236
+ settleRequest(request: StoredRequest, at: number, thrown?: unknown): void;
237
+ /** Set the request's response and count its chars into the store budget. */
238
+ private attachResponse;
239
+ private accountExecutionResults;
240
+ /** Incremental child folds mutate shared execution spans after insertion. */
241
+ refreshExecutionResults(sessionId: string, scopeId: string): void;
242
+ /** turn/start on a root session (child sessions route their events to the parent instead). */
243
+ /** @param seq - the `turn/start` event's log seq (the chat's history-jump target). */
244
+ turnStart(sessionId: string, hostTurn: number, at: number, seq?: number): void;
245
+ /** turn/end: close the open turn, resolve its main scope, sweep abandoned streams. */
246
+ turnEnd(sessionId: string, hostTurn: number, reason: {
247
+ kind: string;
248
+ error?: {
249
+ message: string;
250
+ };
251
+ }, at: number): void;
252
+ /** A human message entering the turn — the turn list's query preview. */
253
+ noteUserMessage(sessionId: string, sourceKind: string, text: string): void;
254
+ /** The turn's closing assistant message id + generation-time backfill for history rows. */
255
+ noteAssistantMessage(sessionId: string, messageId: string): void;
256
+ /** tool/call: open the exec interval (when the issuing request is known) and queue delegation binding. */
257
+ toolCall(sessionId: string, callId: string, name: string, args: string, at: number): void;
258
+ /** Source turns belong to session events, not the immutable message payload. */
259
+ noteMessageTurn(sessionId: string, messageId: string, turn?: number): void;
260
+ /** tool/result: close the exec interval; resolve a delegation scope's outcome. */
261
+ toolResult(sessionId: string, callId: string, isError: boolean, result: string, at: number): void;
262
+ /** subagent/catalog: open the child scope on the current turn and bind the pending call. */
263
+ subagentCatalog(sessionId: string, childId: string, label: string | undefined, at: number): void;
264
+ /** Open one child scope on the session's current turn (or latest turn as a fallback). */
265
+ private openChildScope;
266
+ /** Every child scope of one session (the log lane iterates these). */
267
+ childScopes(sessionId: string): {
268
+ scopeId: string;
269
+ live: boolean;
270
+ status: string;
271
+ }[];
272
+ /** The session's backfill watermark (retryable until 'complete'). */
273
+ backfillState(sessionId: string): BackfillInfo['state'];
274
+ /** A durably unreadable log stops the backfill from retrying it on every query. */
275
+ markBackfillBroken(sessionId: string, reason: string): void;
276
+ /**
277
+ * Insert log-reconstructed turns (the pre-mount history), newest-first within
278
+ * budget: live-content turns win the budget outright, a host turn with any
279
+ * record is never merged into (the overlap rule), and one oversized turn is
280
+ * SKIPPED without aborting the older ones. Scope ordinals are renumbered
281
+ * afterwards so the chips' `#N` stay chronological across the live/backfill
282
+ * boundary (scopeSeq is a display anchor, not an address).
283
+ *
284
+ * The watermark is honest: 'complete' only when every candidate fit; a
285
+ * budget-dropped candidate keeps the state 'partial', and the service
286
+ * re-reads the log on later queries (eviction may have freed room). The
287
+ * insert itself never evicts a live turn: char pressure evicts the oldest
288
+ * BACKFILLED turns first.
289
+ *
290
+ * @returns the number of turns actually inserted.
291
+ */
292
+ insertLogTurns(sessionId: string, logTurns: readonly LogTurn[]): number;
293
+ /**
294
+ * The backfill window over a log's host turns: the newest
295
+ * `maxTurnsPerSession` at or before the window's end. At the latest, live
296
+ * turns the log does not hold yet take window slots too. The log lane
297
+ * materializes only these turns' requests.
298
+ */
299
+ windowHosts(sessionId: string, hosts: readonly number[]): Set<number>;
300
+ private windowOf;
301
+ /**
302
+ * Make room for `needed` chars by evicting other sessions' backfilled
303
+ * turns, least recently read session first, oldest turn first. Live
304
+ * content never yields. A session that lost backfill re-reads it when next
305
+ * read (its state drops back to partial).
306
+ */
307
+ private freeChars;
308
+ /**
309
+ * Move a session's backfill window: drop its backfilled turns (live turns
310
+ * stay) and let the next read refill the window ending at `end` (the
311
+ * latest turns when absent).
312
+ */
313
+ setWindow(sessionId: string, end: number | undefined): void;
314
+ /** A complete log can anchor live turns without retaining old request bodies. */
315
+ private reconcileRequestNumbers;
316
+ /** Retry numbering after a streaming turn’s first durable response becomes available. */
317
+ /**
318
+ * Make a session log-driven: an external agent's session opened on its own
319
+ * (a CLI in its own process, so no request passes through this host). Its
320
+ * turns come from its log only; the live turns opened so far held nothing
321
+ * and give way to the log's.
322
+ */
323
+ markLogDriven(sessionId: string): void;
324
+ /** Any live event of a log-driven session: the next read re-reads its log. */
325
+ noteLogActivity(sessionId: string): void;
326
+ /** Whether a read should re-read a log-driven session's log. */
327
+ needsLogRead(sessionId: string): boolean;
328
+ /** A log turn's end as the store records it: still open when it is a log-driven session's last turn. */
329
+ private logTurnEnd;
330
+ private logTurnOpen;
331
+ needsRequestNumbers(sessionId: string): boolean;
332
+ /** One reconstructed turn → one TurnRecord (main scope + delegation stubs). */
333
+ private insertLogTurn;
334
+ /** One reconstructed delegation → its child scope on `turn`. */
335
+ private addDelegationScope;
336
+ /** The hidden turn holding children started outside any turn (never listed; room rounds read it). */
337
+ private holderTurn;
338
+ /** Renumber one session's scope ordinals chronologically (turn order, then creation order). */
339
+ private renumberScopes;
340
+ /**
341
+ * Light turn list of one session plus its backfill watermark (sorted newest
342
+ * last). A {@link ScopeFilter} restricts every aggregate to the authorized
343
+ * scopes; the turn rows themselves (query preview, timestamps) are
344
+ * session-level metadata and stay listed.
345
+ */
346
+ listTurns(sessionId: string, filter?: ScopeFilter): ListTurnsResult;
347
+ /** The session's existing scopes that pass the filter (turn order, then creation order). */
348
+ private authorizedScopes;
349
+ private turnItem;
350
+ /** One turn's scope/request overview, without segments. */
351
+ getTurn(sessionId: string, turnSeq: number, filter?: ScopeFilter): TurnOverview | undefined;
352
+ /**
353
+ * The room's decision-model calls by the turn they happened in: each goes to
354
+ * the latest listed turn (main turn or room round) that started at or
355
+ * before it.
356
+ */
357
+ private decisionsByTurn;
358
+ /** Record one `room/*` event of a main session (log backfill or live). */
359
+ noteRoomEvent(sessionId: string, type: string, data: unknown, seq: number | undefined, at: number | undefined): void;
360
+ /** A listed turn or a room round, by its panel address. */
361
+ private findTurn;
362
+ /** Whether a moment falls inside some main turn (loaded or not). */
363
+ private insideMainTurn;
364
+ /**
365
+ * Every human room dispatch made outside a main turn, as a round: the
366
+ * dispatch's message, and per member run the child session's requests of
367
+ * that run (its recorded child turn, else the run's time span). Built on
368
+ * read from the room state and the children's scopes; nothing is stored.
369
+ */
370
+ private roomTurns;
371
+ /** The child session a run went to: named by the run, else the child catalogued closest to the run's start. */
372
+ private childOfRun;
373
+ /**
374
+ * One numbering for the whole session, by time: every main turn (loaded or
375
+ * not) and every room round. Keys: `h<hostTurn>` for main turns,
376
+ * `t<turnSeq>` for room rounds.
377
+ */
378
+ private ordinals;
379
+ /** Runs of main turns the log holds but the store has not loaded, in ordinals, with their host-turn ends. */
380
+ private unloadedRuns;
381
+ /** A compaction pseudo-turn's host turn: the one it started in, else the next turn to begin; undefined for any other turn. */
382
+ private attachedTurn;
383
+ /** Where the panel addresses a request: compaction requests live in their host turn's `compaction:` view. */
384
+ private addressOf;
385
+ private scopeOverview;
386
+ /** Record the child's provider from its `subagent/descriptor` (live child events or its log). */
387
+ noteChildProvider(childId: string, provider: string): void;
388
+ /** A session opened on its own that is some other session's child. */
389
+ noteParent(sessionId: string, parent: NonNullable<ListTurnsResult['parent']>): void;
390
+ /** Whether a child's parent link is already known (the service resolves it once). */
391
+ hasParent(sessionId: string): boolean;
392
+ /**
393
+ * One request's full four-segment breakdown. A request whose scope the
394
+ * filter excludes answers with a {@link ScopedRefusal} — distinguishable
395
+ * from `undefined` (no such seq on this instance).
396
+ */
397
+ getRequest(sessionId: string, seq: number, filter?: ScopeFilter): CapturedRequest | ScopedRefusal | undefined;
398
+ /** Resolve change entries to retained requests: the compaction call, and the request that still held un-pruned text. */
399
+ private withLinks;
400
+ private previousRequest;
401
+ private requestView;
402
+ /** One turn's whole-turn timing aggregation, filtered to the authorized scopes. */
403
+ getTurnTiming(sessionId: string, turnSeq: number, filter?: ScopeFilter): TurnTiming | undefined;
404
+ /** Session request headers only; excluded scopes contribute no rows or aggregates. */
405
+ getSessionTrend(sessionId: string, filter?: ScopeFilter): SessionTrend;
406
+ /** Release every session buffer (plugin dispose). */
407
+ dispose(): void;
408
+ /** @param counted - false for a window move or cross-session room, which the "collected then dropped" signal does not report. */
409
+ private evictTurn;
410
+ private turnIsLive;
411
+ /** The globally oldest closed backfilled turn (char-pressure eviction order). */
412
+ private oldestBackfilledTurn;
413
+ private enforceCaps;
414
+ }
415
+ /** The six-way timing split of one request, computed from its recorded spans. */
416
+ export declare function requestTiming(request: StoredRequest): RequestTiming;
417
+ /**
418
+ * Assemble a request's own response from its recorded block spans: the
419
+ * authoritative block-end content, falling back to delta-accumulated text for
420
+ * blocks a cancelled stream never closed. `undefined` when nothing was
421
+ * produced (a failure before any block — the `error` field covers that).
422
+ */
423
+ export declare function responseFromSpans(blocks: readonly BlockSpan[]): CapturedResponse | undefined;
424
+ //# sourceMappingURL=store.d.ts.map