@gitkraken/compose-tools 0.1.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 +27 -0
- package/LICENSE +19 -0
- package/README.md +543 -0
- package/dist/ai/session.d.ts +12 -0
- package/dist/ai/session.js +1 -0
- package/dist/ai/types.d.ts +31 -0
- package/dist/ai/types.js +1 -0
- package/dist/cancellation.d.ts +20 -0
- package/dist/cancellation.js +1 -0
- package/dist/errors/ai.d.ts +10 -0
- package/dist/errors/ai.js +1 -0
- package/dist/errors/git.d.ts +12 -0
- package/dist/errors/git.js +1 -0
- package/dist/errors/task.d.ts +6 -0
- package/dist/errors/task.js +1 -0
- package/dist/errors/workflow.d.ts +13 -0
- package/dist/errors/workflow.js +1 -0
- package/dist/git/apply-branches.d.ts +28 -0
- package/dist/git/apply-branches.js +1 -0
- package/dist/git/apply-target.d.ts +39 -0
- package/dist/git/apply-target.js +1 -0
- package/dist/git/commit-chain.d.ts +87 -0
- package/dist/git/commit-chain.js +6 -0
- package/dist/git/diff-collector.d.ts +80 -0
- package/dist/git/diff-collector.js +8 -0
- package/dist/git/index.d.ts +7 -0
- package/dist/git/index.js +1 -0
- package/dist/git/port-dispatch.d.ts +34 -0
- package/dist/git/port-dispatch.js +3 -0
- package/dist/git/require-exec.d.ts +17 -0
- package/dist/git/require-exec.js +1 -0
- package/dist/git/safety.d.ts +22 -0
- package/dist/git/safety.js +1 -0
- package/dist/git/types.d.ts +43 -0
- package/dist/git/types.js +1 -0
- package/dist/git/utils/conventions.d.ts +33 -0
- package/dist/git/utils/conventions.js +10 -0
- package/dist/git/utils/crypto.d.ts +4 -0
- package/dist/git/utils/crypto.js +1 -0
- package/dist/git/utils/hunk-parser.d.ts +6 -0
- package/dist/git/utils/hunk-parser.js +7 -0
- package/dist/git/utils/patch-builder.d.ts +6 -0
- package/dist/git/utils/patch-builder.js +2 -0
- package/dist/git/utils/temp-index.d.ts +6 -0
- package/dist/git/utils/temp-index.js +1 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.js +1 -0
- package/dist/ports/git.d.ts +199 -0
- package/dist/ports/git.js +1 -0
- package/dist/tasks/ai-loop.d.ts +99 -0
- package/dist/tasks/ai-loop.js +2 -0
- package/dist/tasks/analyze/analyze.d.ts +6 -0
- package/dist/tasks/analyze/analyze.js +1 -0
- package/dist/tasks/analyze/prompt.d.ts +16 -0
- package/dist/tasks/analyze/prompt.js +34 -0
- package/dist/tasks/analyze/schema.d.ts +38 -0
- package/dist/tasks/analyze/schema.js +1 -0
- package/dist/tasks/analyze/types.d.ts +69 -0
- package/dist/tasks/analyze/types.js +1 -0
- package/dist/tasks/analyze/validator.d.ts +7 -0
- package/dist/tasks/analyze/validator.js +13 -0
- package/dist/tasks/compose-group/compose-group.d.ts +15 -0
- package/dist/tasks/compose-group/compose-group.js +1 -0
- package/dist/tasks/compose-group/prompt.d.ts +26 -0
- package/dist/tasks/compose-group/prompt.js +162 -0
- package/dist/tasks/compose-group/types.d.ts +62 -0
- package/dist/tasks/compose-group/types.js +1 -0
- package/dist/tasks/group/group.d.ts +6 -0
- package/dist/tasks/group/group.js +1 -0
- package/dist/tasks/group/prompt.d.ts +15 -0
- package/dist/tasks/group/prompt.js +158 -0
- package/dist/tasks/group/schema.d.ts +19 -0
- package/dist/tasks/group/schema.js +1 -0
- package/dist/tasks/group/types.d.ts +61 -0
- package/dist/tasks/group/types.js +1 -0
- package/dist/tasks/group/validator.d.ts +7 -0
- package/dist/tasks/group/validator.js +53 -0
- package/dist/tasks/index.d.ts +15 -0
- package/dist/tasks/index.js +1 -0
- package/dist/tasks/order/order.d.ts +6 -0
- package/dist/tasks/order/order.js +1 -0
- package/dist/tasks/order/prompt.d.ts +13 -0
- package/dist/tasks/order/prompt.js +45 -0
- package/dist/tasks/order/schema.d.ts +12 -0
- package/dist/tasks/order/schema.js +1 -0
- package/dist/tasks/order/types.d.ts +36 -0
- package/dist/tasks/order/types.js +1 -0
- package/dist/tasks/order/validator.d.ts +11 -0
- package/dist/tasks/order/validator.js +12 -0
- package/dist/tasks/partition/partition.d.ts +6 -0
- package/dist/tasks/partition/partition.js +1 -0
- package/dist/tasks/partition/prompt.d.ts +16 -0
- package/dist/tasks/partition/prompt.js +61 -0
- package/dist/tasks/partition/schema.d.ts +14 -0
- package/dist/tasks/partition/schema.js +1 -0
- package/dist/tasks/partition/types.d.ts +53 -0
- package/dist/tasks/partition/types.js +1 -0
- package/dist/tasks/partition/validator.d.ts +7 -0
- package/dist/tasks/partition/validator.js +11 -0
- package/dist/tasks/quick-compose/prompt.d.ts +18 -0
- package/dist/tasks/quick-compose/prompt.js +47 -0
- package/dist/tasks/quick-compose/quick-compose.d.ts +6 -0
- package/dist/tasks/quick-compose/quick-compose.js +1 -0
- package/dist/tasks/quick-compose/schema.d.ts +27 -0
- package/dist/tasks/quick-compose/schema.js +1 -0
- package/dist/tasks/quick-compose/types.d.ts +63 -0
- package/dist/tasks/quick-compose/types.js +1 -0
- package/dist/tasks/quick-compose/validator.d.ts +7 -0
- package/dist/tasks/quick-compose/validator.js +25 -0
- package/dist/tasks/session.d.ts +22 -0
- package/dist/tasks/session.js +1 -0
- package/dist/tasks/types.d.ts +101 -0
- package/dist/tasks/types.js +3 -0
- package/dist/workflows/compose.d.ts +371 -0
- package/dist/workflows/compose.js +2 -0
- package/dist/workflows/split.d.ts +80 -0
- package/dist/workflows/split.js +3 -0
- package/dist/workflows/types.d.ts +63 -0
- package/dist/workflows/types.js +1 -0
- package/dist/workflows/undo.d.ts +56 -0
- package/dist/workflows/undo.js +1 -0
- package/package.json +37 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ComposeGitPort } from "../ports/git.js";
|
|
2
|
+
import { UndoId, UndoResult, UndoValidation } from "@gitkraken/shared-tools";
|
|
3
|
+
|
|
4
|
+
//#region src/workflows/undo.d.ts
|
|
5
|
+
interface UndoComposeInput {
|
|
6
|
+
git: ComposeGitPort;
|
|
7
|
+
/** The undo ID returned by `compose()` or `split()`. */
|
|
8
|
+
undoId: UndoId;
|
|
9
|
+
/**
|
|
10
|
+
* When true, downgrades `branch_has_new_commits` blockers to warnings and
|
|
11
|
+
* proceeds. The `dirty_workdir` blocker is never force-able.
|
|
12
|
+
*/
|
|
13
|
+
force?: boolean;
|
|
14
|
+
/** Called before each undo step with a human-readable description. */
|
|
15
|
+
onProgress?: (step: string) => void;
|
|
16
|
+
/** Optional cancellation signal. Forwarded to every git operation. */
|
|
17
|
+
signal?: AbortSignal;
|
|
18
|
+
}
|
|
19
|
+
interface ValidateUndoComposeInput {
|
|
20
|
+
git: ComposeGitPort;
|
|
21
|
+
/** The undo ID to validate. */
|
|
22
|
+
undoId: UndoId;
|
|
23
|
+
/** Optional cancellation signal. Forwarded to every git operation. */
|
|
24
|
+
signal?: AbortSignal;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Validate whether undoing a compose/split operation can safely proceed.
|
|
28
|
+
*
|
|
29
|
+
* Returns blockers (hard stops) and warnings (notable conditions). Does not
|
|
30
|
+
* mutate the repository. Use this for dry-run checks before {@link undoCompose}.
|
|
31
|
+
*/
|
|
32
|
+
declare function validateUndoCompose(input: ValidateUndoComposeInput): Promise<UndoValidation>;
|
|
33
|
+
/**
|
|
34
|
+
* Reverse a previous `compose()` or `split()` operation.
|
|
35
|
+
*
|
|
36
|
+
* Loads the undo manifest persisted during the original operation, validates
|
|
37
|
+
* that the undo can proceed safely, then surgically reverses only the git
|
|
38
|
+
* mutations that were recorded. Returns a structured {@link UndoResult}.
|
|
39
|
+
*
|
|
40
|
+
* Safety:
|
|
41
|
+
* - Refuses to proceed when the working directory has uncommitted changes.
|
|
42
|
+
* - Refuses when a branch created by the operation has been modified since
|
|
43
|
+
* (unless `force` is set).
|
|
44
|
+
* - Best-effort on working directory restoration from stash backup.
|
|
45
|
+
*/
|
|
46
|
+
declare function undoCompose(input: UndoComposeInput): Promise<UndoResult>;
|
|
47
|
+
/**
|
|
48
|
+
* List all undo manifest IDs stored in this repository.
|
|
49
|
+
*
|
|
50
|
+
* Returns IDs for all workflows that used the shared undo infrastructure
|
|
51
|
+
* (compose, split, and any future packages). Each ID can be passed to
|
|
52
|
+
* {@link validateUndoCompose} or {@link undoCompose}.
|
|
53
|
+
*/
|
|
54
|
+
declare function listUndoIds(git: ComposeGitPort, signal?: AbortSignal): Promise<UndoId[]>;
|
|
55
|
+
//#endregion
|
|
56
|
+
export { UndoComposeInput, ValidateUndoComposeInput, listUndoIds, undoCompose, validateUndoCompose };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{requireExec as e}from"../git/require-exec.js";import{UndoStore as t,undoOperation as n,validateUndo as r}from"@gitkraken/shared-tools";async function i(t){return r({git:e(t.git,`undo validation`),manifestId:t.undoId,signal:t.signal})}async function a(t){return n({git:e(t.git,`undo execution`),manifestId:t.undoId,force:t.force,onProgress:t.onProgress,signal:t.signal})}async function o(n,r){return new t(e(n,`undo listing`)).list({signal:r})}export{o as listUndoIds,a as undoCompose,i as validateUndoCompose};
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@gitkraken/compose-tools",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "AI-powered organization of git changes into clean, atomic commits and branches.",
|
|
5
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
6
|
+
"author": "Axosoft, LLC dba GitKraken",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">= 22"
|
|
9
|
+
},
|
|
10
|
+
"type": "module",
|
|
11
|
+
"sideEffects": false,
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"default": "./dist/index.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist",
|
|
20
|
+
"CHANGELOG.md"
|
|
21
|
+
],
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"zod": "^4.3.6",
|
|
24
|
+
"@gitkraken/shared-tools": "^0.1.0"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@types/node": "^22.0.0",
|
|
28
|
+
"typescript": "^6.0.2",
|
|
29
|
+
"vitest": "^4.1.1"
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"build": "tsdown --config-loader=unrun",
|
|
33
|
+
"build:dev": "tsdown --config tsdown.dev.config.ts --config-loader=unrun",
|
|
34
|
+
"typecheck": "tsc --noEmit",
|
|
35
|
+
"test": "vitest run"
|
|
36
|
+
}
|
|
37
|
+
}
|