pi-tuck 1.1.2 → 1.2.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.
- package/CHANGELOG.md +65 -0
- package/README.md +7 -3
- package/dist/index.d.ts +2 -6
- package/dist/index.js +16 -111
- package/dist/src/build-id.d.ts +1 -1
- package/dist/src/build-id.js +1 -1
- package/dist/src/compaction.d.ts +2 -103
- package/dist/src/compaction.js +29 -146
- package/dist/src/diagnostic-replay.js +2 -2
- package/dist/src/diagnostics.d.ts +3 -2
- package/dist/src/diagnostics.js +30 -9
- package/dist/src/history-tools.js +3 -3
- package/dist/src/kept-reads.d.ts +2 -2
- package/dist/src/kept-reads.js +144 -8
- package/dist/src/ledger.d.ts +1 -1
- package/dist/src/ledger.js +5 -3
- package/dist/src/legacy-cleanup.d.ts +3 -0
- package/dist/src/legacy-cleanup.js +190 -0
- package/dist/src/notify.d.ts +3 -0
- package/dist/src/notify.js +13 -0
- package/dist/src/omissions.d.ts +1 -1
- package/dist/src/omissions.js +3 -3
- package/dist/src/path-key.d.ts +3 -0
- package/dist/src/path-key.js +8 -0
- package/dist/src/request-capacity.js +1 -1
- package/dist/src/run.d.ts +1 -3
- package/dist/src/run.js +3 -5
- package/dist/src/source-export.d.ts +1 -1
- package/dist/src/source-export.js +1 -1
- package/dist/src/status.d.ts +0 -6
- package/dist/src/status.js +1 -6
- package/dist/src/tuck/core/content.js +6 -9
- package/dist/src/tuck/core/keyword-query.d.ts +2 -2
- package/dist/src/tuck/core/keyword-query.js +1 -1
- package/dist/src/tuck/core/search-entries.js +5 -5
- package/dist/src/tuck/core/transcript.js +2 -1
- package/dist/src/tuck.js +390 -394
- package/dist/src/windows-private-storage.d.ts +9 -0
- package/dist/src/windows-private-storage.js +90 -0
- package/index.ts +18 -82
- package/package.json +5 -8
- package/src/build-id.ts +1 -1
- package/src/compaction.ts +28 -113
- package/src/diagnostic-replay.ts +2 -2
- package/src/diagnostics.ts +24 -9
- package/src/history-tools.ts +3 -3
- package/src/kept-reads.ts +78 -10
- package/src/ledger.ts +5 -3
- package/src/legacy-cleanup.ts +134 -0
- package/src/notify.ts +10 -0
- package/src/omissions.ts +3 -3
- package/src/path-key.ts +9 -0
- package/src/request-capacity.ts +1 -1
- package/src/run.ts +4 -6
- package/src/source-export.ts +1 -1
- package/src/status.ts +1 -10
- package/src/tuck/core/content.ts +5 -10
- package/src/tuck/core/keyword-query.ts +2 -2
- package/src/tuck/core/search-entries.ts +5 -5
- package/src/tuck/core/transcript.ts +2 -1
- package/src/tuck.ts +329 -335
- package/src/windows-private-storage.ts +94 -0
- package/dist/src/assets.d.ts +0 -58
- package/dist/src/assets.js +0 -80
- package/dist/src/eligibility-cache.d.ts +0 -19
- package/dist/src/eligibility-cache.js +0 -33
- package/dist/src/semantic-recall.d.ts +0 -422
- package/dist/src/semantic-recall.js +0 -1386
- package/dist/src/setup.d.ts +0 -3
- package/dist/src/setup.js +0 -191
- package/scripts/eg2-runtime.py +0 -307
- package/scripts/provision-eg2.py +0 -139
- package/scripts/semantic-worker.py +0 -234
- package/src/assets.ts +0 -92
- package/src/eligibility-cache.ts +0 -43
- package/src/semantic-recall.ts +0 -592
- package/src/setup.ts +0 -163
|
@@ -1,422 +0,0 @@
|
|
|
1
|
-
import type { ExtensionContext, SessionEntry } from '@earendil-works/pi-coding-agent';
|
|
2
|
-
import { type RecallPolicy, type ReadableEntry } from './recall.js';
|
|
3
|
-
/** Windows ownership is an explicit current-runtime dependency, never Task data.
|
|
4
|
-
* --run uses a fresh UUIDv4 and stdinMode:"stream" for persistent RPC. Launch
|
|
5
|
-
* lines (including LF) are <=2 MiB; decoded input/control is <=1 MiB, at most
|
|
6
|
-
* two RPCs in flight. Raw stdout is data; only strict native stderr envelopes
|
|
7
|
-
* and final {op:"settled",activeProcesses:0,exitCode:uint32|null} are authority.
|
|
8
|
-
* Crash/invalid framing invokes this same helper's private --join-job {jobId}.
|
|
9
|
-
* Named absence, leader exit and deadlines are UNKNOWN: custody stays pending.
|
|
10
|
-
*/
|
|
11
|
-
export interface SemanticRecallConfig {
|
|
12
|
-
pythonPath: string;
|
|
13
|
-
runtimeRoot: string;
|
|
14
|
-
indexDirectory: string;
|
|
15
|
-
scratchDirectory?: string;
|
|
16
|
-
queryWaitMs?: number;
|
|
17
|
-
prepareWorkMs?: number;
|
|
18
|
-
maxUnits?: number;
|
|
19
|
-
maxSourceCharacters?: number;
|
|
20
|
-
workerPath?: string;
|
|
21
|
-
nativeOwnerHelperPath?: string;
|
|
22
|
-
}
|
|
23
|
-
export type NativeOwnerInputControl = {
|
|
24
|
-
op: 'input';
|
|
25
|
-
input: string;
|
|
26
|
-
} | {
|
|
27
|
-
op: 'cancel';
|
|
28
|
-
};
|
|
29
|
-
export interface PriorResult {
|
|
30
|
-
entryId: string;
|
|
31
|
-
start: number;
|
|
32
|
-
end: number;
|
|
33
|
-
sourceSha: string;
|
|
34
|
-
}
|
|
35
|
-
interface Source {
|
|
36
|
-
entry: SessionEntry;
|
|
37
|
-
row: ReadableEntry;
|
|
38
|
-
sourceText: string;
|
|
39
|
-
ranges: {
|
|
40
|
-
start: number;
|
|
41
|
-
end: number;
|
|
42
|
-
}[];
|
|
43
|
-
order: number;
|
|
44
|
-
sha: string;
|
|
45
|
-
}
|
|
46
|
-
interface Unit {
|
|
47
|
-
key: string;
|
|
48
|
-
entryId: string;
|
|
49
|
-
start: number;
|
|
50
|
-
end: number;
|
|
51
|
-
inputSha: string;
|
|
52
|
-
encoded: string;
|
|
53
|
-
source: Source;
|
|
54
|
-
}
|
|
55
|
-
/** What one snapshot indexes: the sources in window order, with their unit counts, and the character totals the coverage statement reports.
|
|
56
|
-
* Window order is kind first, then recency: out-of-view conversation (newest first), then out-of-view tool output (newest first), then what is still in view (newest first).
|
|
57
|
-
* `searchUnits` is how many leading units are out-of-view conversation: a search waits for those, never for the out-of-view tool output or the in-view tail behind them. */
|
|
58
|
-
interface Window {
|
|
59
|
-
order: Source[];
|
|
60
|
-
counts: number[];
|
|
61
|
-
searchUnits: number;
|
|
62
|
-
windowCharacters: number;
|
|
63
|
-
eligibleCharacters: number;
|
|
64
|
-
conversationOutOfView: number;
|
|
65
|
-
toolOutOfView: number;
|
|
66
|
-
}
|
|
67
|
-
/** `viewStart` is the branch position of the latest compaction's first kept entry: sources before it are out of view (compacted away). `indexed` holds the keys of units whose vectors are stored. */
|
|
68
|
-
interface Snapshot {
|
|
69
|
-
id: string;
|
|
70
|
-
session: string;
|
|
71
|
-
project: string;
|
|
72
|
-
sources: Source[];
|
|
73
|
-
units: Unit[];
|
|
74
|
-
complete: boolean;
|
|
75
|
-
throughEntryId: string | null;
|
|
76
|
-
viewStart: number;
|
|
77
|
-
indexed: Set<string>;
|
|
78
|
-
window?: Window;
|
|
79
|
-
}
|
|
80
|
-
export interface SemanticEvidenceReference extends PriorResult {
|
|
81
|
-
basis: 'explicit prior or word result' | 'earlier source text in this response';
|
|
82
|
-
}
|
|
83
|
-
export interface SemanticSourceEvidence extends ReadableEntry {
|
|
84
|
-
sourceOrder?: number;
|
|
85
|
-
sourceSha: string;
|
|
86
|
-
textOffset: number;
|
|
87
|
-
totalCharacters: number;
|
|
88
|
-
read: {
|
|
89
|
-
entryId: string;
|
|
90
|
-
offset: number;
|
|
91
|
-
limit: number;
|
|
92
|
-
};
|
|
93
|
-
complete: boolean;
|
|
94
|
-
evidenceReference?: SemanticEvidenceReference;
|
|
95
|
-
notice?: string;
|
|
96
|
-
}
|
|
97
|
-
export interface SemanticGroup {
|
|
98
|
-
sources: SemanticSourceEvidence[];
|
|
99
|
-
notice: string;
|
|
100
|
-
}
|
|
101
|
-
export interface SemanticPage {
|
|
102
|
-
status: string;
|
|
103
|
-
notice: string;
|
|
104
|
-
coverage: ReturnType<SemanticRecallController["requestCoverage"]>;
|
|
105
|
-
groups: SemanticGroup[];
|
|
106
|
-
method?: string;
|
|
107
|
-
}
|
|
108
|
-
/** Automatic recovery after a failed start or a lost worker: bounded exponential backoff, then a steady slow cadence. Integrity refusals use the slow cadence only. */
|
|
109
|
-
export declare const HEAL_DELAYS_MS: readonly number[];
|
|
110
|
-
export declare const HEAL_STEADY_MS = 600000;
|
|
111
|
-
/** A session that has not searched for this long gives its worker back (the index stays on disk). Enabling starts nothing; a search starts the worker again. */
|
|
112
|
-
export declare const IDLE_STOP_MS = 600000;
|
|
113
|
-
/** Background indexing (a session that has not searched, indexing what a cut moved out of view) holds this lock in the index directory, so
|
|
114
|
-
* several Pi sessions on one machine embed one at a time: one encoder's memory at a time instead of one per session. A search never waits for it. */
|
|
115
|
-
export declare const INDEXER_LOCK = "background-indexer.lock";
|
|
116
|
-
/** How long background indexing waits before trying the lock again when another process holds it. */
|
|
117
|
-
export declare const INDEXER_RETRY_MS = 15000;
|
|
118
|
-
/** A worker call's deadline once the worker has answered a call after `ready`: index, embed and tokenize on a loaded model. */
|
|
119
|
-
export declare const CALL_DEADLINE_MS = 60000;
|
|
120
|
-
/** Why semantic recall is off where the embedding server cannot start on Metal (a VM, a Mac without a GPU): it runs on Metal only. */
|
|
121
|
-
export declare const METAL_UNAVAILABLE = "Semantic recall needs Metal; word recall still works";
|
|
122
|
-
/** What an `embed` call adds to its deadline for each text it carries. A batch of 8 passages on a starved CPU took longer than the per-call
|
|
123
|
-
* deadline, and the worker failed when it should have slowed down; a query (one text) still fails fast when the server hangs. The worker
|
|
124
|
-
* scales its native request timeout by the same amount (semantic-worker.py), so that limit is not reached first. */
|
|
125
|
-
export declare const EMBED_TEXT_MS = 30000;
|
|
126
|
-
/** The deadline for a worker's start: Python start, `ready` (which verifies every runtime file) and the first call after it, which loads the
|
|
127
|
-
* model and starts its native server. On a busy machine that takes minutes; held to the per-call deadline, the worker never started and
|
|
128
|
-
* semantic recall went unavailable. It stays above the worker's own native start limit (540 s, in semantic-worker.py). */
|
|
129
|
-
export declare const START_DEADLINE_MS = 600000;
|
|
130
|
-
/** The most units one index window holds. The worker's SQLite store stops at 8,008 rows (`PRAGMA max_page_count=8192` in scripts/semantic-worker.py), so a cap below that keeps a window of short units from filling the store and sticking in `unavailable`. Raise it only together with the store. */
|
|
131
|
-
export declare const MAX_INDEX_UNITS = 8000;
|
|
132
|
-
/** The wait before the next automatic attempt, given how many were already armed since the last success. */
|
|
133
|
-
export declare function healDelayMs(attempts: number, integrity: boolean, delays?: readonly number[], steady?: number): number;
|
|
134
|
-
export type SemanticState = 'disabled' | 'unavailable' | 'preparing' | 'ready' | 'waiting';
|
|
135
|
-
export type SemanticSetup = 'off-settings' | 'off-user' | 'not-installed' | 'off-platform' | 'off-project' | 'starting' | 'failed' | 'ready';
|
|
136
|
-
/** Host policy is re-evaluated at session start; only a start may publish ready. */
|
|
137
|
-
export declare const SEMANTIC_SETUP_TRANSITIONS: Readonly<Record<SemanticSetup, readonly SemanticSetup[]>>;
|
|
138
|
-
interface SetupDetail {
|
|
139
|
-
installed?: boolean;
|
|
140
|
-
reason?: string;
|
|
141
|
-
stage?: 'setup' | 'start';
|
|
142
|
-
notice?: string;
|
|
143
|
-
announced?: boolean;
|
|
144
|
-
}
|
|
145
|
-
/** Setup and operator wording have one owner; runtime indexing state remains separate. */
|
|
146
|
-
export declare function semanticSetupMessage(setup: SemanticSetup, detail?: SetupDetail): string | null;
|
|
147
|
-
export declare function semanticSetupNotice(setup: SemanticSetup, detail?: SetupDetail): {
|
|
148
|
-
message: string;
|
|
149
|
-
level: 'info' | 'warning';
|
|
150
|
-
} | undefined;
|
|
151
|
-
/** Where the current view starts, as a branch position: the latest compaction entry's first kept entry. Earlier entries were compacted away. With no compaction, nothing is out of view. */
|
|
152
|
-
export declare function viewStart(branch: SessionEntry[]): number;
|
|
153
|
-
/** `pendingKeptId`: the first kept entry of a cut pi-tuck has applied to the requests but Pi has not yet saved (a prompt's cut is saved at the end of
|
|
154
|
-
* the first turn). Tools in that turn see the history as the model does: everything before that entry is out of view. */
|
|
155
|
-
export declare function semanticEligibleSources(ctx: Pick<ExtensionContext, 'sessionManager' | 'cwd'>, policy: RecallPolicy, access: () => void, pendingKeptId?: string): Snapshot;
|
|
156
|
-
export declare class SemanticRecallController {
|
|
157
|
-
private readonly timing;
|
|
158
|
-
private readonly ownerId;
|
|
159
|
-
private readonly indexFiles;
|
|
160
|
-
private closing?;
|
|
161
|
-
private joiningSearches;
|
|
162
|
-
private activeSearches;
|
|
163
|
-
private config?;
|
|
164
|
-
private worker?;
|
|
165
|
-
private identity;
|
|
166
|
-
private provider?;
|
|
167
|
-
private generation;
|
|
168
|
-
private cleanupError;
|
|
169
|
-
private dirty;
|
|
170
|
-
private operations;
|
|
171
|
-
private setup;
|
|
172
|
-
private setupDetail;
|
|
173
|
-
private _enabled;
|
|
174
|
-
private _current?;
|
|
175
|
-
private _task?;
|
|
176
|
-
private _timer?;
|
|
177
|
-
private _error;
|
|
178
|
-
private get enabled();
|
|
179
|
-
private set enabled(value);
|
|
180
|
-
private get current();
|
|
181
|
-
private set current(value);
|
|
182
|
-
private get task();
|
|
183
|
-
private set task(value);
|
|
184
|
-
private get timer();
|
|
185
|
-
private set timer(value);
|
|
186
|
-
private get error();
|
|
187
|
-
private set error(value);
|
|
188
|
-
private tokenized;
|
|
189
|
-
private healReason;
|
|
190
|
-
private healIntegrity;
|
|
191
|
-
private healAttempts;
|
|
192
|
-
private healTimer?;
|
|
193
|
-
private healRetryAt;
|
|
194
|
-
private recycle;
|
|
195
|
-
private active;
|
|
196
|
-
private fullIndexing; /** Work a cut started with no search or wait behind it: it takes the machine's indexer lock, and its worker stops once the window is indexed. */
|
|
197
|
-
private backgroundOnly; /** The machine indexer lock while this controller holds it: released once its worker has stopped, not when embedding ends. */
|
|
198
|
-
private releaseLock?;
|
|
199
|
-
private idleTimer?;
|
|
200
|
-
private idling?;
|
|
201
|
-
private quietStop;
|
|
202
|
-
private searched;
|
|
203
|
-
private readonly listeners;
|
|
204
|
-
private announced;
|
|
205
|
-
private announcing;
|
|
206
|
-
constructor(config?: SemanticRecallConfig, timing?: {
|
|
207
|
-
healDelaysMs?: readonly number[];
|
|
208
|
-
healSteadyMs?: number;
|
|
209
|
-
idleStopMs?: number;
|
|
210
|
-
startDeadlineMs?: number;
|
|
211
|
-
callDeadlineMs?: number;
|
|
212
|
-
embedTextMs?: number;
|
|
213
|
-
});
|
|
214
|
-
/** Be told when `status().state` or `lastError` changes: once per change, after the synchronous work that caused it. Returns the unsubscribe. A listener that throws is ignored. */
|
|
215
|
-
onStateChange(listener: (state: SemanticState, reason: string | null) => void): () => void;
|
|
216
|
-
private touch;
|
|
217
|
-
/** A host that could not configure the runtime records why a requested start failed. The controller stays disabled and `lastError` carries the reason until the next `enable`. */
|
|
218
|
-
setSetup(setup: SemanticSetup, detail?: SetupDetail): void;
|
|
219
|
-
/** Compatibility for hosts that already record an external start failure. */
|
|
220
|
-
refuse(reason: string): void;
|
|
221
|
-
setupNotice(): {
|
|
222
|
-
message: string;
|
|
223
|
-
level: "info" | "warning";
|
|
224
|
-
} | undefined;
|
|
225
|
-
configure(config: SemanticRecallConfig): void;
|
|
226
|
-
/** Ordinary external settings remain caller-selected/outside-project. The
|
|
227
|
-
* optional override is a current-process verified dependency, not Task data. */
|
|
228
|
-
configureExternal(project: string, selectedPath?: string, runtime?: {
|
|
229
|
-
nativeOwnerHelperPath?: string;
|
|
230
|
-
}): Promise<void>;
|
|
231
|
-
enable(): void;
|
|
232
|
-
status(): {
|
|
233
|
-
setup: SemanticSetup;
|
|
234
|
-
setupMessage: string | null;
|
|
235
|
-
enabled: boolean;
|
|
236
|
-
configured: boolean;
|
|
237
|
-
cleanupError: string | null;
|
|
238
|
-
state: SemanticState;
|
|
239
|
-
snapshotId: string | null;
|
|
240
|
-
throughEntryId: string | null;
|
|
241
|
-
eligibleSources: number;
|
|
242
|
-
totalUnits: number;
|
|
243
|
-
coveredUnits: number;
|
|
244
|
-
indexingComplete: boolean;
|
|
245
|
-
lastError: string | null;
|
|
246
|
-
window: {
|
|
247
|
-
indexedCharacters: number;
|
|
248
|
-
windowCharacters: number;
|
|
249
|
-
outOfViewCharacters: number;
|
|
250
|
-
eligibleCharacters: number;
|
|
251
|
-
oldestCoveredEntryId: string | null;
|
|
252
|
-
oldestCoveredTime: string | null;
|
|
253
|
-
conversation: {
|
|
254
|
-
indexedCharacters: number;
|
|
255
|
-
outOfViewCharacters: number;
|
|
256
|
-
};
|
|
257
|
-
toolResults: {
|
|
258
|
-
indexedCharacters: number;
|
|
259
|
-
outOfViewCharacters: number;
|
|
260
|
-
oldestCoveredTime: string | null;
|
|
261
|
-
};
|
|
262
|
-
} | null;
|
|
263
|
-
recovery: {
|
|
264
|
-
attempts: number;
|
|
265
|
-
integrity: boolean;
|
|
266
|
-
retryAt: string | null;
|
|
267
|
-
} | null;
|
|
268
|
-
operations: {
|
|
269
|
-
preparationEmbeddings: number;
|
|
270
|
-
queryEmbeddings: number;
|
|
271
|
-
};
|
|
272
|
-
limits: {
|
|
273
|
-
keyword: number;
|
|
274
|
-
broad: number;
|
|
275
|
-
};
|
|
276
|
-
};
|
|
277
|
-
/** The existing model-facing coverage contract: setup metadata belongs to operator status, not the request. */
|
|
278
|
-
requestCoverage(): {
|
|
279
|
-
enabled: boolean;
|
|
280
|
-
configured: boolean;
|
|
281
|
-
cleanupError: string | null;
|
|
282
|
-
state: SemanticState;
|
|
283
|
-
snapshotId: string | null;
|
|
284
|
-
throughEntryId: string | null;
|
|
285
|
-
eligibleSources: number;
|
|
286
|
-
totalUnits: number;
|
|
287
|
-
coveredUnits: number;
|
|
288
|
-
indexingComplete: boolean;
|
|
289
|
-
lastError: string | null;
|
|
290
|
-
window: {
|
|
291
|
-
indexedCharacters: number;
|
|
292
|
-
windowCharacters: number;
|
|
293
|
-
outOfViewCharacters: number;
|
|
294
|
-
eligibleCharacters: number;
|
|
295
|
-
oldestCoveredEntryId: string | null;
|
|
296
|
-
oldestCoveredTime: string | null;
|
|
297
|
-
conversation: {
|
|
298
|
-
indexedCharacters: number;
|
|
299
|
-
outOfViewCharacters: number;
|
|
300
|
-
};
|
|
301
|
-
toolResults: {
|
|
302
|
-
indexedCharacters: number;
|
|
303
|
-
outOfViewCharacters: number;
|
|
304
|
-
oldestCoveredTime: string | null;
|
|
305
|
-
};
|
|
306
|
-
} | null;
|
|
307
|
-
recovery: {
|
|
308
|
-
attempts: number;
|
|
309
|
-
integrity: boolean;
|
|
310
|
-
retryAt: string | null;
|
|
311
|
-
} | null;
|
|
312
|
-
operations: {
|
|
313
|
-
preparationEmbeddings: number;
|
|
314
|
-
queryEmbeddings: number;
|
|
315
|
-
};
|
|
316
|
-
limits: {
|
|
317
|
-
keyword: number;
|
|
318
|
-
broad: number;
|
|
319
|
-
};
|
|
320
|
-
};
|
|
321
|
-
schedule(provider: () => Snapshot): void;
|
|
322
|
-
/** A saved cut has moved entries out of view: start indexing the whole window now, whether or not this session has searched. Awaits nothing; a failure goes to `heal` like any preparation.
|
|
323
|
-
* Every session indexes at its cuts, but only one background indexer runs per machine (the lock in the index folder), so several sessions never run several encoders at once on a 16 GB machine;
|
|
324
|
-
* its worker is given back once the window is indexed. A heal backoff in progress is not bypassed. Callers: Pi's own compactions (session_compact) and every cut pi-tuck saves at a boundary. */
|
|
325
|
-
indexAtCut(provider: () => Snapshot): void;
|
|
326
|
-
private runtime;
|
|
327
|
-
private path;
|
|
328
|
-
private index;
|
|
329
|
-
private prepare;
|
|
330
|
-
private prepareLocked;
|
|
331
|
-
waitForReady(timeoutMs?: number, signal?: AbortSignal, expectedSnapshotId?: string, forSearch?: boolean): Promise<{
|
|
332
|
-
setup: SemanticSetup;
|
|
333
|
-
setupMessage: string | null;
|
|
334
|
-
enabled: boolean;
|
|
335
|
-
configured: boolean;
|
|
336
|
-
cleanupError: string | null;
|
|
337
|
-
state: SemanticState;
|
|
338
|
-
snapshotId: string | null;
|
|
339
|
-
throughEntryId: string | null;
|
|
340
|
-
eligibleSources: number;
|
|
341
|
-
totalUnits: number;
|
|
342
|
-
coveredUnits: number;
|
|
343
|
-
indexingComplete: boolean;
|
|
344
|
-
lastError: string | null;
|
|
345
|
-
window: {
|
|
346
|
-
indexedCharacters: number;
|
|
347
|
-
windowCharacters: number;
|
|
348
|
-
outOfViewCharacters: number;
|
|
349
|
-
eligibleCharacters: number;
|
|
350
|
-
oldestCoveredEntryId: string | null;
|
|
351
|
-
oldestCoveredTime: string | null;
|
|
352
|
-
conversation: {
|
|
353
|
-
indexedCharacters: number;
|
|
354
|
-
outOfViewCharacters: number;
|
|
355
|
-
};
|
|
356
|
-
toolResults: {
|
|
357
|
-
indexedCharacters: number;
|
|
358
|
-
outOfViewCharacters: number;
|
|
359
|
-
oldestCoveredTime: string | null;
|
|
360
|
-
};
|
|
361
|
-
} | null;
|
|
362
|
-
recovery: {
|
|
363
|
-
attempts: number;
|
|
364
|
-
integrity: boolean;
|
|
365
|
-
retryAt: string | null;
|
|
366
|
-
} | null;
|
|
367
|
-
operations: {
|
|
368
|
-
preparationEmbeddings: number;
|
|
369
|
-
queryEmbeddings: number;
|
|
370
|
-
};
|
|
371
|
-
limits: {
|
|
372
|
-
keyword: number;
|
|
373
|
-
broad: number;
|
|
374
|
-
};
|
|
375
|
-
}>;
|
|
376
|
-
/** A plan for this snapshot that is fully indexed or, for a search, has all its out-of-view conversation indexed. The tool output behind it and the in-view tail are not worth waiting for: they keep indexing in the background and the coverage statement says how far they got.
|
|
377
|
-
* With no out-of-view conversation (no cut) nothing waits: the search returns at once. Only a window whose out-of-view part is tool output alone still waits for the whole window. */
|
|
378
|
-
private readyFor;
|
|
379
|
-
/** A search may rank a plan its own snapshot has grown from (every source in the plan still eligible, unchanged), as long as the session has not
|
|
380
|
-
* moved since the search took that snapshot; a move during the search still fails it. Indexing keeps the exact `recheck`. */
|
|
381
|
-
private recheckGrown;
|
|
382
|
-
private recheck;
|
|
383
|
-
private joinPreparation;
|
|
384
|
-
search(query: string, provider: () => Snapshot, signal?: AbortSignal, prior?: PriorResult[], words?: any): Promise<SemanticPage>;
|
|
385
|
-
private searchOwned;
|
|
386
|
-
private assemble;
|
|
387
|
-
private focus;
|
|
388
|
-
private evidence;
|
|
389
|
-
disable(joinSearches?: boolean, userOff?: boolean): Promise<void>;
|
|
390
|
-
private closeResources;
|
|
391
|
-
private stopOwner;
|
|
392
|
-
/** A search, or a wait for readiness, is demand: it lets background work start and keeps it alive for IDLE_STOP_MS after the last one. */
|
|
393
|
-
private demand;
|
|
394
|
-
private cancelIdle;
|
|
395
|
-
private armIdle;
|
|
396
|
-
private freeLock;
|
|
397
|
-
private idleStop;
|
|
398
|
-
/** A search or wait the caller cancelled (Esc) or that a stop overtook ends, and the worker with it, but recall stays enabled: the next search starts a worker again. Only access loss disables (see `searchOwned`). */
|
|
399
|
-
private cancelled;
|
|
400
|
-
/** Stop the worker and any preparation under way, quietly (no error, no recovery). The vectors stay in the on-disk index and the in-memory plan,
|
|
401
|
-
* so the next search starts a worker and finds them. Enabled stays enabled; a recorded start failure stays recorded, but its retry timer ends. Used after the idle limit and after a cancelled search. */
|
|
402
|
-
private stopWorker;
|
|
403
|
-
private cancelHeal;
|
|
404
|
-
/** A worker failure puts the controller into recovery: `unavailable` with the reason, the worker replaced at the next attempt, a retry armed. Other failures only re-arm a retry already under way. */
|
|
405
|
-
private heal;
|
|
406
|
-
private recovered;
|
|
407
|
-
/** One-shot health check for a status tool: start the worker (it verifies every file), embed a fixed string, and report. Enable first; close afterwards. */
|
|
408
|
-
probe(project: string): Promise<{
|
|
409
|
-
dimension: number;
|
|
410
|
-
startMs: number;
|
|
411
|
-
embedMs: number;
|
|
412
|
-
}>;
|
|
413
|
-
private revoked;
|
|
414
|
-
invalidate(): Promise<void>;
|
|
415
|
-
close(): Promise<void>;
|
|
416
|
-
}
|
|
417
|
-
export declare const createSemanticRecall: (config?: SemanticRecallConfig) => SemanticRecallController;
|
|
418
|
-
/** Price complete evidence groups before delivery; ordinary section is never changed.
|
|
419
|
-
* Consolidate each admitted prefix, so capacity omissions never back references.
|
|
420
|
-
*/
|
|
421
|
-
export declare function budgetSemantic(value: any, allowance: number): any;
|
|
422
|
-
export {};
|