@shipispec/tsfix 0.3.0 → 0.5.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 +106 -1
- package/README.md +88 -26
- package/dist/cli.js +869 -24
- package/dist/index.d.ts +26 -6
- package/dist/index.js +747 -8
- package/dist/types/applyEditBlock.d.ts +68 -0
- package/dist/types/index.d.ts +26 -6
- package/dist/types/mendAgent.d.ts +53 -0
- package/dist/types/runMendLoop.d.ts +79 -0
- package/dist/types/stubAndContinue.d.ts +68 -0
- package/dist/types/typeContext.d.ts +48 -0
- package/package.json +12 -2
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* A reusable TypeScript error-recovery agent. Validates LLM-generated (or any)
|
|
5
5
|
* TypeScript code via in-process tsc, auto-fixes deterministic error classes
|
|
6
6
|
* (TS2304/2305/2552/2724) via TypeScript's built-in code-fix engine, and
|
|
7
|
-
*
|
|
7
|
+
* runs Layer 2 LLM mend (single-file repair via Vercel AI SDK + Anthropic)
|
|
8
|
+
* on what survives.
|
|
8
9
|
*
|
|
9
10
|
* ## Quick start (library)
|
|
10
11
|
*
|
|
@@ -31,15 +32,24 @@
|
|
|
31
32
|
* - `runInProcessTsc` — just type-check, returns structured diagnostics
|
|
32
33
|
* - `runLSPFixerPass` — just the auto-fix pass, edits files in place
|
|
33
34
|
*
|
|
34
|
-
* ## Public types for
|
|
35
|
+
* ## Public types for the LLM-mend layer
|
|
35
36
|
*
|
|
36
37
|
* - `Diagnostic` — single tsc error (re-exported from `runInProcessTsc`)
|
|
37
|
-
* - `MendContext` — input contract for
|
|
38
|
+
* - `MendContext` — input contract for the Layer 2–4 LLM-mend agent
|
|
38
39
|
* - `LayerEvent` — per-layer event shape for streaming telemetry
|
|
39
40
|
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
41
|
+
* ## Layer 2 mend API (v0.4.0+)
|
|
42
|
+
*
|
|
43
|
+
* - `getTypeContext` — TS Language Service type-declaration injection
|
|
44
|
+
* - `mendSingleFile` — single-LLM-call repair via Vercel AI SDK
|
|
45
|
+
* - `runMendLoop` — bounded retry with no-progress / regression detection
|
|
46
|
+
* - `parseEditBlocks` / `applyEditBlocks` — Aider-style SEARCH/REPLACE applier
|
|
47
|
+
*
|
|
48
|
+
* ## Layer 4 escape hatch (v0.5.0+)
|
|
49
|
+
*
|
|
50
|
+
* - `stubAndContinue` — insert `// @ts-expect-error - tsfix: ...` above
|
|
51
|
+
* unresolved error sites so the workspace compiles. Opt-in: set
|
|
52
|
+
* `stubOnFailure: true` on `runMendLoop`, or call directly.
|
|
43
53
|
*/
|
|
44
54
|
export { runInProcessTsc, isInProcessTscEnabled, resetInProcessTscCache } from "./validatorInProcess.js";
|
|
45
55
|
export type { InProcessTscOptions, InProcessTscResult } from "./validatorInProcess.js";
|
|
@@ -174,3 +184,13 @@ export interface LayerEvent {
|
|
|
174
184
|
/** `Date.now()` at emission. */
|
|
175
185
|
ts: number;
|
|
176
186
|
}
|
|
187
|
+
export { getTypeContext, resetTypeContextCache } from "./typeContext.js";
|
|
188
|
+
export type { TypeContextOptions, TypeContext } from "./typeContext.js";
|
|
189
|
+
export { parseEditBlocks, applySingleBlock, applyEditBlocks } from "./applyEditBlock.js";
|
|
190
|
+
export type { EditBlock, ApplyEditBlocksOptions, ApplyResult, SingleBlockResult, } from "./applyEditBlock.js";
|
|
191
|
+
export { mendSingleFile } from "./mendAgent.js";
|
|
192
|
+
export type { MendSingleFileOptions, MendSingleFileResult, LLMCall } from "./mendAgent.js";
|
|
193
|
+
export { runMendLoop } from "./runMendLoop.js";
|
|
194
|
+
export type { RunMendLoopOptions, RunMendLoopResult, MendLoopIteration, StopReason, } from "./runMendLoop.js";
|
|
195
|
+
export { stubAndContinue } from "./stubAndContinue.js";
|
|
196
|
+
export type { StubAndContinueOptions, StubAndContinueResult, AppliedStub, SkippedStub, } from "./stubAndContinue.js";
|