@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/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
- * exposes hooks for LLM-driven repair (planned, not yet shipped).
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 downstream LLM-mend integrations
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 a Layer 2–4 LLM-mend agent
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
- * The mend agents themselves (`@shipispec/tsmend`, planned) consume these
41
- * types but are not shipped from this package — `tsfix` stays Layer 0–1
42
- * deterministic.
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";