@christianmaf80/agentic-workflow 1.5.0-beta.1 → 1.6.0-beta.1
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/bin/cli.js +6 -0
- package/dist/bootstrap.md +1 -1
- package/dist/cli/commands/clean.js +18 -0
- package/dist/cli/commands/init.js +15 -0
- package/dist/cli/commands/restore.js +2 -2
- package/dist/core/migration/backup.js +3 -2
- package/dist/core/utils/backup.js +1 -1
- package/dist/rules/constitution/agent-system.md +1 -1
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -3,6 +3,7 @@ import { Command } from 'commander';
|
|
|
3
3
|
import { initCommand } from '../dist/cli/commands/init.js';
|
|
4
4
|
import { createCommand } from '../dist/cli/commands/create.js';
|
|
5
5
|
import { restoreCommand } from '../dist/cli/commands/restore.js';
|
|
6
|
+
import { cleanCommand } from '../dist/cli/commands/clean.js';
|
|
6
7
|
|
|
7
8
|
const program = new Command();
|
|
8
9
|
|
|
@@ -28,4 +29,9 @@ program
|
|
|
28
29
|
.description('Restore the agentic system from a backup')
|
|
29
30
|
.action(restoreCommand);
|
|
30
31
|
|
|
32
|
+
program
|
|
33
|
+
.command('clean')
|
|
34
|
+
.description('Remove legacy configuration files (e.g. MCP)')
|
|
35
|
+
.action(cleanCommand);
|
|
36
|
+
|
|
31
37
|
program.parse();
|
package/dist/bootstrap.md
CHANGED
|
@@ -508,7 +508,7 @@ Discipline is non-negotiable. The local metrics system will apply the **Zero Tol
|
|
|
508
508
|
To ensure the resilience of the local orchestration history:
|
|
509
509
|
|
|
510
510
|
### 3.1 Preventive Auto-Backups
|
|
511
|
-
- The system MUST perform a backup of the `.agent/` folder to `.
|
|
511
|
+
- The system MUST perform a backup of the `.agent/` folder to `.backups/TIMESTAMP/` before executing destructive commands:
|
|
512
512
|
- `init --force`
|
|
513
513
|
- Massive migration operations.
|
|
514
514
|
- Scheduled cleanup.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import fs from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { intro, outro, spinner } from '@clack/prompts';
|
|
4
|
+
export async function cleanCommand() {
|
|
5
|
+
intro('Agentic Workflow Cleanup');
|
|
6
|
+
const cwd = process.cwd();
|
|
7
|
+
const s = spinner();
|
|
8
|
+
s.start('Removing legacy MCP config...');
|
|
9
|
+
const mcpConfigPath = path.join(cwd, '.antigravity', 'task_mcp_config.json');
|
|
10
|
+
try {
|
|
11
|
+
await fs.rm(mcpConfigPath, { force: true });
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
// Ignore if missing or not removable.
|
|
15
|
+
}
|
|
16
|
+
s.stop('Cleanup complete.');
|
|
17
|
+
outro('Legacy MCP configuration removed.');
|
|
18
|
+
}
|
|
@@ -47,6 +47,7 @@ export async function initCommand() {
|
|
|
47
47
|
const sCleanup = spinner();
|
|
48
48
|
sCleanup.start('Cleaning up redundant legacy core files...');
|
|
49
49
|
await cleanupLegacyFiles(agentDir);
|
|
50
|
+
await cleanupLegacyMcpConfig(cwd);
|
|
50
51
|
sCleanup.stop('Local environment cleaned (Core references only).');
|
|
51
52
|
const s = spinner();
|
|
52
53
|
s.start('Configuring Agentic Core Reference...');
|
|
@@ -193,3 +194,17 @@ async function cleanupLegacyFiles(agentDir) {
|
|
|
193
194
|
}
|
|
194
195
|
}
|
|
195
196
|
}
|
|
197
|
+
/**
|
|
198
|
+
* Removes legacy MCP configuration if present.
|
|
199
|
+
*/
|
|
200
|
+
async function cleanupLegacyMcpConfig(cwd) {
|
|
201
|
+
const mcpConfigPath = path.join(cwd, '.antigravity', 'task_mcp_config.json');
|
|
202
|
+
try {
|
|
203
|
+
await fs.rm(mcpConfigPath, { force: true });
|
|
204
|
+
const mcpDir = path.join(cwd, '.antigravity');
|
|
205
|
+
await fs.rmdir(mcpDir);
|
|
206
|
+
}
|
|
207
|
+
catch {
|
|
208
|
+
// Ignore if missing or not removable.
|
|
209
|
+
}
|
|
210
|
+
}
|
|
@@ -4,12 +4,12 @@ import path from 'node:path';
|
|
|
4
4
|
export async function restoreCommand() {
|
|
5
5
|
intro('Agentic Workflow Recovery');
|
|
6
6
|
const cwd = process.cwd();
|
|
7
|
-
const backupBaseDir = path.join(cwd, '.
|
|
7
|
+
const backupBaseDir = path.join(cwd, '.backups');
|
|
8
8
|
try {
|
|
9
9
|
await fs.access(backupBaseDir);
|
|
10
10
|
}
|
|
11
11
|
catch {
|
|
12
|
-
outro('No backups were found in .
|
|
12
|
+
outro('No backups were found in .backups/');
|
|
13
13
|
return;
|
|
14
14
|
}
|
|
15
15
|
const backups = await fs.readdir(backupBaseDir);
|
|
@@ -3,10 +3,11 @@ import path from 'node:path';
|
|
|
3
3
|
export async function createBackup(cwd) {
|
|
4
4
|
const agentDir = path.join(cwd, '.agent');
|
|
5
5
|
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
|
|
6
|
-
const backupDir = path.join(cwd,
|
|
6
|
+
const backupDir = path.join(cwd, '.backups', timestamp, '.agent');
|
|
7
7
|
try {
|
|
8
|
+
await fs.mkdir(path.dirname(backupDir), { recursive: true });
|
|
8
9
|
await fs.cp(agentDir, backupDir, { recursive: true });
|
|
9
|
-
return backupDir;
|
|
10
|
+
return path.dirname(backupDir);
|
|
10
11
|
}
|
|
11
12
|
catch (error) {
|
|
12
13
|
throw new Error(`Failed to create backup: ${error instanceof Error ? error.message : String(error)}`);
|
|
@@ -5,7 +5,7 @@ import path from 'node:path';
|
|
|
5
5
|
*/
|
|
6
6
|
export async function performBackup(cwd) {
|
|
7
7
|
const agentDir = path.join(cwd, '.agent');
|
|
8
|
-
const backupBaseDir = path.join(cwd, '.
|
|
8
|
+
const backupBaseDir = path.join(cwd, '.backups');
|
|
9
9
|
// Check if .agent exists
|
|
10
10
|
try {
|
|
11
11
|
await fs.access(agentDir);
|
|
@@ -50,7 +50,7 @@ Discipline is non-negotiable. The local metrics system will apply the **Zero Tol
|
|
|
50
50
|
To ensure the resilience of the local orchestration history:
|
|
51
51
|
|
|
52
52
|
### 3.1 Preventive Auto-Backups
|
|
53
|
-
- The system MUST perform a backup of the `.agent/` folder to `.
|
|
53
|
+
- The system MUST perform a backup of the `.agent/` folder to `.backups/TIMESTAMP/` before executing destructive commands:
|
|
54
54
|
- `init --force`
|
|
55
55
|
- Massive migration operations.
|
|
56
56
|
- Scheduled cleanup.
|
package/package.json
CHANGED