@autonav/core 1.5.0 → 1.6.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/cli/autonav.d.ts +1 -0
- package/dist/cli/autonav.d.ts.map +1 -1
- package/dist/cli/autonav.js +7 -0
- package/dist/cli/autonav.js.map +1 -1
- package/dist/cli/nav-memento.d.ts +20 -0
- package/dist/cli/nav-memento.d.ts.map +1 -0
- package/dist/cli/nav-memento.js +179 -0
- package/dist/cli/nav-memento.js.map +1 -0
- package/dist/memento/git-operations.d.ts +95 -0
- package/dist/memento/git-operations.d.ts.map +1 -0
- package/dist/memento/git-operations.js +256 -0
- package/dist/memento/git-operations.js.map +1 -0
- package/dist/memento/index.d.ts +31 -0
- package/dist/memento/index.d.ts.map +1 -0
- package/dist/memento/index.js +38 -0
- package/dist/memento/index.js.map +1 -0
- package/dist/memento/loop.d.ts +33 -0
- package/dist/memento/loop.d.ts.map +1 -0
- package/dist/memento/loop.js +535 -0
- package/dist/memento/loop.js.map +1 -0
- package/dist/memento/matrix-animation.d.ts +77 -0
- package/dist/memento/matrix-animation.d.ts.map +1 -0
- package/dist/memento/matrix-animation.js +228 -0
- package/dist/memento/matrix-animation.js.map +1 -0
- package/dist/memento/nav-protocol.d.ts +30 -0
- package/dist/memento/nav-protocol.d.ts.map +1 -0
- package/dist/memento/nav-protocol.js +79 -0
- package/dist/memento/nav-protocol.js.map +1 -0
- package/dist/memento/prompts.d.ts +44 -0
- package/dist/memento/prompts.d.ts.map +1 -0
- package/dist/memento/prompts.js +168 -0
- package/dist/memento/prompts.js.map +1 -0
- package/dist/memento/state.d.ts +56 -0
- package/dist/memento/state.d.ts.map +1 -0
- package/dist/memento/state.js +156 -0
- package/dist/memento/state.js.map +1 -0
- package/dist/memento/types.d.ts +123 -0
- package/dist/memento/types.d.ts.map +1 -0
- package/dist/memento/types.js +30 -0
- package/dist/memento/types.js.map +1 -0
- package/dist/memento/worker-agent.d.ts +30 -0
- package/dist/memento/worker-agent.d.ts.map +1 -0
- package/dist/memento/worker-agent.js +109 -0
- package/dist/memento/worker-agent.js.map +1 -0
- package/dist/migrations/versions/v1.4.0-rfc2119-skills.d.ts +18 -0
- package/dist/migrations/versions/v1.4.0-rfc2119-skills.d.ts.map +1 -0
- package/dist/migrations/versions/v1.4.0-rfc2119-skills.js +207 -0
- package/dist/migrations/versions/v1.4.0-rfc2119-skills.js.map +1 -0
- package/package.json +1 -1
- package/dist/skill-generator/index.d.ts +0 -142
- package/dist/skill-generator/index.d.ts.map +0 -1
- package/dist/skill-generator/index.js +0 -510
- package/dist/skill-generator/index.js.map +0 -1
- package/dist/templates/.gitignore.template +0 -26
- package/dist/templates/CLAUDE-pack.md.template +0 -114
- package/dist/templates/CLAUDE.md.template +0 -153
- package/dist/templates/README.md.template +0 -174
- package/dist/templates/config-pack.json.template +0 -16
- package/dist/templates/config.json.template +0 -11
- package/dist/templates/index.d.ts +0 -22
- package/dist/templates/index.d.ts.map +0 -1
- package/dist/templates/index.js +0 -32
- package/dist/templates/index.js.map +0 -1
- package/dist/templates/plugins.json.template +0 -33
- package/dist/templates/system-configuration.md.template +0 -70
package/dist/cli/autonav.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autonav.d.ts","sourceRoot":"","sources":["../../src/cli/autonav.ts"],"names":[],"mappings":";AAEA
|
|
1
|
+
{"version":3,"file":"autonav.d.ts","sourceRoot":"","sources":["../../src/cli/autonav.ts"],"names":[],"mappings":";AAEA;;;;;;;;;GASG"}
|
package/dist/cli/autonav.js
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* - autonav query -> nav-query.ts
|
|
8
8
|
* - autonav update -> nav-update.ts
|
|
9
9
|
* - autonav chat -> nav-chat.ts
|
|
10
|
+
* - autonav memento -> nav-memento.ts
|
|
10
11
|
*/
|
|
11
12
|
import { spawn } from "node:child_process";
|
|
12
13
|
import { fileURLToPath } from "node:url";
|
|
@@ -40,6 +41,7 @@ Commands:
|
|
|
40
41
|
chat <path> Interactive conversation with a navigator
|
|
41
42
|
migrate <path> Migrate a navigator to latest version
|
|
42
43
|
mend <path> Health check and repair for navigators
|
|
44
|
+
memento <code> <nav> Iterative development loop (nav plans, worker implements)
|
|
43
45
|
install [path] Symlink local skills to global location
|
|
44
46
|
uninstall [path] Remove global skill symlinks (preserves local)
|
|
45
47
|
|
|
@@ -56,6 +58,7 @@ Examples:
|
|
|
56
58
|
autonav chat ./my-navigator
|
|
57
59
|
autonav migrate ./my-navigator
|
|
58
60
|
autonav mend ./my-navigator --auto-fix
|
|
61
|
+
autonav memento ./my-app ./my-nav --task "Add auth" --branch feature/auth
|
|
59
62
|
autonav install ./my-navigator
|
|
60
63
|
autonav uninstall ./my-navigator
|
|
61
64
|
|
|
@@ -66,6 +69,7 @@ For command-specific help:
|
|
|
66
69
|
autonav chat --help
|
|
67
70
|
autonav migrate --help
|
|
68
71
|
autonav mend --help
|
|
72
|
+
autonav memento --help
|
|
69
73
|
autonav install --help
|
|
70
74
|
autonav uninstall --help
|
|
71
75
|
`);
|
|
@@ -105,6 +109,9 @@ function main() {
|
|
|
105
109
|
case "mend":
|
|
106
110
|
scriptPath = path.join(__dirname, "nav-mend.js");
|
|
107
111
|
break;
|
|
112
|
+
case "memento":
|
|
113
|
+
scriptPath = path.join(__dirname, "nav-memento.js");
|
|
114
|
+
break;
|
|
108
115
|
case "install":
|
|
109
116
|
scriptPath = path.join(__dirname, "nav-install.js");
|
|
110
117
|
break;
|
package/dist/cli/autonav.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autonav.js","sourceRoot":"","sources":["../../src/cli/autonav.ts"],"names":[],"mappings":";AAEA
|
|
1
|
+
{"version":3,"file":"autonav.js","sourceRoot":"","sources":["../../src/cli/autonav.ts"],"names":[],"mappings":";AAEA;;;;;;;;;GASG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,E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,CAAC,SAAS,EAAE,kBAAkB,CAAC,CAAC;YACtD,MAAM;QACR;YACE,OAAO,CAAC,KAAK,CAAC,2BAA2B,OAAO,IAAI,CAAC,CAAC;YACtD,UAAU,EAAE,CAAC;YACb,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IAED,uCAAuC;IACvC,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,UAAU,EAAE,GAAG,WAAW,CAAC,EAAE;QAClE,KAAK,EAAE,SAAS;KACjB,CAAC,CAAC;IAEH,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;QACxB,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;IAEH,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;QAC1B,OAAO,CAAC,KAAK,CAAC,8BAA8B,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QAC7D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC;AAED,IAAI,EAAE,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Memento Command CLI
|
|
4
|
+
*
|
|
5
|
+
* Context-clearing iterative development loop that coordinates
|
|
6
|
+
* a navigator (for planning) and a worker (for implementation).
|
|
7
|
+
*
|
|
8
|
+
* Design principle: Git is the only persistent memory. No state files.
|
|
9
|
+
* Each iteration starts fresh with only git history as context.
|
|
10
|
+
*
|
|
11
|
+
* Usage:
|
|
12
|
+
* autonav memento <code-directory> <nav-directory> [options]
|
|
13
|
+
*
|
|
14
|
+
* Examples:
|
|
15
|
+
* autonav memento ./my-app ./my-nav --task "Add user auth"
|
|
16
|
+
* autonav memento ./my-app ./my-nav --branch feature/auth --pr
|
|
17
|
+
* autonav memento ./my-app ./my-nav --max-iterations 5 --verbose
|
|
18
|
+
*/
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=nav-memento.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nav-memento.d.ts","sourceRoot":"","sources":["../../src/cli/nav-memento.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;GAgBG"}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Memento Command CLI
|
|
4
|
+
*
|
|
5
|
+
* Context-clearing iterative development loop that coordinates
|
|
6
|
+
* a navigator (for planning) and a worker (for implementation).
|
|
7
|
+
*
|
|
8
|
+
* Design principle: Git is the only persistent memory. No state files.
|
|
9
|
+
* Each iteration starts fresh with only git history as context.
|
|
10
|
+
*
|
|
11
|
+
* Usage:
|
|
12
|
+
* autonav memento <code-directory> <nav-directory> [options]
|
|
13
|
+
*
|
|
14
|
+
* Examples:
|
|
15
|
+
* autonav memento ./my-app ./my-nav --task "Add user auth"
|
|
16
|
+
* autonav memento ./my-app ./my-nav --branch feature/auth --pr
|
|
17
|
+
* autonav memento ./my-app ./my-nav --max-iterations 5 --verbose
|
|
18
|
+
*/
|
|
19
|
+
import { Command } from "commander";
|
|
20
|
+
import chalk from "chalk";
|
|
21
|
+
import * as fs from "node:fs";
|
|
22
|
+
import * as path from "node:path";
|
|
23
|
+
import { runMementoLoop } from "../memento/index.js";
|
|
24
|
+
/**
|
|
25
|
+
* Load task from TASK.md file if it exists
|
|
26
|
+
*/
|
|
27
|
+
function loadTaskFromFile(codeDirectory) {
|
|
28
|
+
const taskPath = path.join(codeDirectory, "TASK.md");
|
|
29
|
+
if (fs.existsSync(taskPath)) {
|
|
30
|
+
return fs.readFileSync(taskPath, "utf-8").trim();
|
|
31
|
+
}
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Main CLI program
|
|
36
|
+
*/
|
|
37
|
+
const program = new Command();
|
|
38
|
+
program
|
|
39
|
+
.name("autonav memento")
|
|
40
|
+
.description("Context-clearing iterative development loop coordinating navigator and worker agents")
|
|
41
|
+
.version("1.0.0")
|
|
42
|
+
.argument("<code-directory>", "Directory containing code to modify")
|
|
43
|
+
.argument("<nav-directory>", "Directory containing the navigator")
|
|
44
|
+
.option("--pr", "Create and push to a new PR when complete")
|
|
45
|
+
.option("--max-iterations <n>", "Maximum iterations (default: 0 = unlimited)", "0")
|
|
46
|
+
.option("--promise <text>", "Completion signal text", "IMPLEMENTATION COMPLETE")
|
|
47
|
+
.option("--branch <name>", "Git branch name for work")
|
|
48
|
+
.option("--task <text>", "Task description (reads TASK.md if not provided)")
|
|
49
|
+
.option("--verbose", "Show detailed logging")
|
|
50
|
+
.option("--model <model>", "Model for worker agent", "claude-haiku-4-5")
|
|
51
|
+
.option("--nav-model <model>", "Model for navigator agent", "claude-opus-4-5")
|
|
52
|
+
.action(async (codeDirectory, navDirectory, options) => {
|
|
53
|
+
await executeMemento(codeDirectory, navDirectory, options);
|
|
54
|
+
});
|
|
55
|
+
/**
|
|
56
|
+
* Execute the memento command
|
|
57
|
+
*/
|
|
58
|
+
async function executeMemento(codeDirectory, navDirectory, options) {
|
|
59
|
+
const verbose = options.verbose ?? false;
|
|
60
|
+
// Resolve paths
|
|
61
|
+
const resolvedCodeDir = path.resolve(codeDirectory);
|
|
62
|
+
const resolvedNavDir = path.resolve(navDirectory);
|
|
63
|
+
// Validate code directory
|
|
64
|
+
if (!fs.existsSync(resolvedCodeDir)) {
|
|
65
|
+
console.error(chalk.red(`Error: Code directory not found: ${resolvedCodeDir}`));
|
|
66
|
+
console.error(chalk.dim(`Create the directory or specify a valid path.`));
|
|
67
|
+
process.exit(1);
|
|
68
|
+
}
|
|
69
|
+
if (!fs.statSync(resolvedCodeDir).isDirectory()) {
|
|
70
|
+
console.error(chalk.red(`Error: Not a directory: ${resolvedCodeDir}`));
|
|
71
|
+
process.exit(1);
|
|
72
|
+
}
|
|
73
|
+
// Validate navigator directory
|
|
74
|
+
if (!fs.existsSync(resolvedNavDir)) {
|
|
75
|
+
console.error(chalk.red(`Error: Navigator directory not found: ${resolvedNavDir}`));
|
|
76
|
+
console.error(chalk.dim(`Use 'autonav init' to create a navigator first.`));
|
|
77
|
+
process.exit(1);
|
|
78
|
+
}
|
|
79
|
+
const claudeMdPath = path.join(resolvedNavDir, "CLAUDE.md");
|
|
80
|
+
if (!fs.existsSync(claudeMdPath)) {
|
|
81
|
+
console.error(chalk.red(`Error: Navigator CLAUDE.md not found: ${claudeMdPath}`));
|
|
82
|
+
console.error(chalk.dim(`The navigator directory must contain a CLAUDE.md file.`));
|
|
83
|
+
process.exit(1);
|
|
84
|
+
}
|
|
85
|
+
// Get task description
|
|
86
|
+
let task = options.task;
|
|
87
|
+
if (!task) {
|
|
88
|
+
const loadedTask = loadTaskFromFile(resolvedCodeDir);
|
|
89
|
+
if (loadedTask) {
|
|
90
|
+
task = loadedTask;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
// Default task if none provided
|
|
94
|
+
if (!task) {
|
|
95
|
+
task = "Please give me the next unit of work";
|
|
96
|
+
}
|
|
97
|
+
// Parse max iterations
|
|
98
|
+
const maxIterations = parseInt(options.maxIterations || "0", 10);
|
|
99
|
+
if (isNaN(maxIterations) || maxIterations < 0) {
|
|
100
|
+
console.error(chalk.red(`Error: Invalid max-iterations value: ${options.maxIterations}`));
|
|
101
|
+
process.exit(1);
|
|
102
|
+
}
|
|
103
|
+
// Display configuration
|
|
104
|
+
console.log(chalk.bold("\nAutonav Memento Loop"));
|
|
105
|
+
console.log(chalk.dim("─".repeat(40)));
|
|
106
|
+
console.log(`${chalk.blue("Code:")} ${resolvedCodeDir}`);
|
|
107
|
+
console.log(`${chalk.blue("Navigator:")} ${resolvedNavDir}`);
|
|
108
|
+
console.log(`${chalk.blue("Task:")} ${task.substring(0, 80)}${task.length > 80 ? "..." : ""}`);
|
|
109
|
+
if (options.branch) {
|
|
110
|
+
console.log(`${chalk.blue("Branch:")} ${options.branch}`);
|
|
111
|
+
}
|
|
112
|
+
if (maxIterations > 0) {
|
|
113
|
+
console.log(`${chalk.blue("Max iterations:")} ${maxIterations}`);
|
|
114
|
+
}
|
|
115
|
+
if (options.pr) {
|
|
116
|
+
console.log(`${chalk.blue("Create PR:")} Yes`);
|
|
117
|
+
}
|
|
118
|
+
console.log(chalk.dim("─".repeat(40)));
|
|
119
|
+
try {
|
|
120
|
+
// Run the memento loop
|
|
121
|
+
const result = await runMementoLoop(resolvedCodeDir, resolvedNavDir, task, {
|
|
122
|
+
pr: options.pr,
|
|
123
|
+
maxIterations,
|
|
124
|
+
promise: options.promise || "IMPLEMENTATION COMPLETE",
|
|
125
|
+
branch: options.branch,
|
|
126
|
+
verbose,
|
|
127
|
+
model: options.model,
|
|
128
|
+
navModel: options.navModel,
|
|
129
|
+
});
|
|
130
|
+
// Display results
|
|
131
|
+
console.log(chalk.dim("\n" + "─".repeat(40)));
|
|
132
|
+
if (result.success) {
|
|
133
|
+
console.log(chalk.green.bold("\n✅ Task completed successfully!"));
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
console.log(chalk.yellow.bold("\n⚠️ Task did not complete"));
|
|
137
|
+
}
|
|
138
|
+
console.log(`${chalk.blue("Iterations:")} ${result.iterations}`);
|
|
139
|
+
console.log(`${chalk.blue("Duration:")} ${formatDuration(result.durationMs)}`);
|
|
140
|
+
if (result.branch) {
|
|
141
|
+
console.log(`${chalk.blue("Branch:")} ${result.branch}`);
|
|
142
|
+
}
|
|
143
|
+
if (result.prUrl) {
|
|
144
|
+
console.log(`${chalk.blue("PR:")} ${result.prUrl}`);
|
|
145
|
+
}
|
|
146
|
+
if (result.completionMessage) {
|
|
147
|
+
console.log(`\n${chalk.green("Message:")} ${result.completionMessage}`);
|
|
148
|
+
}
|
|
149
|
+
if (result.errors && result.errors.length > 0) {
|
|
150
|
+
console.log(chalk.yellow("\nErrors encountered:"));
|
|
151
|
+
for (const error of result.errors) {
|
|
152
|
+
console.log(chalk.dim(` - ${error}`));
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
process.exit(result.success ? 0 : 1);
|
|
156
|
+
}
|
|
157
|
+
catch (error) {
|
|
158
|
+
console.error(chalk.red("\n❌ Memento loop failed:"));
|
|
159
|
+
console.error(chalk.dim(error instanceof Error ? error.message : String(error)));
|
|
160
|
+
process.exit(1);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Format duration in human-readable format
|
|
165
|
+
*/
|
|
166
|
+
function formatDuration(ms) {
|
|
167
|
+
if (ms < 1000) {
|
|
168
|
+
return `${ms}ms`;
|
|
169
|
+
}
|
|
170
|
+
if (ms < 60000) {
|
|
171
|
+
return `${(ms / 1000).toFixed(1)}s`;
|
|
172
|
+
}
|
|
173
|
+
const minutes = Math.floor(ms / 60000);
|
|
174
|
+
const seconds = Math.floor((ms % 60000) / 1000);
|
|
175
|
+
return `${minutes}m ${seconds}s`;
|
|
176
|
+
}
|
|
177
|
+
// Parse and execute
|
|
178
|
+
program.parse(process.argv);
|
|
179
|
+
//# sourceMappingURL=nav-memento.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nav-memento.js","sourceRoot":"","sources":["../../src/cli/nav-memento.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAgBrD;;GAEG;AACH,SAAS,gBAAgB,CAAC,aAAqB;IAC7C,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,SAAS,C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 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Git Operations for Memento Loop
|
|
3
|
+
*
|
|
4
|
+
* Helper functions for git operations: branches, commits, logs, PRs.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Options for git operations
|
|
8
|
+
*/
|
|
9
|
+
interface GitOptions {
|
|
10
|
+
cwd: string;
|
|
11
|
+
verbose?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Check if directory is a git repository
|
|
15
|
+
*/
|
|
16
|
+
export declare function isGitRepo(cwd: string): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Initialize a git repository if not already initialized
|
|
19
|
+
*/
|
|
20
|
+
export declare function ensureGitRepo(options: GitOptions): void;
|
|
21
|
+
/**
|
|
22
|
+
* Get current branch name
|
|
23
|
+
*/
|
|
24
|
+
export declare function getCurrentBranch(options: GitOptions): string;
|
|
25
|
+
/**
|
|
26
|
+
* Create and checkout a new branch
|
|
27
|
+
*/
|
|
28
|
+
export declare function createBranch(name: string, options: GitOptions): void;
|
|
29
|
+
/**
|
|
30
|
+
* Get recent git log entries
|
|
31
|
+
*/
|
|
32
|
+
export declare function getRecentGitLog(options: GitOptions & {
|
|
33
|
+
count?: number;
|
|
34
|
+
}): string;
|
|
35
|
+
/**
|
|
36
|
+
* Get diff of recent changes (staged + unstaged)
|
|
37
|
+
*/
|
|
38
|
+
export declare function getRecentDiff(options: GitOptions): string;
|
|
39
|
+
/**
|
|
40
|
+
* Diff statistics
|
|
41
|
+
*/
|
|
42
|
+
export interface DiffStats {
|
|
43
|
+
filesChanged: number;
|
|
44
|
+
linesAdded: number;
|
|
45
|
+
linesRemoved: number;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Get diff stats (lines added/removed) for uncommitted changes
|
|
49
|
+
*/
|
|
50
|
+
export declare function getDiffStats(options: GitOptions): DiffStats;
|
|
51
|
+
/**
|
|
52
|
+
* Get diff stats between HEAD and HEAD~1 (last commit)
|
|
53
|
+
*/
|
|
54
|
+
export declare function getLastCommitDiffStats(options: GitOptions): DiffStats;
|
|
55
|
+
/**
|
|
56
|
+
* Check if there are uncommitted changes
|
|
57
|
+
*/
|
|
58
|
+
export declare function hasUncommittedChanges(options: GitOptions): boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Stage all changes
|
|
61
|
+
*/
|
|
62
|
+
export declare function stageAllChanges(options: GitOptions): void;
|
|
63
|
+
/**
|
|
64
|
+
* Commit staged changes
|
|
65
|
+
*
|
|
66
|
+
* Returns the commit hash, or null if nothing to commit
|
|
67
|
+
*/
|
|
68
|
+
export declare function commitChanges(message: string, options: GitOptions): string | null;
|
|
69
|
+
/**
|
|
70
|
+
* Push branch to remote
|
|
71
|
+
*/
|
|
72
|
+
export declare function pushBranch(branch: string, options: GitOptions & {
|
|
73
|
+
setUpstream?: boolean;
|
|
74
|
+
}): void;
|
|
75
|
+
/**
|
|
76
|
+
* Create a pull request using GitHub CLI
|
|
77
|
+
*
|
|
78
|
+
* Requires `gh` CLI to be installed and authenticated
|
|
79
|
+
*/
|
|
80
|
+
export declare function createPullRequest(options: GitOptions & {
|
|
81
|
+
title: string;
|
|
82
|
+
body: string;
|
|
83
|
+
base?: string;
|
|
84
|
+
draft?: boolean;
|
|
85
|
+
}): string;
|
|
86
|
+
/**
|
|
87
|
+
* Check if gh CLI is available and authenticated
|
|
88
|
+
*/
|
|
89
|
+
export declare function isGhAvailable(): boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Get the remote origin URL
|
|
92
|
+
*/
|
|
93
|
+
export declare function getRemoteUrl(options: GitOptions): string | null;
|
|
94
|
+
export {};
|
|
95
|
+
//# sourceMappingURL=git-operations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-operations.d.ts","sourceRoot":"","sources":["../../src/memento/git-operations.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;GAEG;AACH,UAAU,UAAU;IAClB,GAAG,EAAE,MAAM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,OAAO,CAAA;CAAE,GAC9C,IAAI,CAON;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,UAAU,GAAG;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,GACA,MAAM,CAsBR;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,OAAO,CAUvC;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI,CAM/D"}
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Git Operations for Memento Loop
|
|
3
|
+
*
|
|
4
|
+
* Helper functions for git operations: branches, commits, logs, PRs.
|
|
5
|
+
*/
|
|
6
|
+
import { execSync } from "node:child_process";
|
|
7
|
+
/**
|
|
8
|
+
* Execute a git command and return output
|
|
9
|
+
*/
|
|
10
|
+
function execGit(command, options) {
|
|
11
|
+
const execOptions = {
|
|
12
|
+
cwd: options.cwd,
|
|
13
|
+
encoding: "utf-8",
|
|
14
|
+
stdio: options.verbose ? "inherit" : "pipe",
|
|
15
|
+
};
|
|
16
|
+
try {
|
|
17
|
+
const result = execSync(command, execOptions);
|
|
18
|
+
return typeof result === "string" ? result.trim() : "";
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
if (error instanceof Error && "stderr" in error) {
|
|
22
|
+
throw new Error(`Git command failed: ${command}\n${error.stderr}`);
|
|
23
|
+
}
|
|
24
|
+
throw error;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Check if directory is a git repository
|
|
29
|
+
*/
|
|
30
|
+
export function isGitRepo(cwd) {
|
|
31
|
+
try {
|
|
32
|
+
execSync("git rev-parse --is-inside-work-tree", {
|
|
33
|
+
cwd,
|
|
34
|
+
encoding: "utf-8",
|
|
35
|
+
stdio: "pipe",
|
|
36
|
+
});
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Initialize a git repository if not already initialized
|
|
45
|
+
*/
|
|
46
|
+
export function ensureGitRepo(options) {
|
|
47
|
+
if (!isGitRepo(options.cwd)) {
|
|
48
|
+
execGit("git init", options);
|
|
49
|
+
if (options.verbose) {
|
|
50
|
+
console.log(`Initialized git repository in ${options.cwd}`);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Get current branch name
|
|
56
|
+
*/
|
|
57
|
+
export function getCurrentBranch(options) {
|
|
58
|
+
try {
|
|
59
|
+
return execGit("git branch --show-current", { ...options, verbose: false });
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
return "HEAD"; // Detached HEAD state
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Create and checkout a new branch
|
|
67
|
+
*/
|
|
68
|
+
export function createBranch(name, options) {
|
|
69
|
+
// Check if branch already exists
|
|
70
|
+
try {
|
|
71
|
+
execGit(`git rev-parse --verify ${name}`, { ...options, verbose: false });
|
|
72
|
+
// Branch exists, just checkout
|
|
73
|
+
execGit(`git checkout ${name}`, options);
|
|
74
|
+
if (options.verbose) {
|
|
75
|
+
console.log(`Switched to existing branch: ${name}`);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
// Branch doesn't exist, create it
|
|
80
|
+
execGit(`git checkout -b ${name}`, options);
|
|
81
|
+
if (options.verbose) {
|
|
82
|
+
console.log(`Created and switched to branch: ${name}`);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Get recent git log entries
|
|
88
|
+
*/
|
|
89
|
+
export function getRecentGitLog(options) {
|
|
90
|
+
const count = options.count ?? 10;
|
|
91
|
+
try {
|
|
92
|
+
// Check if there are any commits
|
|
93
|
+
execGit("git rev-parse HEAD", { ...options, verbose: false });
|
|
94
|
+
return execGit(`git log --oneline --no-decorate -n ${count}`, { ...options, verbose: false });
|
|
95
|
+
}
|
|
96
|
+
catch {
|
|
97
|
+
// No commits yet
|
|
98
|
+
return "";
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Get diff of recent changes (staged + unstaged)
|
|
103
|
+
*/
|
|
104
|
+
export function getRecentDiff(options) {
|
|
105
|
+
try {
|
|
106
|
+
const staged = execGit("git diff --cached", { ...options, verbose: false });
|
|
107
|
+
const unstaged = execGit("git diff", { ...options, verbose: false });
|
|
108
|
+
return `${staged}\n${unstaged}`.trim();
|
|
109
|
+
}
|
|
110
|
+
catch {
|
|
111
|
+
return "";
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Get diff stats (lines added/removed) for uncommitted changes
|
|
116
|
+
*/
|
|
117
|
+
export function getDiffStats(options) {
|
|
118
|
+
try {
|
|
119
|
+
// git diff --shortstat outputs: " 3 files changed, 10 insertions(+), 5 deletions(-)"
|
|
120
|
+
const output = execGit("git diff --shortstat", { ...options, verbose: false });
|
|
121
|
+
if (!output) {
|
|
122
|
+
return { filesChanged: 0, linesAdded: 0, linesRemoved: 0 };
|
|
123
|
+
}
|
|
124
|
+
const filesMatch = output.match(/(\d+) files? changed/);
|
|
125
|
+
const insertionsMatch = output.match(/(\d+) insertions?\(\+\)/);
|
|
126
|
+
const deletionsMatch = output.match(/(\d+) deletions?\(-\)/);
|
|
127
|
+
return {
|
|
128
|
+
filesChanged: filesMatch ? parseInt(filesMatch[1], 10) : 0,
|
|
129
|
+
linesAdded: insertionsMatch ? parseInt(insertionsMatch[1], 10) : 0,
|
|
130
|
+
linesRemoved: deletionsMatch ? parseInt(deletionsMatch[1], 10) : 0,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
catch {
|
|
134
|
+
return { filesChanged: 0, linesAdded: 0, linesRemoved: 0 };
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Get diff stats between HEAD and HEAD~1 (last commit)
|
|
139
|
+
*/
|
|
140
|
+
export function getLastCommitDiffStats(options) {
|
|
141
|
+
try {
|
|
142
|
+
const output = execGit("git diff --shortstat HEAD~1 HEAD", { ...options, verbose: false });
|
|
143
|
+
if (!output) {
|
|
144
|
+
return { filesChanged: 0, linesAdded: 0, linesRemoved: 0 };
|
|
145
|
+
}
|
|
146
|
+
const filesMatch = output.match(/(\d+) files? changed/);
|
|
147
|
+
const insertionsMatch = output.match(/(\d+) insertions?\(\+\)/);
|
|
148
|
+
const deletionsMatch = output.match(/(\d+) deletions?\(-\)/);
|
|
149
|
+
return {
|
|
150
|
+
filesChanged: filesMatch ? parseInt(filesMatch[1], 10) : 0,
|
|
151
|
+
linesAdded: insertionsMatch ? parseInt(insertionsMatch[1], 10) : 0,
|
|
152
|
+
linesRemoved: deletionsMatch ? parseInt(deletionsMatch[1], 10) : 0,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
catch {
|
|
156
|
+
return { filesChanged: 0, linesAdded: 0, linesRemoved: 0 };
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Check if there are uncommitted changes
|
|
161
|
+
*/
|
|
162
|
+
export function hasUncommittedChanges(options) {
|
|
163
|
+
try {
|
|
164
|
+
const status = execGit("git status --porcelain", { ...options, verbose: false });
|
|
165
|
+
return status.length > 0;
|
|
166
|
+
}
|
|
167
|
+
catch {
|
|
168
|
+
return false;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Stage all changes
|
|
173
|
+
*/
|
|
174
|
+
export function stageAllChanges(options) {
|
|
175
|
+
execGit("git add -A", options);
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Commit staged changes
|
|
179
|
+
*
|
|
180
|
+
* Returns the commit hash, or null if nothing to commit
|
|
181
|
+
*/
|
|
182
|
+
export function commitChanges(message, options) {
|
|
183
|
+
// Check if there's anything to commit
|
|
184
|
+
if (!hasUncommittedChanges(options)) {
|
|
185
|
+
if (options.verbose) {
|
|
186
|
+
console.log("No changes to commit");
|
|
187
|
+
}
|
|
188
|
+
return null;
|
|
189
|
+
}
|
|
190
|
+
// Stage all changes
|
|
191
|
+
stageAllChanges(options);
|
|
192
|
+
// Commit
|
|
193
|
+
execGit(`git commit -m "${message.replace(/"/g, '\\"')}"`, options);
|
|
194
|
+
// Get the commit hash
|
|
195
|
+
const hash = execGit("git rev-parse --short HEAD", { ...options, verbose: false });
|
|
196
|
+
if (options.verbose) {
|
|
197
|
+
console.log(`Committed: ${hash} - ${message}`);
|
|
198
|
+
}
|
|
199
|
+
return hash;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Push branch to remote
|
|
203
|
+
*/
|
|
204
|
+
export function pushBranch(branch, options) {
|
|
205
|
+
const upstream = options.setUpstream ? "-u origin" : "";
|
|
206
|
+
execGit(`git push ${upstream} ${branch}`.trim(), options);
|
|
207
|
+
if (options.verbose) {
|
|
208
|
+
console.log(`Pushed branch: ${branch}`);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Create a pull request using GitHub CLI
|
|
213
|
+
*
|
|
214
|
+
* Requires `gh` CLI to be installed and authenticated
|
|
215
|
+
*/
|
|
216
|
+
export function createPullRequest(options) {
|
|
217
|
+
const { title, body, base = "main", draft = false } = options;
|
|
218
|
+
// Escape for shell
|
|
219
|
+
const escapedTitle = title.replace(/"/g, '\\"');
|
|
220
|
+
const escapedBody = body.replace(/"/g, '\\"');
|
|
221
|
+
const draftFlag = draft ? "--draft" : "";
|
|
222
|
+
const output = execGit(`gh pr create --title "${escapedTitle}" --body "${escapedBody}" --base ${base} ${draftFlag}`.trim(), options);
|
|
223
|
+
// gh pr create outputs the PR URL
|
|
224
|
+
const prUrl = output.split("\n").pop() || output;
|
|
225
|
+
if (options.verbose) {
|
|
226
|
+
console.log(`Created PR: ${prUrl}`);
|
|
227
|
+
}
|
|
228
|
+
return prUrl;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Check if gh CLI is available and authenticated
|
|
232
|
+
*/
|
|
233
|
+
export function isGhAvailable() {
|
|
234
|
+
try {
|
|
235
|
+
execSync("gh auth status", {
|
|
236
|
+
encoding: "utf-8",
|
|
237
|
+
stdio: "pipe",
|
|
238
|
+
});
|
|
239
|
+
return true;
|
|
240
|
+
}
|
|
241
|
+
catch {
|
|
242
|
+
return false;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Get the remote origin URL
|
|
247
|
+
*/
|
|
248
|
+
export function getRemoteUrl(options) {
|
|
249
|
+
try {
|
|
250
|
+
return execGit("git remote get-url origin", { ...options, verbose: false });
|
|
251
|
+
}
|
|
252
|
+
catch {
|
|
253
|
+
return null;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
//# sourceMappingURL=git-operations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-operations.js","sourceRoot":"","sources":["../../src/memento/git-operations.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAwB,MAAM,oBAAoB,CAAC;AAUpE;;GAEG;AACH,SAAS,OAAO,CAAC,OAAe,EAAE,OAAmB;IACnD,MAAM,WAAW,GAAoB;QACnC,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,QAAQ,EAAE,OAAO;QACjB,KAAK,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM;KAC5C,CAAC;IAEF,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;QAC9C,OAAO,OAAO,MAAM,KAAK,QA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