gg-deploy 1.0.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/.env.example +7 -0
- package/LICENSE +661 -0
- package/README.md +251 -0
- package/config.sample.json +10 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +124 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/apply.d.ts +3 -0
- package/dist/commands/apply.d.ts.map +1 -0
- package/dist/commands/apply.js +81 -0
- package/dist/commands/apply.js.map +1 -0
- package/dist/commands/plan.d.ts +3 -0
- package/dist/commands/plan.d.ts.map +1 -0
- package/dist/commands/plan.js +105 -0
- package/dist/commands/plan.js.map +1 -0
- package/dist/commands/status.d.ts +3 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +79 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/config.d.ts +33 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +87 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp-server.d.ts +4 -0
- package/dist/mcp-server.d.ts.map +1 -0
- package/dist/mcp-server.js +96 -0
- package/dist/mcp-server.js.map +1 -0
- package/dist/services/github.d.ts +18 -0
- package/dist/services/github.d.ts.map +1 -0
- package/dist/services/github.js +123 -0
- package/dist/services/github.js.map +1 -0
- package/dist/services/godaddy.d.ts +16 -0
- package/dist/services/godaddy.d.ts.map +1 -0
- package/dist/services/godaddy.js +69 -0
- package/dist/services/godaddy.js.map +1 -0
- package/dist/types.d.ts +52 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/ui-server.d.ts +2 -0
- package/dist/ui-server.d.ts.map +1 -0
- package/dist/ui-server.js +223 -0
- package/dist/ui-server.js.map +1 -0
- package/package.json +72 -0
- package/tsconfig.json +20 -0
- package/ui/dist/assets/index-DWy6cIAN.js +41 -0
- package/ui/dist/assets/index-DuQvusTC.css +1 -0
- package/ui/dist/index.html +16 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import { GoDaddyService } from '../services/godaddy.js';
|
|
3
|
+
import { GitHubService } from '../services/github.js';
|
|
4
|
+
export async function statusCommand(domain, repo, output) {
|
|
5
|
+
const result = {
|
|
6
|
+
status: 'success',
|
|
7
|
+
completed_steps: [],
|
|
8
|
+
failed_steps: [],
|
|
9
|
+
resources_created: [],
|
|
10
|
+
resources_modified: [],
|
|
11
|
+
next_action: null,
|
|
12
|
+
estimated_wait_seconds: null,
|
|
13
|
+
rollback_available: false,
|
|
14
|
+
};
|
|
15
|
+
const status = {
|
|
16
|
+
domain,
|
|
17
|
+
dns_configured: false,
|
|
18
|
+
dns_records: [],
|
|
19
|
+
github_pages_enabled: false,
|
|
20
|
+
github_pages_url: null,
|
|
21
|
+
ssl_status: 'unknown',
|
|
22
|
+
health: 'error',
|
|
23
|
+
};
|
|
24
|
+
try {
|
|
25
|
+
const godaddy = new GoDaddyService();
|
|
26
|
+
const github = new GitHubService();
|
|
27
|
+
const records = await godaddy.getDNSRecords(domain);
|
|
28
|
+
status.dns_records = records.filter((r) => r.type === 'A' || (r.type === 'CNAME' && r.name === 'www'));
|
|
29
|
+
const hasGitHubA = records.some((r) => r.type === 'A' && r.data.startsWith('185.199.'));
|
|
30
|
+
const hasGitHubCname = records.some((r) => r.type === 'CNAME' && r.data.includes('.github.io'));
|
|
31
|
+
status.dns_configured = hasGitHubA && hasGitHubCname;
|
|
32
|
+
result.completed_steps.push('check_dns');
|
|
33
|
+
const pages = await github.getPagesStatus(repo);
|
|
34
|
+
if (pages) {
|
|
35
|
+
status.github_pages_enabled = true;
|
|
36
|
+
status.github_pages_url = pages.url;
|
|
37
|
+
status.ssl_status = pages.https_enforced ? 'active' : 'pending';
|
|
38
|
+
}
|
|
39
|
+
result.completed_steps.push('check_github');
|
|
40
|
+
if (status.dns_configured && status.github_pages_enabled) {
|
|
41
|
+
status.health = status.ssl_status === 'active' ? 'healthy' : 'degraded';
|
|
42
|
+
}
|
|
43
|
+
else if (status.dns_configured || status.github_pages_enabled) {
|
|
44
|
+
status.health = 'degraded';
|
|
45
|
+
}
|
|
46
|
+
if (output === 'human') {
|
|
47
|
+
console.log(chalk.blue('\n=== Status ===\n'));
|
|
48
|
+
console.log(`Domain: ${chalk.cyan(domain)}`);
|
|
49
|
+
console.log(`Repo: ${chalk.cyan(repo)}\n`);
|
|
50
|
+
const dnsIcon = status.dns_configured ? chalk.green('OK') : chalk.red('X');
|
|
51
|
+
const ghIcon = status.github_pages_enabled ? chalk.green('OK') : chalk.red('X');
|
|
52
|
+
const sslIcon = status.ssl_status === 'active' ? chalk.green('OK') :
|
|
53
|
+
status.ssl_status === 'pending' ? chalk.yellow('PENDING') : chalk.red('X');
|
|
54
|
+
console.log(`DNS: [${dnsIcon}] ${status.dns_configured ? 'Configured' : 'Not configured'}`);
|
|
55
|
+
console.log(`Pages: [${ghIcon}] ${status.github_pages_enabled ? 'Enabled' : 'Not enabled'}`);
|
|
56
|
+
console.log(`SSL: [${sslIcon}] ${status.ssl_status}`);
|
|
57
|
+
console.log('');
|
|
58
|
+
const healthColor = status.health === 'healthy' ? chalk.green :
|
|
59
|
+
status.health === 'degraded' ? chalk.yellow : chalk.red;
|
|
60
|
+
console.log(`Health: ${healthColor(status.health.toUpperCase())}`);
|
|
61
|
+
if (status.github_pages_url) {
|
|
62
|
+
console.log(`\nURL: ${chalk.cyan(status.github_pages_url)}`);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
console.log(JSON.stringify({ ...result, status }, null, 2));
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
catch (e) {
|
|
70
|
+
result.status = 'failure';
|
|
71
|
+
result.failed_steps.push({
|
|
72
|
+
step: 'status',
|
|
73
|
+
error: e instanceof Error ? e.message : String(e),
|
|
74
|
+
retriable: true,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
return result;
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,MAAc,EACd,IAAY,EACZ,MAAoB;IAEpB,MAAM,MAAM,GAAkB;QAC5B,MAAM,EAAE,SAAS;QACjB,eAAe,EAAE,EAAE;QACnB,YAAY,EAAE,EAAE;QAChB,iBAAiB,EAAE,EAAE;QACrB,kBAAkB,EAAE,EAAE;QACtB,WAAW,EAAE,IAAI;QACjB,sBAAsB,EAAE,IAAI;QAC5B,kBAAkB,EAAE,KAAK;KAC1B,CAAC;IAEF,MAAM,MAAM,GAAiB;QAC3B,MAAM;QACN,cAAc,EAAE,KAAK;QACrB,WAAW,EAAE,EAAE;QACf,oBAAoB,EAAE,KAAK;QAC3B,gBAAgB,EAAE,IAAI;QACtB,UAAU,EAAE,SAAS;QACrB,MAAM,EAAE,OAAO;KAChB,CAAC;IAEF,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,IAAI,cAAc,EAAE,CAAC;QACrC,MAAM,MAAM,GAAG,IAAI,aAAa,EAAE,CAAC;QAEnC,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QACpD,MAAM,CAAC,WAAW,GAAG,OAAO,CAAC,MAAM,CACjC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,KAAK,OAA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+
}
|
|
6
|
+
export interface GitHubConfig {
|
|
7
|
+
token: string;
|
|
8
|
+
}
|
|
9
|
+
export interface AppConfig {
|
|
10
|
+
godaddy?: GoDaddyConfig;
|
|
11
|
+
github?: GitHubConfig;
|
|
12
|
+
}
|
|
13
|
+
export declare function getConfigPath(): string;
|
|
14
|
+
export declare function ensureConfigDir(): void;
|
|
15
|
+
export declare function readConfig(): AppConfig;
|
|
16
|
+
export declare function writeConfig(config: AppConfig): void;
|
|
17
|
+
export declare function getGoDaddyConfig(): GoDaddyConfig | null;
|
|
18
|
+
export declare function getGitHubConfig(): GitHubConfig | null;
|
|
19
|
+
export declare function saveGoDaddyConfig(apiKey: string, apiSecret: string, environment?: 'production' | 'ote'): void;
|
|
20
|
+
export declare function saveGitHubConfig(token: string): void;
|
|
21
|
+
export declare function clearConfig(): void;
|
|
22
|
+
export interface AuthStatus {
|
|
23
|
+
godaddy: {
|
|
24
|
+
configured: boolean;
|
|
25
|
+
keyPreview?: string;
|
|
26
|
+
};
|
|
27
|
+
github: {
|
|
28
|
+
configured: boolean;
|
|
29
|
+
tokenPreview?: string;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export declare function getAuthStatus(): AuthStatus;
|
|
33
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,YAAY,GAAG,KAAK,CAAC;CACnC;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,SAAS;IACxB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB;AAKD,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED,wBAAgB,eAAe,IAAI,IAAI,CAItC;AAED,wBAAgB,UAAU,IAAI,SAAS,CAUtC;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAQnD;AAED,wBAAgB,gBAAgB,IAAI,aAAa,GAAG,IAAI,CAgBvD;AAED,wBAAgB,eAAe,IAAI,YAAY,GAAG,IAAI,CAMrD;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,GAAE,YAAY,GAAG,KAAoB,GAAG,IAAI,CAI3H;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAIpD;AAED,wBAAgB,WAAW,IAAI,IAAI,CAElC;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE;QACP,UAAU,EAAE,OAAO,CAAC;QACpB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;IACF,MAAM,EAAE;QACN,UAAU,EAAE,OAAO,CAAC;QACpB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;CACH;AAED,wBAAgB,aAAa,IAAI,UAAU,CAc1C"}
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync, chmodSync } from 'fs';
|
|
2
|
+
import { join } from 'path';
|
|
3
|
+
import { homedir } from 'os';
|
|
4
|
+
const CONFIG_DIR = join(homedir(), '.gg-deploy');
|
|
5
|
+
const CONFIG_FILE = join(CONFIG_DIR, 'config.json');
|
|
6
|
+
export function getConfigPath() {
|
|
7
|
+
return CONFIG_FILE;
|
|
8
|
+
}
|
|
9
|
+
export function ensureConfigDir() {
|
|
10
|
+
if (!existsSync(CONFIG_DIR)) {
|
|
11
|
+
mkdirSync(CONFIG_DIR, { recursive: true, mode: 0o700 });
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export function readConfig() {
|
|
15
|
+
if (!existsSync(CONFIG_FILE)) {
|
|
16
|
+
return {};
|
|
17
|
+
}
|
|
18
|
+
try {
|
|
19
|
+
const content = readFileSync(CONFIG_FILE, 'utf-8');
|
|
20
|
+
return JSON.parse(content);
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
return {};
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export function writeConfig(config) {
|
|
27
|
+
ensureConfigDir();
|
|
28
|
+
writeFileSync(CONFIG_FILE, JSON.stringify(config, null, 2), { mode: 0o600 });
|
|
29
|
+
try {
|
|
30
|
+
chmodSync(CONFIG_FILE, 0o600);
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
// Ignore chmod errors on Windows
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export function getGoDaddyConfig() {
|
|
37
|
+
const config = readConfig();
|
|
38
|
+
if (config.godaddy?.apiKey && config.godaddy?.apiSecret) {
|
|
39
|
+
return config.godaddy;
|
|
40
|
+
}
|
|
41
|
+
// Fall back to environment variables
|
|
42
|
+
const apiKey = process.env.GODADDY_API_KEY;
|
|
43
|
+
const apiSecret = process.env.GODADDY_API_SECRET;
|
|
44
|
+
if (apiKey && apiSecret) {
|
|
45
|
+
return {
|
|
46
|
+
apiKey,
|
|
47
|
+
apiSecret,
|
|
48
|
+
environment: 'production',
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
export function getGitHubConfig() {
|
|
54
|
+
const config = readConfig();
|
|
55
|
+
if (config.github?.token) {
|
|
56
|
+
return config.github;
|
|
57
|
+
}
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
export function saveGoDaddyConfig(apiKey, apiSecret, environment = 'production') {
|
|
61
|
+
const config = readConfig();
|
|
62
|
+
config.godaddy = { apiKey, apiSecret, environment };
|
|
63
|
+
writeConfig(config);
|
|
64
|
+
}
|
|
65
|
+
export function saveGitHubConfig(token) {
|
|
66
|
+
const config = readConfig();
|
|
67
|
+
config.github = { token };
|
|
68
|
+
writeConfig(config);
|
|
69
|
+
}
|
|
70
|
+
export function clearConfig() {
|
|
71
|
+
writeConfig({});
|
|
72
|
+
}
|
|
73
|
+
export function getAuthStatus() {
|
|
74
|
+
const godaddy = getGoDaddyConfig();
|
|
75
|
+
const github = getGitHubConfig();
|
|
76
|
+
return {
|
|
77
|
+
godaddy: {
|
|
78
|
+
configured: !!godaddy,
|
|
79
|
+
keyPreview: godaddy ? `${godaddy.apiKey.slice(0, 4)}...${godaddy.apiKey.slice(-4)}` : undefined,
|
|
80
|
+
},
|
|
81
|
+
github: {
|
|
82
|
+
configured: !!github,
|
|
83
|
+
tokenPreview: github ? `${github.token.slice(0, 4)}...${github.token.slice(-4)}` : undefined,
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AACnF,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAiB7B,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,YAAY,CAAC,CAAC;AACjD,MAAM,WAAW,GAAG,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;AAEpD,MAAM,UAAU,aAAa;IAC3B,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,MAAM,UAAU,eAAe;IAC7B,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC5B,SAAS,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IAC1D,CAAC;AACH,CAAC;AAED,MAA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C,CAAC,CAAC,SAAS;SAC7F;KACF,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { planCommand } from './commands/plan.js';
|
|
2
|
+
export { applyCommand } from './commands/apply.js';
|
|
3
|
+
export { statusCommand } from './commands/status.js';
|
|
4
|
+
export { GoDaddyService } from './services/godaddy.js';
|
|
5
|
+
export { GitHubService } from './services/github.js';
|
|
6
|
+
export * from './types.js';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,cAAc,YAAY,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { planCommand } from './commands/plan.js';
|
|
2
|
+
export { applyCommand } from './commands/apply.js';
|
|
3
|
+
export { statusCommand } from './commands/status.js';
|
|
4
|
+
export { GoDaddyService } from './services/godaddy.js';
|
|
5
|
+
export { GitHubService } from './services/github.js';
|
|
6
|
+
export * from './types.js';
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-server.d.ts","sourceRoot":"","sources":["../src/mcp-server.ts"],"names":[],"mappings":";AACA,OAAO,eAAe,CAAC;AAkGvB,wBAAsB,cAAc,kBAGnC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import 'dotenv/config';
|
|
3
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
4
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
5
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
6
|
+
import { planCommand } from './commands/plan.js';
|
|
7
|
+
import { applyCommand } from './commands/apply.js';
|
|
8
|
+
import { statusCommand } from './commands/status.js';
|
|
9
|
+
const server = new Server({ name: 'gg-deploy', version: '0.1.0' }, { capabilities: { tools: {} } });
|
|
10
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
11
|
+
tools: [
|
|
12
|
+
{
|
|
13
|
+
name: 'deploy_site_plan',
|
|
14
|
+
description: 'Preview GoDaddy DNS + GitHub Pages deployment without making changes. Safe to call anytime.',
|
|
15
|
+
inputSchema: {
|
|
16
|
+
type: 'object',
|
|
17
|
+
properties: {
|
|
18
|
+
domain: { type: 'string', description: 'Domain name (e.g., example.com)' },
|
|
19
|
+
repo: { type: 'string', description: 'GitHub repo (e.g., user/repo)' },
|
|
20
|
+
},
|
|
21
|
+
required: ['domain', 'repo'],
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: 'deploy_site_apply',
|
|
26
|
+
description: 'Execute GoDaddy DNS + GitHub Pages deployment. Configures DNS A records, CNAME, and enables GitHub Pages with custom domain.',
|
|
27
|
+
inputSchema: {
|
|
28
|
+
type: 'object',
|
|
29
|
+
properties: {
|
|
30
|
+
domain: { type: 'string', description: 'Domain name (e.g., example.com)' },
|
|
31
|
+
repo: { type: 'string', description: 'GitHub repo (e.g., user/repo)' },
|
|
32
|
+
},
|
|
33
|
+
required: ['domain', 'repo'],
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: 'deploy_site_status',
|
|
38
|
+
description: 'Check deployment health: DNS configuration, GitHub Pages status, SSL certificate state. Safe to call anytime.',
|
|
39
|
+
inputSchema: {
|
|
40
|
+
type: 'object',
|
|
41
|
+
properties: {
|
|
42
|
+
domain: { type: 'string', description: 'Domain name (e.g., example.com)' },
|
|
43
|
+
repo: { type: 'string', description: 'GitHub repo (e.g., user/repo)' },
|
|
44
|
+
},
|
|
45
|
+
required: ['domain', 'repo'],
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
}));
|
|
50
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
51
|
+
const { name, arguments: args } = request.params;
|
|
52
|
+
const domain = args?.domain;
|
|
53
|
+
const repo = args?.repo;
|
|
54
|
+
if (!domain || !repo) {
|
|
55
|
+
return {
|
|
56
|
+
content: [{ type: 'text', text: JSON.stringify({ error: 'domain and repo are required' }) }],
|
|
57
|
+
isError: true,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
try {
|
|
61
|
+
let result;
|
|
62
|
+
switch (name) {
|
|
63
|
+
case 'deploy_site_plan':
|
|
64
|
+
result = await planCommand(domain, repo, 'json');
|
|
65
|
+
break;
|
|
66
|
+
case 'deploy_site_apply':
|
|
67
|
+
result = await applyCommand(domain, repo, 'json');
|
|
68
|
+
break;
|
|
69
|
+
case 'deploy_site_status':
|
|
70
|
+
result = await statusCommand(domain, repo, 'json');
|
|
71
|
+
break;
|
|
72
|
+
default:
|
|
73
|
+
return {
|
|
74
|
+
content: [{ type: 'text', text: JSON.stringify({ error: `Unknown tool: ${name}` }) }],
|
|
75
|
+
isError: true,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
return {
|
|
84
|
+
content: [{ type: 'text', text: JSON.stringify({ error: String(error) }) }],
|
|
85
|
+
isError: true,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
export async function startMcpServer() {
|
|
90
|
+
const transport = new StdioServerTransport();
|
|
91
|
+
await server.connect(transport);
|
|
92
|
+
}
|
|
93
|
+
if (process.argv[1]?.endsWith('mcp-server.js') || process.argv[1]?.endsWith('mcp-server.ts')) {
|
|
94
|
+
startMcpServer().catch(console.error);
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=mcp-server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-server.js","sourceRoot":"","sources":["../src/mcp-server.ts"],"names":[],"mappings":";AACA,OAAO,eAAe,CAAC;AACvB,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,MAAM,MAAM,GAAG,IAAI,MAAM,CACvB,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,EACvC,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,CAChC,CAAC;AAEF,MAAM,CAAC,iBAAiB,CAAC,sBAAsB,E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L,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC;YAC3E,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,KAAK,UAAU,cAAc;IAClC,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC;AAED,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,eAAe,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC;IAC7F,cAAc,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AACxC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare class GitHubService {
|
|
2
|
+
private token;
|
|
3
|
+
private getToken;
|
|
4
|
+
private api;
|
|
5
|
+
enablePages(repo: string, branch?: string, path?: string): Promise<void>;
|
|
6
|
+
setCustomDomain(repo: string, domain: string): Promise<void>;
|
|
7
|
+
enableHttps(repo: string): Promise<void>;
|
|
8
|
+
getPagesStatus(repo: string): Promise<{
|
|
9
|
+
url: string | null;
|
|
10
|
+
status: string;
|
|
11
|
+
cname: string | null;
|
|
12
|
+
https_enforced: boolean;
|
|
13
|
+
} | null>;
|
|
14
|
+
addCnameFile(repo: string, domain: string): Promise<void>;
|
|
15
|
+
verifyRepo(repo: string): Promise<boolean>;
|
|
16
|
+
isRepoPublic(repo: string): Promise<boolean>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=github.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../../src/services/github.ts"],"names":[],"mappings":"AAKA,qBAAa,aAAa;IACxB,OAAO,CAAC,KAAK,CAAuB;IAEpC,OAAO,CAAC,QAAQ;YAkBF,GAAG;IAsBX,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,SAAS,EAAE,IAAI,SAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAcrE,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAO5D,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAOxC,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;QAC1C,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;QACnB,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;QACrB,cAAc,EAAE,OAAO,CAAC;KACzB,GAAG,IAAI,CAAC;IAQH,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA2BzD,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAS1C,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAQnD"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { execSync } from 'child_process';
|
|
2
|
+
import { getGitHubConfig } from '../config.js';
|
|
3
|
+
const GITHUB_API = 'https://api.github.com';
|
|
4
|
+
export class GitHubService {
|
|
5
|
+
token = null;
|
|
6
|
+
getToken() {
|
|
7
|
+
if (this.token)
|
|
8
|
+
return this.token;
|
|
9
|
+
const config = getGitHubConfig();
|
|
10
|
+
if (config?.token) {
|
|
11
|
+
this.token = config.token;
|
|
12
|
+
return this.token;
|
|
13
|
+
}
|
|
14
|
+
// Fall back to gh CLI token
|
|
15
|
+
try {
|
|
16
|
+
this.token = execSync('gh auth token', { encoding: 'utf-8' }).trim();
|
|
17
|
+
return this.token;
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
throw new Error('GitHub not configured. Add token in settings or run: gh auth login');
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
async api(endpoint, options = {}) {
|
|
24
|
+
const token = this.getToken();
|
|
25
|
+
const res = await fetch(`${GITHUB_API}${endpoint}`, {
|
|
26
|
+
...options,
|
|
27
|
+
headers: {
|
|
28
|
+
'Authorization': `Bearer ${token}`,
|
|
29
|
+
'Accept': 'application/vnd.github+json',
|
|
30
|
+
'X-GitHub-Api-Version': '2022-11-28',
|
|
31
|
+
'Content-Type': 'application/json',
|
|
32
|
+
...options.headers,
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
if (!res.ok) {
|
|
36
|
+
const error = await res.text();
|
|
37
|
+
throw new Error(`GitHub API error: ${res.status} ${error}`);
|
|
38
|
+
}
|
|
39
|
+
const text = await res.text();
|
|
40
|
+
return text ? JSON.parse(text) : {};
|
|
41
|
+
}
|
|
42
|
+
async enablePages(repo, branch = 'main', path = '/') {
|
|
43
|
+
try {
|
|
44
|
+
await this.api(`/repos/${repo}/pages`, {
|
|
45
|
+
method: 'POST',
|
|
46
|
+
body: JSON.stringify({
|
|
47
|
+
source: { branch, path },
|
|
48
|
+
}),
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
catch (e) {
|
|
52
|
+
const msg = String(e);
|
|
53
|
+
if (!msg.includes('already enabled') && !msg.includes('409') && !msg.includes('422'))
|
|
54
|
+
throw e;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
async setCustomDomain(repo, domain) {
|
|
58
|
+
await this.api(`/repos/${repo}/pages`, {
|
|
59
|
+
method: 'PUT',
|
|
60
|
+
body: JSON.stringify({ cname: domain }),
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
async enableHttps(repo) {
|
|
64
|
+
await this.api(`/repos/${repo}/pages`, {
|
|
65
|
+
method: 'PUT',
|
|
66
|
+
body: JSON.stringify({ https_enforced: true }),
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
async getPagesStatus(repo) {
|
|
70
|
+
try {
|
|
71
|
+
return await this.api(`/repos/${repo}/pages`);
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
async addCnameFile(repo, domain) {
|
|
78
|
+
const content = Buffer.from(domain).toString('base64');
|
|
79
|
+
// Check if CNAME already exists
|
|
80
|
+
let sha;
|
|
81
|
+
try {
|
|
82
|
+
const existing = await this.api(`/repos/${repo}/contents/CNAME`);
|
|
83
|
+
sha = existing.sha;
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
// File doesn't exist, that's fine
|
|
87
|
+
}
|
|
88
|
+
try {
|
|
89
|
+
await this.api(`/repos/${repo}/contents/CNAME`, {
|
|
90
|
+
method: 'PUT',
|
|
91
|
+
body: JSON.stringify({
|
|
92
|
+
message: `Add custom domain: ${domain}`,
|
|
93
|
+
content,
|
|
94
|
+
...(sha ? { sha } : {}),
|
|
95
|
+
}),
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
catch (e) {
|
|
99
|
+
const msg = String(e);
|
|
100
|
+
if (!msg.includes('sha') && !msg.includes('already exists'))
|
|
101
|
+
throw e;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
async verifyRepo(repo) {
|
|
105
|
+
try {
|
|
106
|
+
await this.api(`/repos/${repo}`);
|
|
107
|
+
return true;
|
|
108
|
+
}
|
|
109
|
+
catch {
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
async isRepoPublic(repo) {
|
|
114
|
+
try {
|
|
115
|
+
const result = await this.api(`/repos/${repo}`);
|
|
116
|
+
return !result.private;
|
|
117
|
+
}
|
|
118
|
+
catch {
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+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AC,EAAE,CAAC;YACX,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;YACtB,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,gBAAgB,CAAC;gBAAE,MAAM,CAAC,CAAC;QACvE,CAAC;IACH,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,IAAY;QAC3B,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,GAAG,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC;YACjC,OAAO,IAAI,CAAC;QACd,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,IAAY;QAC7B,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,GAAG,CAAuB,UAAU,IAAI,EAAE,CAAC,CAAC;YACtE,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC;QACzB,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { DNSRecord } from '../types.js';
|
|
2
|
+
export declare class GoDaddyService {
|
|
3
|
+
private apiKey;
|
|
4
|
+
private apiSecret;
|
|
5
|
+
private apiBase;
|
|
6
|
+
constructor();
|
|
7
|
+
private get headers();
|
|
8
|
+
listDomains(): Promise<Array<{
|
|
9
|
+
domain: string;
|
|
10
|
+
status: string;
|
|
11
|
+
}>>;
|
|
12
|
+
getDNSRecords(domain: string): Promise<DNSRecord[]>;
|
|
13
|
+
setGitHubPagesRecords(domain: string, githubUser: string): Promise<void>;
|
|
14
|
+
verifyDomain(domain: string): Promise<boolean>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=godaddy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"godaddy.d.ts","sourceRoot":"","sources":["../../src/services/godaddy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAM7C,qBAAa,cAAc;IACzB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,OAAO,CAAS;;IAYxB,OAAO,KAAK,OAAO,GAKlB;IAEK,WAAW,IAAI,OAAO,CAAC,KAAK,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAMjE,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IAQnD,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAuBxE,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAQrD"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { getGoDaddyConfig } from '../config.js';
|
|
2
|
+
const API_BASE_PROD = 'https://api.godaddy.com/v1';
|
|
3
|
+
const API_BASE_OTE = 'https://api.ote-godaddy.com/v1';
|
|
4
|
+
export class GoDaddyService {
|
|
5
|
+
apiKey;
|
|
6
|
+
apiSecret;
|
|
7
|
+
apiBase;
|
|
8
|
+
constructor() {
|
|
9
|
+
const config = getGoDaddyConfig();
|
|
10
|
+
if (!config) {
|
|
11
|
+
throw new Error('GoDaddy not configured. Add API credentials in settings.');
|
|
12
|
+
}
|
|
13
|
+
this.apiKey = config.apiKey;
|
|
14
|
+
this.apiSecret = config.apiSecret;
|
|
15
|
+
this.apiBase = config.environment === 'ote' ? API_BASE_OTE : API_BASE_PROD;
|
|
16
|
+
}
|
|
17
|
+
get headers() {
|
|
18
|
+
return {
|
|
19
|
+
Authorization: `sso-key ${this.apiKey}:${this.apiSecret}`,
|
|
20
|
+
'Content-Type': 'application/json',
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
async listDomains() {
|
|
24
|
+
const res = await fetch(`${this.apiBase}/domains`, { headers: this.headers });
|
|
25
|
+
if (!res.ok)
|
|
26
|
+
throw new Error(`GoDaddy API error: ${res.status}`);
|
|
27
|
+
return res.json();
|
|
28
|
+
}
|
|
29
|
+
async getDNSRecords(domain) {
|
|
30
|
+
const res = await fetch(`${this.apiBase}/domains/${domain}/records`, {
|
|
31
|
+
headers: this.headers,
|
|
32
|
+
});
|
|
33
|
+
if (!res.ok)
|
|
34
|
+
throw new Error(`GoDaddy API error: ${res.status}`);
|
|
35
|
+
return res.json();
|
|
36
|
+
}
|
|
37
|
+
async setGitHubPagesRecords(domain, githubUser) {
|
|
38
|
+
const aRecords = [
|
|
39
|
+
{ data: '185.199.108.153', ttl: 600 },
|
|
40
|
+
{ data: '185.199.109.153', ttl: 600 },
|
|
41
|
+
{ data: '185.199.110.153', ttl: 600 },
|
|
42
|
+
{ data: '185.199.111.153', ttl: 600 },
|
|
43
|
+
];
|
|
44
|
+
const aRes = await fetch(`${this.apiBase}/domains/${domain}/records/A/@`, {
|
|
45
|
+
method: 'PUT',
|
|
46
|
+
headers: this.headers,
|
|
47
|
+
body: JSON.stringify(aRecords),
|
|
48
|
+
});
|
|
49
|
+
if (!aRes.ok)
|
|
50
|
+
throw new Error(`Failed to set A records: ${aRes.status}`);
|
|
51
|
+
const cnameRes = await fetch(`${this.apiBase}/domains/${domain}/records/CNAME/www`, {
|
|
52
|
+
method: 'PUT',
|
|
53
|
+
headers: this.headers,
|
|
54
|
+
body: JSON.stringify([{ data: `${githubUser}.github.io`, ttl: 600 }]),
|
|
55
|
+
});
|
|
56
|
+
if (!cnameRes.ok)
|
|
57
|
+
throw new Error(`Failed to set CNAME: ${cnameRes.status}`);
|
|
58
|
+
}
|
|
59
|
+
async verifyDomain(domain) {
|
|
60
|
+
try {
|
|
61
|
+
const domains = await this.listDomains();
|
|
62
|
+
return domains.some((d) => d.domain === domain && d.status === 'ACTIVE');
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=godaddy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"godaddy.js","sourceRoot":"","sources":["../../src/services/godaddy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD,MAAM,aAAa,GAAG,4BAA4B,CAAC;AACnD,MAAM,YAAY,GAAG,gCAAgC,CAAC;AAEtD,MAAM,OAAO,cAAc;IACjB,MAAM,CAAS;IACf,SAAS,CAAS;IAClB,OAAO,CAAS;IAExB;QACE,MAAM,MAAM,GAAG,gBAAgB,EAAE,CAAC;QAClC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;QAC9E,CAAC;QACD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;QAClC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,WAAW,KAAK,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,aAAa,CAAC;IAC7E,CAAC;IAED,IAAY,OAAO;QACjB,OAAO;YACL,aAAa,EAAE,WAAW,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,SAAS,EAAE;YACzD,cAAc,EAAE,kBAAkB;SACnC,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,WAAW;QACf,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,IAAI,CAAC,OAAO,UAAU,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;QAC9E,IAAI,CAAC,GAAG,CAAC,EAAE;YAAE,MAAM,IAAI,KAAK,CAAC,sBAAsB,GAAG,CAAC,M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