diffpact 0.0.0-stage → 0.4.3
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 +142 -0
- package/LICENSE +21 -0
- package/README.md +223 -2
- package/bin/diffpact.mjs +15 -0
- package/dist/adapters/claude-code.d.ts +21 -0
- package/dist/adapters/claude-code.js +191 -0
- package/dist/adapters/codex.d.ts +31 -0
- package/dist/adapters/codex.js +348 -0
- package/dist/adapters/gemini-agy.d.ts +26 -0
- package/dist/adapters/gemini-agy.js +429 -0
- package/dist/adapters/vercel-board.d.ts +30 -0
- package/dist/adapters/vercel-board.js +138 -0
- package/dist/amend.d.ts +46 -0
- package/dist/amend.js +476 -0
- package/dist/boundaries.d.ts +43 -0
- package/dist/boundaries.js +309 -0
- package/dist/canonical-json.d.ts +6 -0
- package/dist/canonical-json.js +63 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +1704 -0
- package/dist/delegate.d.ts +22 -0
- package/dist/delegate.js +140 -0
- package/dist/doctor.d.ts +36 -0
- package/dist/doctor.js +293 -0
- package/dist/git.d.ts +27 -0
- package/dist/git.js +234 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +19 -0
- package/dist/merge-verify.d.ts +31 -0
- package/dist/merge-verify.js +721 -0
- package/dist/report.d.ts +25 -0
- package/dist/report.js +220 -0
- package/dist/review.d.ts +46 -0
- package/dist/review.js +527 -0
- package/dist/runner.d.ts +45 -0
- package/dist/runner.js +213 -0
- package/dist/schema.d.ts +6 -0
- package/dist/schema.js +424 -0
- package/dist/types.d.ts +190 -0
- package/dist/types.js +220 -0
- package/dist/verify.d.ts +45 -0
- package/dist/verify.js +952 -0
- package/dist/worktree.d.ts +82 -0
- package/dist/worktree.js +717 -0
- package/examples/harnesses/README.md +63 -0
- package/examples/quickstart/README.md +17 -0
- package/examples/quickstart/run.mjs +247 -0
- package/package.json +62 -4
- package/schemas/contract.schema.json +148 -0
- package/schemas/receipt.schema.json +49 -0
- package/schemas/review.schema.json +48 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { ExitCode, TaskContractV01, ViolationItem } from './types.ts';
|
|
2
|
+
export interface DirtyTreeDiagnostics {
|
|
3
|
+
clean: boolean;
|
|
4
|
+
dirtyEntries: Array<{
|
|
5
|
+
status: string;
|
|
6
|
+
path: string;
|
|
7
|
+
isSymlink: boolean;
|
|
8
|
+
}>;
|
|
9
|
+
outOfBoundsViolations: ViolationItem[];
|
|
10
|
+
symlinkGitignoreHints: string[];
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Inspects dirty/untracked paths in `repoRoot` against `contract`, producing:
|
|
14
|
+
* - Human-readable dirty file entries (`?? path`, `M path`, etc.)
|
|
15
|
+
* - Out-of-bounds violations for `--resume` pre-flight validation
|
|
16
|
+
* - Actionable hints when an untracked symlink matches a trailing-slash `.gitignore` pattern
|
|
17
|
+
* (e.g. `ln -s .../node_modules node_modules` vs `.gitignore` containing `node_modules/`).
|
|
18
|
+
*/
|
|
19
|
+
export declare function inspectDirtyTreeDiagnostics(repoRoot: string, contract: Pick<TaskContractV01, 'allowed_paths' | 'read_only_paths' | 'forbidden_paths'>): DirtyTreeDiagnostics;
|
|
20
|
+
export interface CreateWorktreeOptions {
|
|
21
|
+
cwd?: string;
|
|
22
|
+
dir: string;
|
|
23
|
+
branch: string;
|
|
24
|
+
fromRef?: string;
|
|
25
|
+
shareNodeModules?: boolean;
|
|
26
|
+
nodeModulesDirs?: string[];
|
|
27
|
+
}
|
|
28
|
+
export interface CreateWorktreeResult {
|
|
29
|
+
worktreePath: string;
|
|
30
|
+
branch: string;
|
|
31
|
+
sharedNodeModules: boolean;
|
|
32
|
+
nodeModulesTarget?: string;
|
|
33
|
+
sharedNodeModulesPaths?: string[];
|
|
34
|
+
workspaceMode?: 'symlink' | 'workspace-overlay';
|
|
35
|
+
workspacePackagesLinked?: string[];
|
|
36
|
+
nodeModulesNote?: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Discovers local npm/pnpm workspace packages inside `worktreeRoot`, returning
|
|
40
|
+
* a map of `<package-name>` -> `<absolute path inside worktreeRoot>`.
|
|
41
|
+
*/
|
|
42
|
+
export declare function discoverLocalWorkspaces(worktreeRoot: string): Map<string, string>;
|
|
43
|
+
/**
|
|
44
|
+
* Creates a linked Git worktree with `.diffpact/` pre-excluded and optional clean
|
|
45
|
+
* `node_modules` sharing:
|
|
46
|
+
* - For standard repos: symlinks `<main>/node_modules` and excludes `node_modules` in `.git/info/exclude`.
|
|
47
|
+
* - For npm/pnpm workspace monorepos: creates a real `<worktree>/node_modules` directory that
|
|
48
|
+
* symlinks third-party dependencies from `<main>/node_modules` while pointing every local
|
|
49
|
+
* workspace package (`@scope/pkg` or unscoped) to the worktree's own directory.
|
|
50
|
+
* - For subdirectory apps (e.g. `site/package.json` + `site/node_modules`): auto-discovers
|
|
51
|
+
* depth 1-2 package subdirectories or honors explicit `nodeModulesDirs` (`--node-modules-dir`).
|
|
52
|
+
*/
|
|
53
|
+
export declare function createManagedWorktree(options: CreateWorktreeOptions): CreateWorktreeResult;
|
|
54
|
+
export interface RemoveWorktreeOptions {
|
|
55
|
+
cwd?: string;
|
|
56
|
+
dir: string;
|
|
57
|
+
deleteBranch?: boolean;
|
|
58
|
+
forceDeleteBranch?: boolean;
|
|
59
|
+
force?: boolean;
|
|
60
|
+
requireVerified?: boolean;
|
|
61
|
+
contractPath?: string;
|
|
62
|
+
archiveDir?: string;
|
|
63
|
+
noArchive?: boolean;
|
|
64
|
+
}
|
|
65
|
+
export interface RemoveWorktreeResult {
|
|
66
|
+
ok: boolean;
|
|
67
|
+
exitCode: ExitCode;
|
|
68
|
+
worktreePath: string;
|
|
69
|
+
branch?: string;
|
|
70
|
+
branchDeleted: boolean;
|
|
71
|
+
branchDeleteMode?: '-d' | '-D';
|
|
72
|
+
archivedTo?: string;
|
|
73
|
+
error?: string;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Removes a linked Git worktree cleanly (companion to `createManagedWorktree`),
|
|
77
|
+
* archiving `.diffpact/` evidence (contract, receipt, reviews, amendments, ledger, and reports)
|
|
78
|
+
* into `<main>/.diffpact/archive/` by default before removal, optionally verifying
|
|
79
|
+
* `diffpact status --require-review` passes first and deleting the worktree's feature branch
|
|
80
|
+
* (never deleting `main` or `master`).
|
|
81
|
+
*/
|
|
82
|
+
export declare function removeManagedWorktree(options: RemoveWorktreeOptions): RemoveWorktreeResult;
|