@vaubaan/harness 1.3.0 → 1.4.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/init.d.ts CHANGED
@@ -1,7 +1,21 @@
1
- import { E as Engine, c as RenderOutput, d as RenderedFile } from './render-B9_kNtQc.js';
1
+ import { E as Engine, c as RenderOutput, d as RenderedFile } from './render-Cu2XrkkY.js';
2
2
  import './parser/index.js';
3
3
  import 'zod';
4
4
 
5
+ interface RenderPlanArgs {
6
+ targetDir: string;
7
+ engines?: ReadonlyArray<string>;
8
+ overridesDir?: string;
9
+ packageDir?: string;
10
+ mcpServers?: ReadonlyArray<string>;
11
+ withStopHook?: boolean;
12
+ }
13
+ declare function planInit(args: RenderPlanArgs): {
14
+ engines: Engine[];
15
+ output: RenderOutput;
16
+ stopHookInstalled: boolean;
17
+ };
18
+
5
19
  interface InitArgs {
6
20
  targetDir: string;
7
21
  engines?: ReadonlyArray<string>;
@@ -23,20 +37,29 @@ interface InitArgs {
23
37
  * `HARNESS_LINT_DISABLE=1`).
24
38
  */
25
39
  withStopHook?: boolean;
40
+ /** Generated files to leave to the project instead of rendering them. */
41
+ preserveFiles?: ReadonlyArray<string>;
42
+ /** Exact new backup directory, outside the project. Defaults to private user state. */
43
+ backupDir?: string;
26
44
  }
27
45
  interface InitResult {
46
+ /** Generated files the harness owns after this run, plus shared configurations it edited. */
28
47
  filesWritten: string[];
29
48
  /** Files a previous `init` rendered that this one no longer does (layout change, engine dropped). */
30
49
  staleFilesRemoved: string[];
31
50
  warnings: string[];
32
51
  stopHookInstalled: boolean;
33
- }
34
- declare function planInit(args: InitArgs): {
35
52
  engines: Engine[];
36
- output: RenderOutput;
37
- stopHookInstalled: boolean;
38
- };
53
+ /** Set when existing project files were changed; holds their previous contents. */
54
+ backupDir?: string;
55
+ }
39
56
  declare function writeFilesToTarget(files: ReadonlyArray<RenderedFile>, targetDir: string): string[];
57
+ /**
58
+ * Installs or re-renders the harness. Shares the planner of `update`: files
59
+ * the harness does not own are never overwritten or deleted, shared
60
+ * configurations are merged entry by entry, and changes are applied in one
61
+ * transaction (see docs/decisions/safe-init.md).
62
+ */
40
63
  declare function initCommand(args: InitArgs): InitResult;
41
64
 
42
65
  export { type InitArgs, type InitResult, initCommand, planInit, writeFilesToTarget };