@mrclrchtr/supi-code-intelligence 6.4.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 +6 -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/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 +608 -45
- 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 +31 -11
- package/node_modules/@mrclrchtr/supi-lsp/src/session/workspace-lsp-runtime.ts +19 -3
- 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 +12 -1
- package/src/session/health-types.ts +18 -6
- package/src/session/health-workflow.ts +21 -19
- package/src/session/orientation-types.ts +5 -6
- package/src/session/orientation-workflow.ts +10 -2
- package/src/session/target-workflow.ts +9 -6
- package/src/substrate/lsp/source-tracking.ts +11 -6
- package/src/tool/code_find/guidance.ts +2 -2
- 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 +1 -1
- 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 +2 -4
- package/src/tool/code_health/markdown.ts +75 -58
- package/src/tool/code_health/refresh-outcome.ts +41 -1
- package/src/tool/code_health/refresh-status.ts +114 -48
- 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 +25 -38
- package/src/tool/code_inspect/tui.ts +7 -1
- 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 +1 -1
- package/src/tool/code_refactor_plan/tui.ts +7 -1
- package/src/tool/code_resolve/guidance.ts +2 -4
- package/src/tool/code_resolve/result.ts +13 -10
- package/src/tool/code_resolve/tui.ts +18 -1
- 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
|
@@ -10,17 +10,23 @@ import type { Diagnostic } from "../config/types.ts";
|
|
|
10
10
|
import { effectiveDiagnosticSeverity } from "../diagnostics/diagnostic-severity.ts";
|
|
11
11
|
import { relativeFilePathFromUri } from "../diagnostics/diagnostic-summary.ts";
|
|
12
12
|
|
|
13
|
+
/** Options for one manager-owned diagnostic request. */
|
|
14
|
+
interface SyncClientFileOptions {
|
|
15
|
+
readonly control?: CodeRequestControl;
|
|
16
|
+
readonly contentIsAuthoritative?: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
13
19
|
/** Sync one file and return diagnostics up to the supplied severity threshold. */
|
|
14
20
|
export async function syncClientFileAndGetDiagnostics(
|
|
15
21
|
client: Pick<LspClient, "syncAndWaitForDiagnostics">,
|
|
16
22
|
filePath: string,
|
|
17
23
|
maxSeverity: number,
|
|
18
|
-
|
|
24
|
+
options: SyncClientFileOptions = {},
|
|
19
25
|
): Promise<CodeQueryResult<Diagnostic[]>> {
|
|
20
26
|
const content = readFileSync(filePath, "utf-8");
|
|
21
|
-
const result = control
|
|
22
|
-
|
|
23
|
-
|
|
27
|
+
const result = await client.syncAndWaitForDiagnostics(filePath, content, options.control, {
|
|
28
|
+
contentIsAuthoritative: options.contentIsAuthoritative ?? true,
|
|
29
|
+
});
|
|
24
30
|
return mapCodeQueryResult(result, (diagnostics) =>
|
|
25
31
|
filterDiagnosticsBySeverity(diagnostics, maxSeverity),
|
|
26
32
|
);
|
|
@@ -5,6 +5,8 @@ import {
|
|
|
5
5
|
type ProcessCrashRecoveryNextAction,
|
|
6
6
|
type ProcessCrashRecoveryOutcome,
|
|
7
7
|
type ProcessCrashRecoveryReport,
|
|
8
|
+
type StartupRetryEntry,
|
|
9
|
+
type StartupRetryReport,
|
|
8
10
|
} from "../session/runtime-diagnostics.ts";
|
|
9
11
|
|
|
10
12
|
/** One route result before its root is projected to a workspace-relative path. */
|
|
@@ -77,7 +79,7 @@ function nextAction(outcome: ProcessCrashRecoveryOutcome): ProcessCrashRecoveryN
|
|
|
77
79
|
return "use-exact-file";
|
|
78
80
|
case "recovery-failed":
|
|
79
81
|
case "recovery-exhausted":
|
|
80
|
-
return "
|
|
82
|
+
return "refresh";
|
|
81
83
|
case "recovered":
|
|
82
84
|
return null;
|
|
83
85
|
}
|
|
@@ -104,3 +106,50 @@ function countRoutes(
|
|
|
104
106
|
): number {
|
|
105
107
|
return routes.filter((route) => route.outcome === outcome).length;
|
|
106
108
|
}
|
|
109
|
+
|
|
110
|
+
/** One initial-start route result before its root is projected. */
|
|
111
|
+
export interface StartupRetryRouteResult {
|
|
112
|
+
readonly name: string;
|
|
113
|
+
readonly root: string;
|
|
114
|
+
readonly outcome: StartupRetryEntry["outcome"];
|
|
115
|
+
readonly failureMessage?: string;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/** Build a bounded, deterministic report for initial-start retries. */
|
|
119
|
+
export function buildStartupRetryReport(
|
|
120
|
+
routes: readonly StartupRetryRouteResult[],
|
|
121
|
+
cwd: string,
|
|
122
|
+
): StartupRetryReport {
|
|
123
|
+
const entries = routes
|
|
124
|
+
.map(
|
|
125
|
+
(route): StartupRetryEntry => ({
|
|
126
|
+
name: route.name,
|
|
127
|
+
root: relativeRoot(cwd, route.root),
|
|
128
|
+
outcome: route.outcome,
|
|
129
|
+
...(route.outcome === "retry-failed"
|
|
130
|
+
? {
|
|
131
|
+
nextAction: "refresh" as const,
|
|
132
|
+
...(route.failureMessage
|
|
133
|
+
? { failureMessage: boundProcessCrashFailureMessage(route.failureMessage) }
|
|
134
|
+
: {}),
|
|
135
|
+
}
|
|
136
|
+
: {}),
|
|
137
|
+
}),
|
|
138
|
+
)
|
|
139
|
+
.sort(compareStartupEntries);
|
|
140
|
+
const visibleEntries = entries.slice(0, MAX_PROCESS_CRASH_RECOVERY_ENTRIES);
|
|
141
|
+
return {
|
|
142
|
+
recoveredRoutes: routes.filter((route) => route.outcome === "recovered").length,
|
|
143
|
+
failedRoutes: routes.filter((route) => route.outcome === "retry-failed").length,
|
|
144
|
+
entries: visibleEntries,
|
|
145
|
+
omittedEntries: Math.max(0, entries.length - visibleEntries.length),
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
function compareStartupEntries(first: StartupRetryEntry, second: StartupRetryEntry): number {
|
|
150
|
+
return (
|
|
151
|
+
Number(first.outcome !== "retry-failed") - Number(second.outcome !== "retry-failed") ||
|
|
152
|
+
compareStrings(first.root, second.root) ||
|
|
153
|
+
compareStrings(first.name, second.name)
|
|
154
|
+
);
|
|
155
|
+
}
|
|
@@ -18,7 +18,9 @@ import {
|
|
|
18
18
|
} from "../diagnostics/stale-diagnostics.ts";
|
|
19
19
|
import {
|
|
20
20
|
emptyProcessCrashRecoveryReport,
|
|
21
|
+
emptyStartupRetryReport,
|
|
21
22
|
type ProcessCrashRecoveryReport,
|
|
23
|
+
type StartupRetryReport,
|
|
22
24
|
type WorkspaceDiagnosticReport,
|
|
23
25
|
} from "../session/runtime-diagnostics.ts";
|
|
24
26
|
|
|
@@ -29,6 +31,8 @@ export interface WorkspaceRecoveryResult {
|
|
|
29
31
|
restartedClients: number;
|
|
30
32
|
/** No process-crash demand is handled by this generic recovery pass. */
|
|
31
33
|
processCrashRecovery: ProcessCrashRecoveryReport;
|
|
34
|
+
/** No initial-start retry is handled by this generic recovery pass. */
|
|
35
|
+
startupRetry: StartupRetryReport;
|
|
32
36
|
/** Server names of the active clients targeted by this pass, for telemetry identity. */
|
|
33
37
|
attemptedServers: string[];
|
|
34
38
|
/** Server names of the clients restarted during this pass, for telemetry identity. */
|
|
@@ -49,8 +53,8 @@ export interface WorkspaceRecoveryResult {
|
|
|
49
53
|
/** One client route's diagnostic evidence capability for recovery targeting. */
|
|
50
54
|
export interface WorkspaceDiagnosticRoute {
|
|
51
55
|
key: string;
|
|
52
|
-
/** False for push-only clients, which
|
|
53
|
-
|
|
56
|
+
/** False for push-only clients, which have no request adapter. */
|
|
57
|
+
hasDiagnosticRequestAdapter: boolean;
|
|
54
58
|
/** Files tracked by the route whose evidence is unconfirmed. */
|
|
55
59
|
unconfirmedFiles: string[];
|
|
56
60
|
/** Protocol-stall signal observed on the route, or null when healthy. */
|
|
@@ -165,6 +169,7 @@ export async function recoverWorkspaceDiagnostics(
|
|
|
165
169
|
attemptedClients,
|
|
166
170
|
restartedClients,
|
|
167
171
|
processCrashRecovery: emptyProcessCrashRecoveryReport(),
|
|
172
|
+
startupRetry: emptyStartupRetryReport(),
|
|
168
173
|
attemptedServers,
|
|
169
174
|
restartedServers: restartServerNames,
|
|
170
175
|
...(restartReason ? { restartReason } : {}),
|
|
@@ -232,15 +237,14 @@ async function collectInitialEvidence(
|
|
|
232
237
|
/**
|
|
233
238
|
* Collect restart targets: push-only routes with a protocol-stall signal.
|
|
234
239
|
*
|
|
235
|
-
* Unconfirmed evidence alone never restarts a client
|
|
236
|
-
*
|
|
237
|
-
*
|
|
238
|
-
* protocol failures, and stay limited to push-only routes.
|
|
240
|
+
* Unconfirmed evidence alone never restarts a client. Restarts require a
|
|
241
|
+
* readiness stall or repeated protocol failures, and stay limited to routes
|
|
242
|
+
* without a diagnostic request adapter.
|
|
239
243
|
*/
|
|
240
244
|
function collectRecoveryRestartTargets(host: WorkspaceRecoveryHost): RecoveryRestartTarget[] {
|
|
241
245
|
const targets: RecoveryRestartTarget[] = [];
|
|
242
246
|
for (const route of host.getClientDiagnosticRoutes()) {
|
|
243
|
-
if (route.
|
|
247
|
+
if (route.hasDiagnosticRequestAdapter) continue;
|
|
244
248
|
if (!route.stallSignal) continue;
|
|
245
249
|
if (route.unconfirmedFiles.length === 0) continue;
|
|
246
250
|
targets.push({
|