@mrclrchtr/supi-code-intelligence 6.3.0 → 7.0.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/README.md +164 -82
- package/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-code-runtime/src/types.ts +8 -1
- package/node_modules/@mrclrchtr/supi-core/README.md +8 -0
- package/node_modules/@mrclrchtr/supi-core/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-core/src/footer-registry.ts +10 -3
- package/node_modules/@mrclrchtr/supi-core/src/index.ts +2 -0
- package/node_modules/@mrclrchtr/supi-core/src/llm.ts +141 -16
- package/node_modules/@mrclrchtr/supi-lsp/README.md +35 -13
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/types.ts +8 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/README.md +8 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/footer-registry.ts +10 -3
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/index.ts +2 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/src/llm.ts +141 -16
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/ignore/index.js +3 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/ignore/legacy.js +3 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/ignore/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-lsp/package.json +3 -3
- package/node_modules/@mrclrchtr/supi-lsp/src/api.ts +16 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-cache.ts +43 -35
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-capabilities.ts +83 -17
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-collection.ts +108 -92
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-evidence.ts +44 -82
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-host.ts +3 -4
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-publication.ts +9 -68
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-pull.ts +45 -58
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-refresh.ts +230 -331
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-request.ts +201 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-timing.ts +129 -70
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-typescript.ts +395 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-waiters.ts +8 -12
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostics.ts +685 -183
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-document-state.ts +2 -2
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-document-sync.ts +60 -60
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-request-enrollment.ts +75 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-semantic-input-barrier.ts +443 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-semantic-input-errors.ts +30 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-semantic-input-file.ts +15 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client.ts +290 -37
- package/node_modules/@mrclrchtr/supi-lsp/src/client/transport.ts +72 -16
- package/node_modules/@mrclrchtr/supi-lsp/src/config/capabilities.ts +1 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/config/tsconfig-scope.ts +30 -4
- package/node_modules/@mrclrchtr/supi-lsp/src/diagnostics/evidence.ts +1 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/diagnostics/workspace-sentinels.ts +4 -32
- package/node_modules/@mrclrchtr/supi-lsp/src/diagnostics/workspace-sources.ts +108 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-diagnostics.ts +10 -4
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-process-crash-report.ts +50 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-workspace-recovery.ts +11 -7
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager.ts +770 -56
- package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-diagnostic-surface.ts +3 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-diagnostics.ts +37 -4
- package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-registry.ts +48 -12
- package/node_modules/@mrclrchtr/supi-lsp/src/session/workspace-lsp-runtime.ts +50 -4
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/types.ts +8 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/README.md +8 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/footer-registry.ts +10 -3
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/index.ts +2 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/src/llm.ts +141 -16
- package/node_modules/@mrclrchtr/supi-tree-sitter/package.json +3 -3
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/provider/tree-sitter-provider.ts +2 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/callee-display-name.ts +165 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/callees.ts +67 -9
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/types.ts +2 -0
- package/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +19 -18
- package/node_modules/yaml/browser/dist/nodes/Alias.js +25 -23
- package/node_modules/yaml/dist/compose/resolve-flow-scalar.js +19 -18
- package/node_modules/yaml/dist/nodes/Alias.js +25 -23
- package/node_modules/yaml/package.json +1 -1
- package/package.json +5 -5
- package/src/analysis/health/diagnostics.ts +1 -2
- package/src/analysis/health/file-scope.ts +4 -1
- package/src/analysis/health/server-status.ts +1 -1
- package/src/analysis/relations/callees.ts +17 -8
- package/src/analysis/relations/implementations.ts +1 -2
- package/src/analysis/relations/references.ts +8 -4
- package/src/analysis/relations/types.ts +6 -30
- package/src/analysis/target/anchored.ts +9 -1
- package/src/analysis/target/symbol.ts +29 -11
- package/src/analysis/target/types.ts +14 -6
- package/src/api.ts +2 -0
- package/src/session/graph/collect.ts +18 -3
- package/src/session/health-refresh.ts +27 -11
- package/src/session/health-types.ts +21 -4
- package/src/session/health-workflow.ts +28 -22
- package/src/session/orientation-types.ts +5 -6
- package/src/session/orientation-workflow.ts +10 -2
- package/src/session/session.ts +12 -5
- package/src/session/target-workflow.ts +9 -6
- package/src/substrate/lsp/maintenance.ts +53 -47
- package/src/substrate/lsp/source-tracking.ts +252 -0
- package/src/tool/code_find/guidance.ts +3 -3
- package/src/tool/code_find/spec.ts +5 -4
- package/src/tool/code_find/tui.ts +7 -1
- package/src/tool/code_graph/details.ts +32 -0
- package/src/tool/code_graph/display.ts +54 -0
- package/src/tool/code_graph/format.ts +60 -0
- package/src/tool/code_graph/guidance.ts +2 -2
- package/src/tool/code_graph/markdown.ts +76 -198
- package/src/tool/code_graph/read-next.ts +65 -0
- package/src/tool/code_graph/result.ts +118 -83
- package/src/tool/code_graph/tui.ts +216 -54
- package/src/tool/code_health/guidance.ts +3 -5
- package/src/tool/code_health/markdown.ts +90 -57
- package/src/tool/code_health/refresh-outcome.ts +51 -0
- package/src/tool/code_health/refresh-status.ts +130 -43
- package/src/tool/code_health/scope.ts +78 -0
- package/src/tool/code_health/spec.ts +1 -1
- package/src/tool/code_health/tui.ts +29 -38
- package/src/tool/code_inspect/guidance.ts +5 -3
- package/src/tool/code_inspect/tui.ts +7 -1
- package/src/tool/code_orientation/guidance.ts +3 -4
- package/src/tool/code_orientation/result.ts +31 -8
- package/src/tool/code_orientation/tui.ts +26 -5
- package/src/tool/code_refactor_apply/guidance.ts +1 -1
- package/src/tool/code_refactor_apply/tui.ts +7 -3
- package/src/tool/code_refactor_plan/guidance.ts +3 -5
- package/src/tool/code_refactor_plan/tui.ts +7 -1
- package/src/tool/code_resolve/guidance.ts +3 -5
- package/src/tool/code_resolve/result.ts +13 -10
- package/src/tool/code_resolve/tui.ts +18 -1
- package/src/tool/guidance.ts +11 -9
- package/src/tool/infra/truncate.ts +39 -13
- package/src/tool/result/candidate-row.ts +27 -0
- package/src/tool/result/errors.ts +21 -6
- package/src/tool/result/types.ts +7 -3
- package/src/tool/schemas.ts +5 -0
- package/src/types/execution.ts +2 -0
- package/src/types/index.ts +2 -0
- package/src/ui/tui/candidate-legacy-body.ts +69 -0
- package/src/ui/tui/candidate-selection.ts +366 -0
- package/src/ui/tui/common.ts +26 -31
- package/src/ui/tui/execution-error.ts +92 -0
|
@@ -56,8 +56,8 @@ export function hasCurrentDiagnosticEvidence(
|
|
|
56
56
|
/**
|
|
57
57
|
* Test whether cached diagnostics confirm the current document state.
|
|
58
58
|
*
|
|
59
|
-
* A current
|
|
60
|
-
*
|
|
59
|
+
* A current push matches the document state but cannot support a clean-result
|
|
60
|
+
* or cache-reuse claim until request evidence replaces it.
|
|
61
61
|
*/
|
|
62
62
|
export function hasConfirmedDiagnosticEvidence(
|
|
63
63
|
document: OpenDocumentState | undefined,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { readFileSync } from "node:fs";
|
|
2
|
-
import type {
|
|
2
|
+
import type { VersionedTextDocumentIdentifier } from "../config/types.ts";
|
|
3
3
|
import type { DiagnosticSynchronization } from "./client-diagnostic-evidence.ts";
|
|
4
4
|
import type { DiagnosticWaitRegistry } from "./client-diagnostic-waiters.ts";
|
|
5
5
|
import { fingerprintDocumentContent, type OpenDocumentState } from "./client-document-state.ts";
|
|
@@ -47,13 +47,20 @@ function contentChanges(
|
|
|
47
47
|
return [{ text: content }];
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
/**
|
|
51
|
-
|
|
50
|
+
/** Retain one document synchronization while advancing its evidence revision. */
|
|
51
|
+
function retainDocumentSynchronization(
|
|
52
|
+
options: Pick<SynchronizeDocumentOptions, "uri" | "document" | "evidenceRevision" | "waiters">,
|
|
53
|
+
): void {
|
|
52
54
|
options.waiters.releaseFile(options.uri);
|
|
53
55
|
options.waiters.cancelSettle();
|
|
56
|
+
options.document.evidenceRevision = options.evidenceRevision;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** Advance and publish one explicit document synchronization. */
|
|
60
|
+
export function synchronizeDocument(options: SynchronizeDocumentOptions): void {
|
|
61
|
+
retainDocumentSynchronization(options);
|
|
54
62
|
options.document.version = options.version;
|
|
55
63
|
options.document.synchronizationId = options.synchronizationId;
|
|
56
|
-
options.document.evidenceRevision = options.evidenceRevision;
|
|
57
64
|
const changes = contentChanges(
|
|
58
65
|
options.document.content,
|
|
59
66
|
options.content,
|
|
@@ -83,44 +90,6 @@ export function clearTrackedDocumentState(
|
|
|
83
90
|
waiters.cancelSettle();
|
|
84
91
|
}
|
|
85
92
|
|
|
86
|
-
/** Close and reopen one open document while preserving cache and version history. */
|
|
87
|
-
export function reopenDocument(options: {
|
|
88
|
-
uri: string;
|
|
89
|
-
content: string;
|
|
90
|
-
document: OpenDocumentState;
|
|
91
|
-
languageId: string;
|
|
92
|
-
nextVersion(): number;
|
|
93
|
-
nextSynchronizationId(): number;
|
|
94
|
-
evidenceRevision: number;
|
|
95
|
-
waiters: DiagnosticWaitRegistry;
|
|
96
|
-
sendNotification: NotificationSender;
|
|
97
|
-
markUnversionedSyncMoment?(): void;
|
|
98
|
-
}): void {
|
|
99
|
-
// Mirror didClose release semantics: pending waiters for this URI observe
|
|
100
|
-
// the protocol close, and the settle generation is cancelled so concurrent
|
|
101
|
-
// settles re-arm against the reopened state.
|
|
102
|
-
options.waiters.releaseFile(options.uri);
|
|
103
|
-
options.waiters.cancelSettle();
|
|
104
|
-
options.markUnversionedSyncMoment?.();
|
|
105
|
-
options.sendNotification("textDocument/didClose", {
|
|
106
|
-
textDocument: { uri: options.uri },
|
|
107
|
-
});
|
|
108
|
-
const version = options.nextVersion();
|
|
109
|
-
options.document.version = version;
|
|
110
|
-
options.document.synchronizationId = options.nextSynchronizationId();
|
|
111
|
-
options.document.evidenceRevision = options.evidenceRevision;
|
|
112
|
-
options.document.content = options.content;
|
|
113
|
-
options.document.contentFingerprint = fingerprintDocumentContent(options.content);
|
|
114
|
-
options.sendNotification("textDocument/didOpen", {
|
|
115
|
-
textDocument: {
|
|
116
|
-
uri: options.uri,
|
|
117
|
-
languageId: options.languageId,
|
|
118
|
-
version,
|
|
119
|
-
text: options.content,
|
|
120
|
-
} satisfies TextDocumentItem,
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
|
|
124
93
|
/** Synchronize one open document, or open it when the route is not tracked yet. */
|
|
125
94
|
export function synchronizeTrackedDocument(options: {
|
|
126
95
|
uri: string;
|
|
@@ -161,6 +130,10 @@ interface ResynchronizeDocumentsOptions {
|
|
|
161
130
|
nextVersion(uri: string): number;
|
|
162
131
|
nextSynchronizationId(): number;
|
|
163
132
|
evidenceRevision: number;
|
|
133
|
+
/** Invalidate route evidence before the first changed document is applied. */
|
|
134
|
+
noteInputContentChange(): number;
|
|
135
|
+
/** Record the verified disk content in the shared semantic barrier. */
|
|
136
|
+
observeDiskContent(uri: string, content: string): void;
|
|
164
137
|
incrementalSync: boolean;
|
|
165
138
|
sendNotification: NotificationSender;
|
|
166
139
|
uriToFile(uri: string): string;
|
|
@@ -188,32 +161,49 @@ export interface ResynchronizeDocumentsResult {
|
|
|
188
161
|
export function resynchronizeOpenDocuments(
|
|
189
162
|
options: ResynchronizeDocumentsOptions,
|
|
190
163
|
): ResynchronizeDocumentsResult {
|
|
191
|
-
const
|
|
164
|
+
const synchronizedUris = new Set<string>();
|
|
192
165
|
const resynchronizedUris = new Set<string>();
|
|
193
166
|
const removedFiles: string[] = [];
|
|
194
167
|
const failedFiles: string[] = [];
|
|
168
|
+
let synchronizationRevision = options.evidenceRevision;
|
|
169
|
+
let inputChangeNoted = false;
|
|
195
170
|
for (const [uri, document] of options.openDocuments) {
|
|
196
171
|
const filePath = options.uriToFile(uri);
|
|
197
172
|
try {
|
|
198
173
|
options.markUnversionedSyncMoment(uri);
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
174
|
+
const content = options.preloadedContent?.get(uri) ?? readFileSync(filePath, "utf-8");
|
|
175
|
+
const contentChanged = fingerprintDocumentContent(content) !== document.contentFingerprint;
|
|
176
|
+
if (contentChanged) {
|
|
177
|
+
if (!inputChangeNoted) {
|
|
178
|
+
synchronizationRevision = options.noteInputContentChange();
|
|
179
|
+
inputChangeNoted = true;
|
|
180
|
+
}
|
|
181
|
+
synchronizeDocument({
|
|
182
|
+
uri,
|
|
183
|
+
content,
|
|
184
|
+
document,
|
|
185
|
+
version: options.nextVersion(uri),
|
|
186
|
+
synchronizationId: options.nextSynchronizationId(),
|
|
187
|
+
evidenceRevision: synchronizationRevision,
|
|
188
|
+
incrementalSync: options.incrementalSync,
|
|
189
|
+
waiters: options.waiters,
|
|
190
|
+
sendNotification: options.sendNotification,
|
|
191
|
+
});
|
|
192
|
+
} else {
|
|
193
|
+
// A failed read can select an unchanged open document for recovery.
|
|
194
|
+
// Keep its protocol identity stable, but make the current evidence
|
|
195
|
+
// generation eligible for a fresh request or push observation.
|
|
196
|
+
retainDocumentSynchronization({
|
|
197
|
+
uri,
|
|
198
|
+
document,
|
|
199
|
+
evidenceRevision: synchronizationRevision,
|
|
200
|
+
waiters: options.waiters,
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
options.observeDiskContent(uri, content);
|
|
210
204
|
options.clearFailedFile(uri);
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
uri,
|
|
214
|
-
synchronizationId: document.synchronizationId,
|
|
215
|
-
evidenceRevision: document.evidenceRevision,
|
|
216
|
-
});
|
|
205
|
+
synchronizedUris.add(uri);
|
|
206
|
+
if (contentChanged) resynchronizedUris.add(uri);
|
|
217
207
|
} catch {
|
|
218
208
|
if (getDiagnosticFileState(filePath) === "removed") {
|
|
219
209
|
options.clearFile(uri);
|
|
@@ -227,5 +217,15 @@ export function resynchronizeOpenDocuments(
|
|
|
227
217
|
// Keep the document open when a transient read fails.
|
|
228
218
|
}
|
|
229
219
|
}
|
|
220
|
+
const synchronizations: DiagnosticSynchronization[] = [];
|
|
221
|
+
for (const uri of synchronizedUris) {
|
|
222
|
+
const document = options.openDocuments.get(uri);
|
|
223
|
+
if (!document) continue;
|
|
224
|
+
synchronizations.push({
|
|
225
|
+
uri,
|
|
226
|
+
synchronizationId: document.synchronizationId,
|
|
227
|
+
evidenceRevision: document.evidenceRevision,
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
230
|
return { synchronizations, resynchronizedUris, removedFiles, failedFiles };
|
|
231
231
|
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isSemanticInputEnrollmentError,
|
|
3
|
+
type SemanticInputSynchronizationError,
|
|
4
|
+
} from "./client-semantic-input-errors.ts";
|
|
5
|
+
|
|
6
|
+
const MAX_REQUEST_ENROLLMENT_RETRIES = 1;
|
|
7
|
+
|
|
8
|
+
/** A request-level enrollment retry decision owned by one request attempt. */
|
|
9
|
+
export type RequestEnrollmentRetryDecision =
|
|
10
|
+
| { readonly kind: "retry" }
|
|
11
|
+
| { readonly kind: "stop"; readonly error: unknown };
|
|
12
|
+
|
|
13
|
+
/** Look up the current input change after a failed request revision. */
|
|
14
|
+
export type SemanticInputChangeLookup = (
|
|
15
|
+
revision: number,
|
|
16
|
+
) => SemanticInputSynchronizationError | undefined;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Keep one semantic or diagnostic request's enrollment retry policy cohesive.
|
|
20
|
+
*
|
|
21
|
+
* Synchronization passes have their own rejoin budget. This guard only owns
|
|
22
|
+
* the request-level budget and the first failed revision used to classify
|
|
23
|
+
* later changes.
|
|
24
|
+
*/
|
|
25
|
+
export class SemanticInputRequestRetryGuard {
|
|
26
|
+
#requestRetries = 0;
|
|
27
|
+
#firstFailedRevision: number | undefined;
|
|
28
|
+
|
|
29
|
+
constructor(private readonly currentChangeSince: SemanticInputChangeLookup) {}
|
|
30
|
+
|
|
31
|
+
/** Number of request-level retries permitted for this request so far. */
|
|
32
|
+
get retryCount(): number {
|
|
33
|
+
return this.#requestRetries;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Whether this request already used its one request-level retry. */
|
|
37
|
+
get hasRetried(): boolean {
|
|
38
|
+
return this.#requestRetries > 0;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** Throw the current non-enrollment cause when it blocks a retry. */
|
|
42
|
+
assertCurrent(): void {
|
|
43
|
+
const blockingChange = this.#getBlockingChange();
|
|
44
|
+
if (blockingChange) throw blockingChange;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** Classify one failed attempt and decide whether it may be retried. */
|
|
48
|
+
decide(error: unknown, inputRevision: number | undefined): RequestEnrollmentRetryDecision {
|
|
49
|
+
if (!isSemanticInputEnrollmentError(error)) {
|
|
50
|
+
return { kind: "stop", error };
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (this.#firstFailedRevision !== undefined) {
|
|
54
|
+
const blockingChange = this.#getBlockingChange();
|
|
55
|
+
if (blockingChange) return { kind: "stop", error: blockingChange };
|
|
56
|
+
}
|
|
57
|
+
if (inputRevision === undefined) return { kind: "stop", error };
|
|
58
|
+
|
|
59
|
+
this.#firstFailedRevision ??= inputRevision;
|
|
60
|
+
const blockingChange = this.#getBlockingChange();
|
|
61
|
+
if (blockingChange) return { kind: "stop", error: blockingChange };
|
|
62
|
+
if (this.#requestRetries >= MAX_REQUEST_ENROLLMENT_RETRIES) {
|
|
63
|
+
return { kind: "stop", error };
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
this.#requestRetries++;
|
|
67
|
+
return { kind: "retry" };
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
#getBlockingChange(): SemanticInputSynchronizationError | undefined {
|
|
71
|
+
if (this.#firstFailedRevision === undefined) return undefined;
|
|
72
|
+
const currentChange = this.currentChangeSince(this.#firstFailedRevision);
|
|
73
|
+
return currentChange?.changeKind === "enrollment" ? undefined : currentChange;
|
|
74
|
+
}
|
|
75
|
+
}
|