@mytechtoday/augment-extensions 0.1.0 → 0.1.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/AGENTS.md +83 -3
- package/README.md +6 -5
- package/augment-extensions/coding-standards/python/README.md +44 -0
- package/augment-extensions/coding-standards/python/module.json +26 -0
- package/augment-extensions/coding-standards/python/rules/best-practices.md +232 -0
- package/augment-extensions/coding-standards/python/rules/code-organization.md +220 -0
- package/augment-extensions/coding-standards/python/rules/error-handling.md +221 -0
- package/augment-extensions/coding-standards/python/rules/naming-conventions.md +172 -0
- package/augment-extensions/coding-standards/python/rules/type-hints.md +188 -0
- package/augment-extensions/coding-standards/react/README.md +45 -0
- package/augment-extensions/coding-standards/react/module.json +27 -0
- package/augment-extensions/coding-standards/react/rules/component-patterns.md +214 -0
- package/augment-extensions/coding-standards/react/rules/hooks-best-practices.md +235 -0
- package/augment-extensions/coding-standards/react/rules/performance.md +300 -0
- package/augment-extensions/coding-standards/react/rules/state-management.md +265 -0
- package/augment-extensions/coding-standards/react/rules/typescript-react.md +271 -0
- package/augment-extensions/domain-rules/api-design/README.md +41 -0
- package/augment-extensions/domain-rules/api-design/module.json +27 -0
- package/augment-extensions/domain-rules/api-design/rules/authentication.md +263 -0
- package/augment-extensions/domain-rules/api-design/rules/documentation.md +395 -0
- package/augment-extensions/domain-rules/api-design/rules/error-handling.md +290 -0
- package/augment-extensions/domain-rules/api-design/rules/graphql-api.md +313 -0
- package/augment-extensions/domain-rules/api-design/rules/rest-api.md +214 -0
- package/augment-extensions/domain-rules/api-design/rules/versioning.md +268 -0
- package/augment-extensions/domain-rules/security/README.md +41 -0
- package/augment-extensions/domain-rules/security/module.json +28 -0
- package/augment-extensions/domain-rules/security/rules/authentication-security.md +361 -0
- package/augment-extensions/domain-rules/security/rules/encryption.md +208 -0
- package/augment-extensions/domain-rules/security/rules/input-validation.md +294 -0
- package/augment-extensions/domain-rules/security/rules/owasp-top-10.md +339 -0
- package/augment-extensions/domain-rules/security/rules/secure-coding.md +293 -0
- package/augment-extensions/domain-rules/security/rules/web-security.md +268 -0
- package/augment-extensions/examples/design-patterns/README.md +37 -0
- package/augment-extensions/examples/design-patterns/examples/behavioral-patterns.md +370 -0
- package/augment-extensions/examples/design-patterns/examples/creational-patterns.md +250 -0
- package/augment-extensions/examples/design-patterns/examples/structural-patterns.md +264 -0
- package/augment-extensions/examples/design-patterns/module.json +27 -0
- package/{modules → augment-extensions}/workflows/beads/examples/complete-workflow-example.md +5 -5
- package/{modules → augment-extensions}/workflows/beads/rules/file-format.md +45 -1
- package/{modules → augment-extensions}/workflows/beads/rules/workflow.md +41 -0
- package/{modules → augment-extensions}/workflows/openspec/examples/complete-change-example.md +14 -0
- package/{modules → augment-extensions}/workflows/openspec/rules/spec-format.md +44 -1
- package/{modules → augment-extensions}/workflows/openspec/rules/workflow.md +25 -0
- package/cli/dist/cli.js +64 -0
- package/cli/dist/cli.js.map +1 -1
- package/cli/dist/commands/coord.d.ts +30 -0
- package/cli/dist/commands/coord.d.ts.map +1 -0
- package/cli/dist/commands/coord.js +150 -0
- package/cli/dist/commands/coord.js.map +1 -0
- package/cli/dist/commands/link.js +1 -1
- package/cli/dist/commands/link.js.map +1 -1
- package/cli/dist/commands/list.js +1 -1
- package/cli/dist/commands/list.js.map +1 -1
- package/cli/dist/commands/search.d.ts.map +1 -1
- package/cli/dist/commands/search.js +107 -5
- package/cli/dist/commands/search.js.map +1 -1
- package/cli/dist/commands/show.js +1 -1
- package/cli/dist/commands/show.js.map +1 -1
- package/cli/dist/commands/sync.d.ts +26 -0
- package/cli/dist/commands/sync.d.ts.map +1 -0
- package/cli/dist/commands/sync.js +106 -0
- package/cli/dist/commands/sync.js.map +1 -0
- package/cli/dist/commands/update.d.ts.map +1 -1
- package/cli/dist/commands/update.js +132 -7
- package/cli/dist/commands/update.js.map +1 -1
- package/cli/dist/utils/auto-sync.d.ts +34 -0
- package/cli/dist/utils/auto-sync.d.ts.map +1 -0
- package/cli/dist/utils/auto-sync.js +172 -0
- package/cli/dist/utils/auto-sync.js.map +1 -0
- package/cli/dist/utils/beads-sync.d.ts +51 -0
- package/cli/dist/utils/beads-sync.d.ts.map +1 -0
- package/cli/dist/utils/beads-sync.js +171 -0
- package/cli/dist/utils/beads-sync.js.map +1 -0
- package/cli/dist/utils/coordination-queries.d.ts +79 -0
- package/cli/dist/utils/coordination-queries.d.ts.map +1 -0
- package/cli/dist/utils/coordination-queries.js +155 -0
- package/cli/dist/utils/coordination-queries.js.map +1 -0
- package/cli/dist/utils/file-tracking.d.ts +42 -0
- package/cli/dist/utils/file-tracking.d.ts.map +1 -0
- package/cli/dist/utils/file-tracking.js +155 -0
- package/cli/dist/utils/file-tracking.js.map +1 -0
- package/cli/dist/utils/migrate.d.ts +25 -0
- package/cli/dist/utils/migrate.d.ts.map +1 -0
- package/cli/dist/utils/migrate.js +204 -0
- package/cli/dist/utils/migrate.js.map +1 -0
- package/cli/dist/utils/openspec-sync.d.ts +48 -0
- package/cli/dist/utils/openspec-sync.d.ts.map +1 -0
- package/cli/dist/utils/openspec-sync.js +167 -0
- package/cli/dist/utils/openspec-sync.js.map +1 -0
- package/{MODULES.md → modules.md} +1 -1
- package/package.json +9 -7
- /package/{modules → augment-extensions}/coding-standards/typescript/README.md +0 -0
- /package/{modules → augment-extensions}/coding-standards/typescript/module.json +0 -0
- /package/{modules → augment-extensions}/coding-standards/typescript/rules/naming-conventions.md +0 -0
- /package/{modules → augment-extensions}/workflows/beads/README.md +0 -0
- /package/{modules → augment-extensions}/workflows/beads/module.json +0 -0
- /package/{modules → augment-extensions}/workflows/beads/rules/best-practices.md +0 -0
- /package/{modules → augment-extensions}/workflows/beads/rules/manual-setup.md +0 -0
- /package/{modules → augment-extensions}/workflows/openspec/README.md +0 -0
- /package/{modules → augment-extensions}/workflows/openspec/module.json +0 -0
- /package/{modules → augment-extensions}/workflows/openspec/rules/best-practices.md +0 -0
- /package/{modules → augment-extensions}/workflows/openspec/rules/manual-setup.md +0 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sync Commands
|
|
3
|
+
*
|
|
4
|
+
* Commands for syncing Beads and OpenSpec with coordination manifest:
|
|
5
|
+
* - augx sync beads
|
|
6
|
+
* - augx sync openspec
|
|
7
|
+
* - augx sync all
|
|
8
|
+
* - augx sync watch
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Sync Beads tasks to coordination manifest
|
|
12
|
+
*/
|
|
13
|
+
export declare function syncBeadsCommand(): void;
|
|
14
|
+
/**
|
|
15
|
+
* Sync OpenSpec specs to coordination manifest
|
|
16
|
+
*/
|
|
17
|
+
export declare function syncOpenSpecCommand(): void;
|
|
18
|
+
/**
|
|
19
|
+
* Sync both Beads and OpenSpec
|
|
20
|
+
*/
|
|
21
|
+
export declare function syncAllCommand(): void;
|
|
22
|
+
/**
|
|
23
|
+
* Watch for changes and auto-sync
|
|
24
|
+
*/
|
|
25
|
+
export declare function syncWatchCommand(): void;
|
|
26
|
+
//# sourceMappingURL=sync.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../src/commands/sync.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAavC;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAa1C;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAqBrC;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CA8BvC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Sync Commands
|
|
4
|
+
*
|
|
5
|
+
* Commands for syncing Beads and OpenSpec with coordination manifest:
|
|
6
|
+
* - augx sync beads
|
|
7
|
+
* - augx sync openspec
|
|
8
|
+
* - augx sync all
|
|
9
|
+
* - augx sync watch
|
|
10
|
+
*/
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.syncBeadsCommand = syncBeadsCommand;
|
|
16
|
+
exports.syncOpenSpecCommand = syncOpenSpecCommand;
|
|
17
|
+
exports.syncAllCommand = syncAllCommand;
|
|
18
|
+
exports.syncWatchCommand = syncWatchCommand;
|
|
19
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
20
|
+
const beads_sync_1 = require("../utils/beads-sync");
|
|
21
|
+
const openspec_sync_1 = require("../utils/openspec-sync");
|
|
22
|
+
const auto_sync_1 = require("../utils/auto-sync");
|
|
23
|
+
/**
|
|
24
|
+
* Sync Beads tasks to coordination manifest
|
|
25
|
+
*/
|
|
26
|
+
function syncBeadsCommand() {
|
|
27
|
+
try {
|
|
28
|
+
console.log(chalk_1.default.blue('Syncing Beads tasks to coordination manifest...'));
|
|
29
|
+
const stats = (0, beads_sync_1.syncBeadsToCoordination)();
|
|
30
|
+
console.log(chalk_1.default.green('✓ Beads sync complete:'));
|
|
31
|
+
console.log(chalk_1.default.gray(` Added: ${stats.added}`));
|
|
32
|
+
console.log(chalk_1.default.gray(` Updated: ${stats.updated}`));
|
|
33
|
+
console.log(chalk_1.default.gray(` Removed: ${stats.removed}`));
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
console.error(chalk_1.default.red('Error:'), error instanceof Error ? error.message : error);
|
|
37
|
+
process.exit(1);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Sync OpenSpec specs to coordination manifest
|
|
42
|
+
*/
|
|
43
|
+
function syncOpenSpecCommand() {
|
|
44
|
+
try {
|
|
45
|
+
console.log(chalk_1.default.blue('Syncing OpenSpec specs to coordination manifest...'));
|
|
46
|
+
const stats = (0, openspec_sync_1.syncOpenSpecToCoordination)();
|
|
47
|
+
console.log(chalk_1.default.green('✓ OpenSpec sync complete:'));
|
|
48
|
+
console.log(chalk_1.default.gray(` Added: ${stats.added}`));
|
|
49
|
+
console.log(chalk_1.default.gray(` Updated: ${stats.updated}`));
|
|
50
|
+
console.log(chalk_1.default.gray(` Removed: ${stats.removed}`));
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
console.error(chalk_1.default.red('Error:'), error instanceof Error ? error.message : error);
|
|
54
|
+
process.exit(1);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Sync both Beads and OpenSpec
|
|
59
|
+
*/
|
|
60
|
+
function syncAllCommand() {
|
|
61
|
+
try {
|
|
62
|
+
console.log(chalk_1.default.blue('Syncing all sources to coordination manifest...\n'));
|
|
63
|
+
// Sync Beads
|
|
64
|
+
console.log(chalk_1.default.blue('1. Syncing Beads tasks...'));
|
|
65
|
+
const beadsStats = (0, beads_sync_1.syncBeadsToCoordination)();
|
|
66
|
+
console.log(chalk_1.default.green('✓ Beads sync complete:'));
|
|
67
|
+
console.log(chalk_1.default.gray(` Added: ${beadsStats.added}, Updated: ${beadsStats.updated}, Removed: ${beadsStats.removed}\n`));
|
|
68
|
+
// Sync OpenSpec
|
|
69
|
+
console.log(chalk_1.default.blue('2. Syncing OpenSpec specs...'));
|
|
70
|
+
const openspecStats = (0, openspec_sync_1.syncOpenSpecToCoordination)();
|
|
71
|
+
console.log(chalk_1.default.green('✓ OpenSpec sync complete:'));
|
|
72
|
+
console.log(chalk_1.default.gray(` Added: ${openspecStats.added}, Updated: ${openspecStats.updated}, Removed: ${openspecStats.removed}\n`));
|
|
73
|
+
console.log(chalk_1.default.green.bold('✓ All syncs complete!'));
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
console.error(chalk_1.default.red('Error:'), error instanceof Error ? error.message : error);
|
|
77
|
+
process.exit(1);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Watch for changes and auto-sync
|
|
82
|
+
*/
|
|
83
|
+
function syncWatchCommand() {
|
|
84
|
+
try {
|
|
85
|
+
console.log(chalk_1.default.blue('Starting file watcher for auto-sync...'));
|
|
86
|
+
console.log(chalk_1.default.gray('Watching .beads/issues.jsonl and openspec/ for changes'));
|
|
87
|
+
console.log(chalk_1.default.gray('Press Ctrl+C to stop\n'));
|
|
88
|
+
const cleanup = (0, auto_sync_1.watchForChanges)('.beads/issues.jsonl', 'openspec', '.augment/coordination.json', (type, stats) => {
|
|
89
|
+
const timestamp = new Date().toLocaleTimeString();
|
|
90
|
+
console.log(chalk_1.default.cyan(`[${timestamp}] Synced ${type}:`), chalk_1.default.gray(`${stats.added} added, ${stats.updated} updated, ${stats.removed} removed`));
|
|
91
|
+
});
|
|
92
|
+
// Handle graceful shutdown
|
|
93
|
+
process.on('SIGINT', () => {
|
|
94
|
+
console.log(chalk_1.default.yellow('\n\nStopping file watcher...'));
|
|
95
|
+
cleanup();
|
|
96
|
+
process.exit(0);
|
|
97
|
+
});
|
|
98
|
+
// Keep process alive
|
|
99
|
+
process.stdin.resume();
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
console.error(chalk_1.default.red('Error:'), error instanceof Error ? error.message : error);
|
|
103
|
+
process.exit(1);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=sync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync.js","sourceRoot":"","sources":["../../src/commands/sync.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;;;AAUH,4CAaC;AAKD,kDAaC;AAKD,wCAqBC;AAKD,4CA8BC;AApGD,kDAA0B;AAC1B,oDAA8D;AAC9D,0DAAoE;AACpE,kDAAqD;AAErD;;GAEG;AACH,SAAgB,gBAAgB;IAC9B,IAAI,CAAC;QACH,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC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AAC,CAAC,CAAC;YAC1D,OAAO,EAAE,CAAC;YACV,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;QAEH,qBAAqB;QACrB,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;IACzB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,eAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QACnF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/commands/update.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/commands/update.ts"],"names":[],"mappings":"AAIA,UAAU,aAAa;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AASD,wBAAsB,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CA2DzE"}
|
|
@@ -1,19 +1,144 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
37
|
};
|
|
5
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
39
|
exports.updateCommand = updateCommand;
|
|
7
40
|
const chalk_1 = __importDefault(require("chalk"));
|
|
41
|
+
const fs = __importStar(require("fs"));
|
|
42
|
+
const path = __importStar(require("path"));
|
|
8
43
|
async function updateCommand(options) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
44
|
+
try {
|
|
45
|
+
console.log(chalk_1.default.blue('\n🔄 Updating modules...\n'));
|
|
46
|
+
// Load extensions config
|
|
47
|
+
const configPath = path.join(process.cwd(), '.augment', 'extensions.json');
|
|
48
|
+
if (!fs.existsSync(configPath)) {
|
|
49
|
+
console.error(chalk_1.default.red('Augment Extensions not initialized. Run: augx init'));
|
|
50
|
+
process.exit(1);
|
|
51
|
+
}
|
|
52
|
+
const config = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
|
|
53
|
+
if (!config.modules || config.modules.length === 0) {
|
|
54
|
+
console.log(chalk_1.default.yellow('No modules linked. Use "augx link <module>" to link modules.'));
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
const modulesToUpdate = options.module
|
|
58
|
+
? config.modules.filter((m) => m.name === options.module)
|
|
59
|
+
: config.modules;
|
|
60
|
+
if (modulesToUpdate.length === 0) {
|
|
61
|
+
console.error(chalk_1.default.red(`Module not found: ${options.module}`));
|
|
62
|
+
process.exit(1);
|
|
63
|
+
}
|
|
64
|
+
let updatedCount = 0;
|
|
65
|
+
let upToDateCount = 0;
|
|
66
|
+
let errorCount = 0;
|
|
67
|
+
for (const linkedModule of modulesToUpdate) {
|
|
68
|
+
const result = await updateModule(linkedModule, config);
|
|
69
|
+
if (result === 'updated') {
|
|
70
|
+
updatedCount++;
|
|
71
|
+
}
|
|
72
|
+
else if (result === 'up-to-date') {
|
|
73
|
+
upToDateCount++;
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
errorCount++;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
// Save updated config
|
|
80
|
+
fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
|
|
81
|
+
console.log(chalk_1.default.bold.green('\n✨ Update complete!\n'));
|
|
82
|
+
console.log(chalk_1.default.gray(`Updated: ${updatedCount}`));
|
|
83
|
+
console.log(chalk_1.default.gray(`Up to date: ${upToDateCount}`));
|
|
84
|
+
if (errorCount > 0) {
|
|
85
|
+
console.log(chalk_1.default.red(`Errors: ${errorCount}`));
|
|
86
|
+
}
|
|
87
|
+
console.log();
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
console.error(chalk_1.default.red('Error updating modules:'), error);
|
|
91
|
+
process.exit(1);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
async function updateModule(linkedModule, config) {
|
|
95
|
+
try {
|
|
96
|
+
const modulesDir = path.join(__dirname, '../../../augment-extensions');
|
|
97
|
+
const modulePath = path.join(modulesDir, linkedModule.name);
|
|
98
|
+
const moduleJsonPath = path.join(modulePath, 'module.json');
|
|
99
|
+
if (!fs.existsSync(moduleJsonPath)) {
|
|
100
|
+
console.log(chalk_1.default.red(`✗ ${linkedModule.name}: Module not found`));
|
|
101
|
+
return 'error';
|
|
102
|
+
}
|
|
103
|
+
const moduleData = JSON.parse(fs.readFileSync(moduleJsonPath, 'utf-8'));
|
|
104
|
+
const latestVersion = moduleData.version;
|
|
105
|
+
const currentVersion = linkedModule.version;
|
|
106
|
+
if (latestVersion === currentVersion) {
|
|
107
|
+
console.log(chalk_1.default.gray(`○ ${linkedModule.name}: Already up to date (v${currentVersion})`));
|
|
108
|
+
return 'up-to-date';
|
|
109
|
+
}
|
|
110
|
+
// Check if it's a newer version
|
|
111
|
+
if (compareVersions(latestVersion, currentVersion) > 0) {
|
|
112
|
+
// Update in config
|
|
113
|
+
const moduleIndex = config.modules.findIndex((m) => m.name === linkedModule.name);
|
|
114
|
+
if (moduleIndex >= 0) {
|
|
115
|
+
config.modules[moduleIndex].version = latestVersion;
|
|
116
|
+
config.modules[moduleIndex].description = moduleData.description;
|
|
117
|
+
}
|
|
118
|
+
console.log(chalk_1.default.green(`✓ ${linkedModule.name}: Updated ${currentVersion} → ${latestVersion}`));
|
|
119
|
+
return 'updated';
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
console.log(chalk_1.default.yellow(`⚠ ${linkedModule.name}: Current version (${currentVersion}) is newer than available (${latestVersion})`));
|
|
123
|
+
return 'up-to-date';
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
catch (error) {
|
|
127
|
+
console.log(chalk_1.default.red(`✗ ${linkedModule.name}: Error updating - ${error}`));
|
|
128
|
+
return 'error';
|
|
12
129
|
}
|
|
13
|
-
|
|
14
|
-
|
|
130
|
+
}
|
|
131
|
+
function compareVersions(v1, v2) {
|
|
132
|
+
const parts1 = v1.split('.').map(Number);
|
|
133
|
+
const parts2 = v2.split('.').map(Number);
|
|
134
|
+
for (let i = 0; i < Math.max(parts1.length, parts2.length); i++) {
|
|
135
|
+
const part1 = parts1[i] || 0;
|
|
136
|
+
const part2 = parts2[i] || 0;
|
|
137
|
+
if (part1 > part2)
|
|
138
|
+
return 1;
|
|
139
|
+
if (part1 < part2)
|
|
140
|
+
return -1;
|
|
15
141
|
}
|
|
16
|
-
|
|
17
|
-
console.log(chalk_1.default.yellow('Update functionality coming soon!'));
|
|
142
|
+
return 0;
|
|
18
143
|
}
|
|
19
144
|
//# sourceMappingURL=update.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../src/commands/update.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../src/commands/update.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,sCA2DC;AA1ED,kDAA0B;AAC1B,uCAAyB;AACzB,2CAA6B;AAatB,KAAK,UAAU,aAAa,CAAC,OAAsB;IACxD,IAAI,CAAC;QACH,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC,CAAC;QAEtD,yBAAyB;QACzB,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,UAAU,EAAE,iBAAiB,CAAC,CAAC;QAE3E,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YAC/B,OAAO,CAAC,KAAK,CAAC,eAAK,CAAC,GAAG,CAAC,oDAAoD,CAAC,CAAC,CAAC;YAC/E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QAED,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,EAA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K,CAAC,GAAG,CAAC,KAAK,YAAY,CAAC,IAAI,sBAAsB,KAAK,EAAE,CAAC,CAAC,CAAC;QAC5E,OAAO,OAAO,CAAC;IACjB,CAAC;AACH,CAAC;AAED,SAAS,eAAe,CAAC,EAAU,EAAE,EAAU;IAC7C,MAAM,MAAM,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACzC,MAAM,MAAM,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAEzC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAChE,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QAC7B,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QAE7B,IAAI,KAAK,GAAG,KAAK;YAAE,OAAO,CAAC,CAAC;QAC5B,IAAI,KAAK,GAAG,KAAK;YAAE,OAAO,CAAC,CAAC,CAAC;IAC/B,CAAC;IAED,OAAO,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-Sync on File Changes
|
|
3
|
+
*
|
|
4
|
+
* Automatically updates coordination manifest when files change.
|
|
5
|
+
* Uses file watcher with batched updates to avoid performance issues.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Batch file changes to avoid excessive writes
|
|
9
|
+
*/
|
|
10
|
+
declare class FileChangeBatcher {
|
|
11
|
+
private changes;
|
|
12
|
+
private timeout;
|
|
13
|
+
private batchDelay;
|
|
14
|
+
private manifestPath;
|
|
15
|
+
constructor(batchDelay?: number, manifestPath?: string);
|
|
16
|
+
/**
|
|
17
|
+
* Add a file change to the batch
|
|
18
|
+
*/
|
|
19
|
+
add(filePath: string, taskId: string, isNew: boolean): void;
|
|
20
|
+
/**
|
|
21
|
+
* Flush all pending changes
|
|
22
|
+
*/
|
|
23
|
+
flush(): void;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Watch for changes to Beads and OpenSpec files
|
|
27
|
+
*/
|
|
28
|
+
export declare function watchForChanges(beadsPath?: string, openspecDir?: string, manifestPath?: string, onSync?: (type: string, stats: any) => void): () => void;
|
|
29
|
+
/**
|
|
30
|
+
* Create a Git hook for auto-sync
|
|
31
|
+
*/
|
|
32
|
+
export declare function createGitHook(hookType?: 'pre-commit' | 'post-commit', gitDir?: string): void;
|
|
33
|
+
export { FileChangeBatcher };
|
|
34
|
+
//# sourceMappingURL=auto-sync.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auto-sync.d.ts","sourceRoot":"","sources":["../../src/utils/auto-sync.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAcH;;GAEG;AACH,cAAM,iBAAiB;IACrB,OAAO,CAAC,OAAO,CAAoB;IACnC,OAAO,CAAC,OAAO,CAA+B;IAC9C,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,YAAY,CAAS;gBAEjB,UAAU,GAAE,MAAa,EAAE,YAAY,GAAE,MAAqC;IAK1F;;OAEG;IACH,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI;IAc3D;;OAEG;IACH,KAAK,IAAI,IAAI;CAkBd;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,SAAS,GAAE,MAA8B,EACzC,WAAW,GAAE,MAAmB,EAChC,YAAY,GAAE,MAAqC,EACnD,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,GAC1C,MAAM,IAAI,CA6CZ;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,GAAE,YAAY,GAAG,aAA4B,EACrD,MAAM,GAAE,MAAe,GACtB,IAAI,CA0BN;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Auto-Sync on File Changes
|
|
4
|
+
*
|
|
5
|
+
* Automatically updates coordination manifest when files change.
|
|
6
|
+
* Uses file watcher with batched updates to avoid performance issues.
|
|
7
|
+
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
20
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
21
|
+
}) : function(o, v) {
|
|
22
|
+
o["default"] = v;
|
|
23
|
+
});
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.FileChangeBatcher = void 0;
|
|
43
|
+
exports.watchForChanges = watchForChanges;
|
|
44
|
+
exports.createGitHook = createGitHook;
|
|
45
|
+
const fs = __importStar(require("fs"));
|
|
46
|
+
const path = __importStar(require("path"));
|
|
47
|
+
const file_tracking_1 = require("./file-tracking");
|
|
48
|
+
const beads_sync_1 = require("./beads-sync");
|
|
49
|
+
const openspec_sync_1 = require("./openspec-sync");
|
|
50
|
+
/**
|
|
51
|
+
* Batch file changes to avoid excessive writes
|
|
52
|
+
*/
|
|
53
|
+
class FileChangeBatcher {
|
|
54
|
+
constructor(batchDelay = 1000, manifestPath = '.augment/coordination.json') {
|
|
55
|
+
this.changes = [];
|
|
56
|
+
this.timeout = null;
|
|
57
|
+
this.batchDelay = batchDelay;
|
|
58
|
+
this.manifestPath = manifestPath;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Add a file change to the batch
|
|
62
|
+
*/
|
|
63
|
+
add(filePath, taskId, isNew) {
|
|
64
|
+
this.changes.push({ filePath, taskId, isNew });
|
|
65
|
+
// Reset timeout
|
|
66
|
+
if (this.timeout) {
|
|
67
|
+
clearTimeout(this.timeout);
|
|
68
|
+
}
|
|
69
|
+
// Schedule batch processing
|
|
70
|
+
this.timeout = setTimeout(() => {
|
|
71
|
+
this.flush();
|
|
72
|
+
}, this.batchDelay);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Flush all pending changes
|
|
76
|
+
*/
|
|
77
|
+
flush() {
|
|
78
|
+
if (this.changes.length === 0) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
try {
|
|
82
|
+
(0, file_tracking_1.trackFileChanges)(this.changes, this.manifestPath);
|
|
83
|
+
console.log(`Synced ${this.changes.length} file changes to coordination manifest`);
|
|
84
|
+
this.changes = [];
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
console.error('Failed to sync file changes:', error);
|
|
88
|
+
}
|
|
89
|
+
if (this.timeout) {
|
|
90
|
+
clearTimeout(this.timeout);
|
|
91
|
+
this.timeout = null;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
exports.FileChangeBatcher = FileChangeBatcher;
|
|
96
|
+
/**
|
|
97
|
+
* Watch for changes to Beads and OpenSpec files
|
|
98
|
+
*/
|
|
99
|
+
function watchForChanges(beadsPath = '.beads/issues.jsonl', openspecDir = 'openspec', manifestPath = '.augment/coordination.json', onSync) {
|
|
100
|
+
const watchers = [];
|
|
101
|
+
// Watch Beads issues file
|
|
102
|
+
if (fs.existsSync(beadsPath)) {
|
|
103
|
+
const beadsWatcher = fs.watch(beadsPath, (eventType) => {
|
|
104
|
+
if (eventType === 'change') {
|
|
105
|
+
try {
|
|
106
|
+
const stats = (0, beads_sync_1.syncBeadsToCoordination)(beadsPath, manifestPath);
|
|
107
|
+
console.log(`Synced Beads: ${stats.added} added, ${stats.updated} updated, ${stats.removed} removed`);
|
|
108
|
+
if (onSync) {
|
|
109
|
+
onSync('beads', stats);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
catch (error) {
|
|
113
|
+
console.error('Failed to sync Beads:', error);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
watchers.push(beadsWatcher);
|
|
118
|
+
}
|
|
119
|
+
// Watch OpenSpec directory
|
|
120
|
+
if (fs.existsSync(openspecDir)) {
|
|
121
|
+
const openspecWatcher = fs.watch(openspecDir, { recursive: true }, (eventType, filename) => {
|
|
122
|
+
if (filename && filename.endsWith('.md')) {
|
|
123
|
+
try {
|
|
124
|
+
const stats = (0, openspec_sync_1.syncOpenSpecToCoordination)(openspecDir, manifestPath);
|
|
125
|
+
console.log(`Synced OpenSpec: ${stats.added} added, ${stats.updated} updated, ${stats.removed} removed`);
|
|
126
|
+
if (onSync) {
|
|
127
|
+
onSync('openspec', stats);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
catch (error) {
|
|
131
|
+
console.error('Failed to sync OpenSpec:', error);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
watchers.push(openspecWatcher);
|
|
136
|
+
}
|
|
137
|
+
// Return cleanup function
|
|
138
|
+
return () => {
|
|
139
|
+
for (const watcher of watchers) {
|
|
140
|
+
watcher.close();
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Create a Git hook for auto-sync
|
|
146
|
+
*/
|
|
147
|
+
function createGitHook(hookType = 'pre-commit', gitDir = '.git') {
|
|
148
|
+
const hookPath = path.join(gitDir, 'hooks', hookType);
|
|
149
|
+
const hookContent = `#!/bin/sh
|
|
150
|
+
# Auto-sync coordination manifest
|
|
151
|
+
|
|
152
|
+
# Sync Beads tasks
|
|
153
|
+
if [ -f .beads/issues.jsonl ]; then
|
|
154
|
+
echo "Syncing Beads tasks to coordination manifest..."
|
|
155
|
+
augx sync beads
|
|
156
|
+
fi
|
|
157
|
+
|
|
158
|
+
# Sync OpenSpec specs
|
|
159
|
+
if [ -d openspec ]; then
|
|
160
|
+
echo "Syncing OpenSpec specs to coordination manifest..."
|
|
161
|
+
augx sync openspec
|
|
162
|
+
fi
|
|
163
|
+
|
|
164
|
+
# Add coordination manifest to commit if changed
|
|
165
|
+
if [ -f .augment/coordination.json ]; then
|
|
166
|
+
git add .augment/coordination.json
|
|
167
|
+
fi
|
|
168
|
+
`;
|
|
169
|
+
fs.writeFileSync(hookPath, hookContent, { mode: 0o755 });
|
|
170
|
+
console.log(`Created ${hookType} hook at ${hookPath}`);
|
|
171
|
+
}
|
|
172
|
+
//# sourceMappingUR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CAAC,aAAa,CAAC,QAAQ,EAAE,WAAW,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IACzD,OAAO,CAAC,GAAG,CAAC,WAAW,QAAQ,YAAY,QAAQ,EAAE,CAAC,CAAC;AACzD,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Beads ↔ Coordination Sync Utility
|
|
3
|
+
*
|
|
4
|
+
* Syncs Beads tasks with the coordination manifest.
|
|
5
|
+
* Handles task status changes, creation, and deletion.
|
|
6
|
+
*/
|
|
7
|
+
interface BeadsTask {
|
|
8
|
+
id: string;
|
|
9
|
+
title: string;
|
|
10
|
+
status: string;
|
|
11
|
+
priority?: number;
|
|
12
|
+
description?: string;
|
|
13
|
+
labels?: string[];
|
|
14
|
+
spec?: string;
|
|
15
|
+
rules?: string[];
|
|
16
|
+
blocks?: string[];
|
|
17
|
+
blocked_by?: string[];
|
|
18
|
+
created?: string;
|
|
19
|
+
updated?: string;
|
|
20
|
+
closed?: string;
|
|
21
|
+
}
|
|
22
|
+
interface CoordinationManifest {
|
|
23
|
+
version: string;
|
|
24
|
+
lastUpdated: string;
|
|
25
|
+
specs: Record<string, any>;
|
|
26
|
+
tasks: Record<string, any>;
|
|
27
|
+
rules: Record<string, any>;
|
|
28
|
+
files: Record<string, any>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Read all tasks from .beads/issues.jsonl
|
|
32
|
+
*/
|
|
33
|
+
export declare function readBeadsTasks(beadsPath?: string): BeadsTask[];
|
|
34
|
+
/**
|
|
35
|
+
* Read coordination manifest
|
|
36
|
+
*/
|
|
37
|
+
export declare function readCoordinationManifest(manifestPath?: string): CoordinationManifest;
|
|
38
|
+
/**
|
|
39
|
+
* Write coordination manifest
|
|
40
|
+
*/
|
|
41
|
+
export declare function writeCoordinationManifest(manifest: CoordinationManifest, manifestPath?: string): void;
|
|
42
|
+
/**
|
|
43
|
+
* Sync Beads tasks to coordination manifest
|
|
44
|
+
*/
|
|
45
|
+
export declare function syncBeadsToCoordination(beadsPath?: string, manifestPath?: string): {
|
|
46
|
+
added: number;
|
|
47
|
+
updated: number;
|
|
48
|
+
removed: number;
|
|
49
|
+
};
|
|
50
|
+
export {};
|
|
51
|
+
//# sourceMappingURL=beads-sync.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"beads-sync.d.ts","sourceRoot":"","sources":["../../src/utils/beads-sync.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,UAAU,SAAS;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,oBAAoB;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC5B;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,SAAS,GAAE,MAA8B,GAAG,SAAS,EAAE,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