@leitwerk-dev/coding 0.1.0 → 0.1.2
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/auto-work-branch.d.ts +11 -10
- package/dist/auto-work-branch.js +90 -90
- package/dist/auto-work-branch.js.map +1 -1
- package/dist/finalization-git.d.ts +11 -9
- package/dist/finalization-git.js +11 -532
- package/dist/finalization-git.js.map +1 -1
- package/dist/index.d.ts +61 -7
- package/dist/index.js +785 -6
- package/dist/index.js.map +1 -1
- package/dist/repository-change-launch.d.ts +17 -15
- package/dist/repository-change-launch.js +17 -182
- package/dist/repository-change-launch.js.map +1 -1
- package/dist/repository-change-state.d.ts +10 -8
- package/dist/repository-change-state.js +12 -50
- package/dist/repository-change-state.js.map +1 -1
- package/dist/turns/generate-commit-message.d.ts +6 -4
- package/dist/turns/generate-commit-message.js +9 -38
- package/dist/turns/generate-commit-message.js.map +1 -1
- package/dist/turns/generate-plan.d.ts +5 -3
- package/dist/turns/generate-plan.js +7 -19
- package/dist/turns/generate-plan.js.map +1 -1
- package/dist/turns/implement.d.ts +5 -3
- package/dist/turns/implement.js +7 -17
- package/dist/turns/implement.js.map +1 -1
- package/dist/turns/resolve-merge-conflict.d.ts +5 -3
- package/dist/turns/resolve-merge-conflict.js +7 -21
- package/dist/turns/resolve-merge-conflict.js.map +1 -1
- package/dist/turns/review-implementation.d.ts +7 -4
- package/dist/turns/review-implementation.js +9 -27
- package/dist/turns/review-implementation.js.map +1 -1
- package/dist/turns/review-plan.d.ts +7 -4
- package/dist/turns/review-plan.js +9 -21
- package/dist/turns/review-plan.js.map +1 -1
- package/dist/turns/simplify-implementation.d.ts +5 -3
- package/dist/turns/simplify-implementation.js +7 -7
- package/dist/turns/simplify-implementation.js.map +1 -1
- package/package.json +3 -3
- package/dist/actions.d.ts +0 -18
- package/dist/actions.d.ts.map +0 -1
- package/dist/actions.js +0 -45
- package/dist/actions.js.map +0 -1
- package/dist/auto-work-branch.d.ts.map +0 -1
- package/dist/finalization-git.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/repository-change-launch.d.ts.map +0 -1
- package/dist/repository-change-process.d.ts +0 -38
- package/dist/repository-change-process.d.ts.map +0 -1
- package/dist/repository-change-process.js +0 -751
- package/dist/repository-change-process.js.map +0 -1
- package/dist/repository-change-state.d.ts.map +0 -1
- package/dist/turns/generate-commit-message.d.ts.map +0 -1
- package/dist/turns/generate-plan.d.ts.map +0 -1
- package/dist/turns/implement.d.ts.map +0 -1
- package/dist/turns/resolve-merge-conflict.d.ts.map +0 -1
- package/dist/turns/review-implementation.d.ts.map +0 -1
- package/dist/turns/review-plan.d.ts.map +0 -1
- package/dist/turns/simplify-implementation.d.ts.map +0 -1
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
interface ResolveBaseBranchShaInput {
|
|
2
2
|
repoLocator: string;
|
|
3
3
|
baseBranch: string;
|
|
4
4
|
timeoutMs?: number;
|
|
5
5
|
}
|
|
6
|
-
|
|
6
|
+
declare function slugifyBranchSourceForBranch(sourceText: string): string;
|
|
7
7
|
/** @deprecated Use slugifyBranchSourceForBranch. */
|
|
8
|
-
|
|
8
|
+
declare const slugifyPromptForBranch: typeof slugifyBranchSourceForBranch;
|
|
9
9
|
/** @deprecated Use slugifyBranchSourceForBranch. */
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
declare const slugifyTitleForBranch: typeof slugifyBranchSourceForBranch;
|
|
11
|
+
declare function generateAutoWorkBranchRandomHex(): string;
|
|
12
|
+
declare function buildAutoWorkBranch(sourceText: string, baseBranchSha: string, randomHex?: string): string;
|
|
13
13
|
/** Builds the same safe branch shape when authenticated remote SHA lookup must wait for a worker. */
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
declare function gitShaLikeDigestFromSeed(seed: string): string;
|
|
15
|
+
declare function buildAutoWorkBranchFromSeed(sourceText: string, seed: string, randomHex?: string): string;
|
|
16
|
+
declare function resolveBaseBranchSha(input: ResolveBaseBranchShaInput): Promise<string>;
|
|
17
|
+
|
|
18
|
+
export { type ResolveBaseBranchShaInput, buildAutoWorkBranch, buildAutoWorkBranchFromSeed, generateAutoWorkBranchRandomHex, gitShaLikeDigestFromSeed, resolveBaseBranchSha, slugifyBranchSourceForBranch, slugifyPromptForBranch, slugifyTitleForBranch };
|
package/dist/auto-work-branch.js
CHANGED
|
@@ -1,112 +1,112 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import "./chunk-PX6F3LHL.js";
|
|
2
|
+
|
|
3
|
+
// src/auto-work-branch.ts
|
|
4
|
+
import { execFile } from "child_process";
|
|
5
|
+
import { createHash, randomBytes } from "crypto";
|
|
6
|
+
import { promisify } from "util";
|
|
4
7
|
import { trimToNull } from "@leitwerk-dev/domain";
|
|
5
8
|
import { sanitizeWorkerSubprocessEnv } from "@leitwerk-dev/process-sdk";
|
|
6
9
|
import { resolveGitBinary } from "@leitwerk-dev/process-sdk/git-binary";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
var DEFAULT_BASE_SHA_SUFFIX_LENGTH = 12;
|
|
11
|
+
var DEFAULT_MAX_BRANCH_SLUG_LENGTH = 48;
|
|
12
|
+
var DEFAULT_PROMPT_WORD_COUNT = 5;
|
|
13
|
+
var AUTO_BRANCH_RANDOM_HEX_LENGTH = 3;
|
|
14
|
+
var DEFAULT_GIT_TIMEOUT_MS = 15e3;
|
|
15
|
+
var execFileAsync = promisify(execFile);
|
|
13
16
|
function truncateSlugAtSeparator(value, maxLength) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
if (value.length <= maxLength) {
|
|
18
|
+
return value;
|
|
19
|
+
}
|
|
20
|
+
return value.slice(0, maxLength).replace(/-+$/g, "");
|
|
18
21
|
}
|
|
19
22
|
function normalizedBranchWords(value) {
|
|
20
|
-
|
|
21
|
-
.normalize("NFKD")
|
|
22
|
-
.replace(/[\u0300-\u036f]/g, "")
|
|
23
|
-
.toLowerCase()
|
|
24
|
-
.replace(/[’']/g, "")
|
|
25
|
-
.match(/[a-z0-9]+/g) ?? []);
|
|
23
|
+
return value.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[’']/g, "").match(/[a-z0-9]+/g) ?? [];
|
|
26
24
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
function slugifyBranchSourceForBranch(sourceText) {
|
|
26
|
+
const words = normalizedBranchWords(sourceText).slice(0, DEFAULT_PROMPT_WORD_COUNT);
|
|
27
|
+
const normalized = words.join("-");
|
|
28
|
+
const slug = truncateSlugAtSeparator(normalized, DEFAULT_MAX_BRANCH_SLUG_LENGTH);
|
|
29
|
+
return slug || "change";
|
|
32
30
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
/** @deprecated Use slugifyBranchSourceForBranch. */
|
|
36
|
-
export const slugifyTitleForBranch = slugifyBranchSourceForBranch;
|
|
31
|
+
var slugifyPromptForBranch = slugifyBranchSourceForBranch;
|
|
32
|
+
var slugifyTitleForBranch = slugifyBranchSourceForBranch;
|
|
37
33
|
function normalizeSha(value) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
34
|
+
const sha = value.trim().toLowerCase();
|
|
35
|
+
if (!/^[0-9a-f]{7,64}$/.test(sha)) {
|
|
36
|
+
throw new Error(`Expected a git object sha, got '${value}'`);
|
|
37
|
+
}
|
|
38
|
+
return sha;
|
|
43
39
|
}
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
function generateAutoWorkBranchRandomHex() {
|
|
41
|
+
return randomBytes(2).toString("hex").slice(0, AUTO_BRANCH_RANDOM_HEX_LENGTH);
|
|
46
42
|
}
|
|
47
43
|
function normalizeRandomHex(value) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
44
|
+
const normalized = value.trim().toLowerCase();
|
|
45
|
+
if (!new RegExp(`^[0-9a-f]{${AUTO_BRANCH_RANDOM_HEX_LENGTH}}$`).test(normalized)) {
|
|
46
|
+
throw new Error(
|
|
47
|
+
`Expected ${AUTO_BRANCH_RANDOM_HEX_LENGTH} random hex characters, got '${value}'`
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
return normalized;
|
|
53
51
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
52
|
+
function buildAutoWorkBranch(sourceText, baseBranchSha, randomHex = generateAutoWorkBranchRandomHex()) {
|
|
53
|
+
const slug = slugifyBranchSourceForBranch(sourceText);
|
|
54
|
+
const suffix = normalizeRandomHex(randomHex);
|
|
55
|
+
const sha = normalizeSha(baseBranchSha);
|
|
56
|
+
return `${slug}-${suffix}-${sha.slice(0, DEFAULT_BASE_SHA_SUFFIX_LENGTH)}`;
|
|
59
57
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
return createHash("sha256").update(seed).digest("hex");
|
|
58
|
+
function gitShaLikeDigestFromSeed(seed) {
|
|
59
|
+
return createHash("sha256").update(seed).digest("hex");
|
|
63
60
|
}
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
function buildAutoWorkBranchFromSeed(sourceText, seed, randomHex = generateAutoWorkBranchRandomHex()) {
|
|
62
|
+
return buildAutoWorkBranch(sourceText, gitShaLikeDigestFromSeed(seed), randomHex);
|
|
66
63
|
}
|
|
67
64
|
function baseBranchRef(baseBranch) {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
65
|
+
const trimmed = trimToNull(baseBranch);
|
|
66
|
+
if (!trimmed) {
|
|
67
|
+
throw new Error("baseBranch is required to resolve an automatic work branch");
|
|
68
|
+
}
|
|
69
|
+
return trimmed.startsWith("refs/heads/") ? trimmed : `refs/heads/${trimmed}`;
|
|
73
70
|
}
|
|
74
71
|
function outputToString(value) {
|
|
75
|
-
|
|
72
|
+
return typeof value === "string" ? value : Buffer.isBuffer(value) ? value.toString("utf8") : "";
|
|
76
73
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
.map((line) => line.split(/\s+/))
|
|
105
|
-
.find((parts) => parts[1] === ref);
|
|
106
|
-
const sha = match?.[0];
|
|
107
|
-
if (!sha) {
|
|
108
|
-
throw new Error(`Repository '${repoLocator}' does not expose base branch '${input.baseBranch}'`);
|
|
109
|
-
}
|
|
110
|
-
return normalizeSha(sha);
|
|
74
|
+
async function resolveBaseBranchSha(input) {
|
|
75
|
+
const repoLocator = trimToNull(input.repoLocator);
|
|
76
|
+
if (!repoLocator) {
|
|
77
|
+
throw new Error("repoLocator is required to resolve an automatic work branch");
|
|
78
|
+
}
|
|
79
|
+
const ref = baseBranchRef(input.baseBranch);
|
|
80
|
+
let stdout = "";
|
|
81
|
+
try {
|
|
82
|
+
const result = await execFileAsync(resolveGitBinary(), ["ls-remote", repoLocator, ref], {
|
|
83
|
+
encoding: "utf8",
|
|
84
|
+
env: sanitizeWorkerSubprocessEnv(process.env, { GIT_TERMINAL_PROMPT: "0" }),
|
|
85
|
+
timeout: input.timeoutMs ?? DEFAULT_GIT_TIMEOUT_MS
|
|
86
|
+
});
|
|
87
|
+
stdout = outputToString(result.stdout);
|
|
88
|
+
} catch (error) {
|
|
89
|
+
const errorOutput = error;
|
|
90
|
+
const message = trimToNull(outputToString(errorOutput.stderr)) ?? trimToNull(outputToString(errorOutput.stdout)) ?? errorOutput.message ?? "unknown git error";
|
|
91
|
+
throw new Error(`Failed to resolve '${ref}' from '${repoLocator}': ${message}`);
|
|
92
|
+
}
|
|
93
|
+
const match = stdout.split(/\r?\n/).map((line) => line.trim()).filter(Boolean).map((line) => line.split(/\s+/)).find((parts) => parts[1] === ref);
|
|
94
|
+
const sha = match?.[0];
|
|
95
|
+
if (!sha) {
|
|
96
|
+
throw new Error(
|
|
97
|
+
`Repository '${repoLocator}' does not expose base branch '${input.baseBranch}'`
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
return normalizeSha(sha);
|
|
111
101
|
}
|
|
102
|
+
export {
|
|
103
|
+
buildAutoWorkBranch,
|
|
104
|
+
buildAutoWorkBranchFromSeed,
|
|
105
|
+
generateAutoWorkBranchRandomHex,
|
|
106
|
+
gitShaLikeDigestFromSeed,
|
|
107
|
+
resolveBaseBranchSha,
|
|
108
|
+
slugifyBranchSourceForBranch,
|
|
109
|
+
slugifyPromptForBranch,
|
|
110
|
+
slugifyTitleForBranch
|
|
111
|
+
};
|
|
112
112
|
//# sourceMappingURL=auto-work-branch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/auto-work-branch.ts"],"sourcesContent":["import { execFile } from \"node:child_process\";\nimport { createHash, randomBytes } from \"node:crypto\";\nimport { promisify } from \"node:util\";\nimport { trimToNull } from \"@leitwerk-dev/domain\";\nimport { sanitizeWorkerSubprocessEnv } from \"@leitwerk-dev/process-sdk\";\nimport { resolveGitBinary } from \"@leitwerk-dev/process-sdk/git-binary\";\n\nconst DEFAULT_BASE_SHA_SUFFIX_LENGTH = 12;\nconst DEFAULT_MAX_BRANCH_SLUG_LENGTH = 48;\nconst DEFAULT_PROMPT_WORD_COUNT = 5;\nconst AUTO_BRANCH_RANDOM_HEX_LENGTH = 3;\nconst DEFAULT_GIT_TIMEOUT_MS = 15_000;\nconst execFileAsync = promisify(execFile);\n\nexport interface ResolveBaseBranchShaInput {\n\trepoLocator: string;\n\tbaseBranch: string;\n\ttimeoutMs?: number;\n}\n\nfunction truncateSlugAtSeparator(value: string, maxLength: number): string {\n\tif (value.length <= maxLength) {\n\t\treturn value;\n\t}\n\treturn value.slice(0, maxLength).replace(/-+$/g, \"\");\n}\n\nfunction normalizedBranchWords(value: string): string[] {\n\treturn (\n\t\tvalue\n\t\t\t.normalize(\"NFKD\")\n\t\t\t.replace(/[\\u0300-\\u036f]/g, \"\")\n\t\t\t.toLowerCase()\n\t\t\t.replace(/[’']/g, \"\")\n\t\t\t.match(/[a-z0-9]+/g) ?? []\n\t);\n}\n\nexport function slugifyBranchSourceForBranch(sourceText: string): string {\n\tconst words = normalizedBranchWords(sourceText).slice(0, DEFAULT_PROMPT_WORD_COUNT);\n\tconst normalized = words.join(\"-\");\n\tconst slug = truncateSlugAtSeparator(normalized, DEFAULT_MAX_BRANCH_SLUG_LENGTH);\n\treturn slug || \"change\";\n}\n\n/** @deprecated Use slugifyBranchSourceForBranch. */\nexport const slugifyPromptForBranch = slugifyBranchSourceForBranch;\n/** @deprecated Use slugifyBranchSourceForBranch. */\nexport const slugifyTitleForBranch = slugifyBranchSourceForBranch;\n\nfunction normalizeSha(value: string): string {\n\tconst sha = value.trim().toLowerCase();\n\tif (!/^[0-9a-f]{7,64}$/.test(sha)) {\n\t\tthrow new Error(`Expected a git object sha, got '${value}'`);\n\t}\n\treturn sha;\n}\n\nexport function generateAutoWorkBranchRandomHex(): string {\n\treturn randomBytes(2).toString(\"hex\").slice(0, AUTO_BRANCH_RANDOM_HEX_LENGTH);\n}\n\nfunction normalizeRandomHex(value: string): string {\n\tconst normalized = value.trim().toLowerCase();\n\tif (!new RegExp(`^[0-9a-f]{${AUTO_BRANCH_RANDOM_HEX_LENGTH}}$`).test(normalized)) {\n\t\tthrow new Error(\n\t\t\t`Expected ${AUTO_BRANCH_RANDOM_HEX_LENGTH} random hex characters, got '${value}'`,\n\t\t);\n\t}\n\treturn normalized;\n}\n\nexport function buildAutoWorkBranch(\n\tsourceText: string,\n\tbaseBranchSha: string,\n\trandomHex = generateAutoWorkBranchRandomHex(),\n): string {\n\tconst slug = slugifyBranchSourceForBranch(sourceText);\n\tconst suffix = normalizeRandomHex(randomHex);\n\tconst sha = normalizeSha(baseBranchSha);\n\treturn `${slug}-${suffix}-${sha.slice(0, DEFAULT_BASE_SHA_SUFFIX_LENGTH)}`;\n}\n\n/** Builds the same safe branch shape when authenticated remote SHA lookup must wait for a worker. */\nexport function gitShaLikeDigestFromSeed(seed: string): string {\n\treturn createHash(\"sha256\").update(seed).digest(\"hex\");\n}\n\nexport function buildAutoWorkBranchFromSeed(\n\tsourceText: string,\n\tseed: string,\n\trandomHex = generateAutoWorkBranchRandomHex(),\n): string {\n\treturn buildAutoWorkBranch(sourceText, gitShaLikeDigestFromSeed(seed), randomHex);\n}\n\nfunction baseBranchRef(baseBranch: string): string {\n\tconst trimmed = trimToNull(baseBranch);\n\tif (!trimmed) {\n\t\tthrow new Error(\"baseBranch is required to resolve an automatic work branch\");\n\t}\n\treturn trimmed.startsWith(\"refs/heads/\") ? trimmed : `refs/heads/${trimmed}`;\n}\n\nfunction outputToString(value: unknown): string {\n\treturn typeof value === \"string\" ? value : Buffer.isBuffer(value) ? value.toString(\"utf8\") : \"\";\n}\n\nexport async function resolveBaseBranchSha(input: ResolveBaseBranchShaInput): Promise<string> {\n\tconst repoLocator = trimToNull(input.repoLocator);\n\tif (!repoLocator) {\n\t\tthrow new Error(\"repoLocator is required to resolve an automatic work branch\");\n\t}\n\tconst ref = baseBranchRef(input.baseBranch);\n\tlet stdout = \"\";\n\ttry {\n\t\tconst result = await execFileAsync(resolveGitBinary(), [\"ls-remote\", repoLocator, ref], {\n\t\t\tencoding: \"utf8\",\n\t\t\tenv: sanitizeWorkerSubprocessEnv(process.env, { GIT_TERMINAL_PROMPT: \"0\" }),\n\t\t\ttimeout: input.timeoutMs ?? DEFAULT_GIT_TIMEOUT_MS,\n\t\t});\n\t\tstdout = outputToString(result.stdout);\n\t} catch (error) {\n\t\tconst errorOutput = error as { message?: string; stdout?: unknown; stderr?: unknown };\n\t\tconst message =\n\t\t\ttrimToNull(outputToString(errorOutput.stderr)) ??\n\t\t\ttrimToNull(outputToString(errorOutput.stdout)) ??\n\t\t\terrorOutput.message ??\n\t\t\t\"unknown git error\";\n\t\tthrow new Error(`Failed to resolve '${ref}' from '${repoLocator}': ${message}`);\n\t}\n\tconst match = stdout\n\t\t.split(/\\r?\\n/)\n\t\t.map((line) => line.trim())\n\t\t.filter(Boolean)\n\t\t.map((line) => line.split(/\\s+/))\n\t\t.find((parts) => parts[1] === ref);\n\tconst sha = match?.[0];\n\tif (!sha) {\n\t\tthrow new Error(\n\t\t\t`Repository '${repoLocator}' does not expose base branch '${input.baseBranch}'`,\n\t\t);\n\t}\n\treturn normalizeSha(sha);\n}\n"],"mappings":";;;AAAA,SAAS,gBAAgB;AACzB,SAAS,YAAY,mBAAmB;AACxC,SAAS,iBAAiB;AAC1B,SAAS,kBAAkB;AAC3B,SAAS,mCAAmC;AAC5C,SAAS,wBAAwB;AAEjC,IAAM,iCAAiC;AACvC,IAAM,iCAAiC;AACvC,IAAM,4BAA4B;AAClC,IAAM,gCAAgC;AACtC,IAAM,yBAAyB;AAC/B,IAAM,gBAAgB,UAAU,QAAQ;AAQxC,SAAS,wBAAwB,OAAe,WAA2B;AAC1E,MAAI,MAAM,UAAU,WAAW;AAC9B,WAAO;AAAA,EACR;AACA,SAAO,MAAM,MAAM,GAAG,SAAS,EAAE,QAAQ,QAAQ,EAAE;AACpD;AAEA,SAAS,sBAAsB,OAAyB;AACvD,SACC,MACE,UAAU,MAAM,EAChB,QAAQ,oBAAoB,EAAE,EAC9B,YAAY,EACZ,QAAQ,SAAS,EAAE,EACnB,MAAM,YAAY,KAAK,CAAC;AAE5B;AAEO,SAAS,6BAA6B,YAA4B;AACxE,Q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GAAG;AACxB;","names":[]}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { WorkerErrorClass } from '@leitwerk-dev/domain';
|
|
2
|
+
import { StructuralProcessState, FlowAutomaticRunContext } from '@leitwerk-dev/process-sdk';
|
|
3
|
+
|
|
4
|
+
type DeterministicFinalizationMergeMode = "noop" | "fast_forward" | "merge_commit";
|
|
5
|
+
type DeterministicFinalizationResult = {
|
|
5
6
|
outcome: "merge_conflict";
|
|
6
7
|
params: {
|
|
7
8
|
headSha: string;
|
|
@@ -18,17 +19,18 @@ export type DeterministicFinalizationResult = {
|
|
|
18
19
|
};
|
|
19
20
|
markdown: string;
|
|
20
21
|
};
|
|
21
|
-
|
|
22
|
+
declare class DeterministicGitError extends Error {
|
|
22
23
|
readonly errorClass: WorkerErrorClass;
|
|
23
24
|
constructor(message: string);
|
|
24
25
|
}
|
|
25
|
-
|
|
26
|
+
interface RepositoryChangeFinalizationContextState extends StructuralProcessState {
|
|
26
27
|
finalization: {
|
|
27
28
|
expectedPostConflictHeadSha: string | null;
|
|
28
29
|
usedConflictResolution: boolean;
|
|
29
30
|
generatedCommitMessage: string | null;
|
|
30
31
|
};
|
|
31
32
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
declare function runDeterministicFinalization<TParams, TState extends RepositoryChangeFinalizationContextState>(ctx: FlowAutomaticRunContext<TParams, TState>): DeterministicFinalizationResult;
|
|
34
|
+
declare function readMergeMessage(repoPath: string): string | null;
|
|
35
|
+
|
|
36
|
+
export { type DeterministicFinalizationMergeMode, type DeterministicFinalizationResult, DeterministicGitError, type RepositoryChangeFinalizationContextState, readMergeMessage, runDeterministicFinalization };
|