cyrus-config-updater 0.2.0-rc
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/LICENSE +674 -0
- package/dist/ConfigUpdater.d.ts +48 -0
- package/dist/ConfigUpdater.d.ts.map +1 -0
- package/dist/ConfigUpdater.js +116 -0
- package/dist/ConfigUpdater.js.map +1 -0
- package/dist/handlers/checkGh.d.ts +10 -0
- package/dist/handlers/checkGh.d.ts.map +1 -0
- package/dist/handlers/checkGh.js +54 -0
- package/dist/handlers/checkGh.js.map +1 -0
- package/dist/handlers/configureMcp.d.ts +7 -0
- package/dist/handlers/configureMcp.d.ts.map +1 -0
- package/dist/handlers/configureMcp.js +104 -0
- package/dist/handlers/configureMcp.js.map +1 -0
- package/dist/handlers/cyrusConfig.d.ts +11 -0
- package/dist/handlers/cyrusConfig.d.ts.map +1 -0
- package/dist/handlers/cyrusConfig.js +161 -0
- package/dist/handlers/cyrusConfig.js.map +1 -0
- package/dist/handlers/cyrusEnv.d.ts +7 -0
- package/dist/handlers/cyrusEnv.d.ts.map +1 -0
- package/dist/handlers/cyrusEnv.js +113 -0
- package/dist/handlers/cyrusEnv.js.map +1 -0
- package/dist/handlers/repository.d.ts +9 -0
- package/dist/handlers/repository.d.ts.map +1 -0
- package/dist/handlers/repository.js +123 -0
- package/dist/handlers/repository.js.map +1 -0
- package/dist/handlers/testMcp.d.ts +10 -0
- package/dist/handlers/testMcp.d.ts.map +1 -0
- package/dist/handlers/testMcp.js +74 -0
- package/dist/handlers/testMcp.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +111 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +37 -0
- package/src/ConfigUpdater.ts +156 -0
- package/src/handlers/checkGh.ts +59 -0
- package/src/handlers/configureMcp.ts +127 -0
- package/src/handlers/cyrusConfig.ts +185 -0
- package/src/handlers/cyrusEnv.ts +132 -0
- package/src/handlers/repository.ts +137 -0
- package/src/handlers/testMcp.ts +82 -0
- package/src/index.ts +2 -0
- package/src/types.ts +111 -0
- package/test/handlers/checkGh.test.ts +144 -0
- package/test-scripts/test-check-gh.js +56 -0
- package/tsconfig.json +12 -0
- package/vitest.config.ts +8 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
/**
|
|
4
|
+
* Handle Cyrus environment variables update
|
|
5
|
+
* Primarily used to update/provide the Claude API token
|
|
6
|
+
*/
|
|
7
|
+
export async function handleCyrusEnv(payload, cyrusHome) {
|
|
8
|
+
try {
|
|
9
|
+
// Validate payload
|
|
10
|
+
if (!payload || typeof payload !== "object") {
|
|
11
|
+
return {
|
|
12
|
+
success: false,
|
|
13
|
+
error: "Environment variables update requires valid data",
|
|
14
|
+
details: "Payload must be an object containing environment variable key-value pairs.",
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
// Extract environment variables from payload
|
|
18
|
+
// The payload may have a 'variables' key containing the env vars,
|
|
19
|
+
// or the env vars may be directly in the payload
|
|
20
|
+
const envVarsSource = payload.variables || payload;
|
|
21
|
+
const envVars = Object.entries(envVarsSource).filter(([key, value]) => value !== undefined &&
|
|
22
|
+
typeof value === "string" &&
|
|
23
|
+
!["variables", "restartCyrus", "backupEnv"].includes(key));
|
|
24
|
+
if (envVars.length === 0) {
|
|
25
|
+
return {
|
|
26
|
+
success: false,
|
|
27
|
+
error: "No environment variables to update",
|
|
28
|
+
details: "At least one environment variable must be provided in the request.",
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
const envPath = join(cyrusHome, ".env");
|
|
32
|
+
// Ensure the .cyrus directory exists
|
|
33
|
+
const envDir = dirname(envPath);
|
|
34
|
+
if (!existsSync(envDir)) {
|
|
35
|
+
mkdirSync(envDir, { recursive: true });
|
|
36
|
+
}
|
|
37
|
+
// Read existing env file if it exists
|
|
38
|
+
const existingEnv = {};
|
|
39
|
+
if (existsSync(envPath)) {
|
|
40
|
+
try {
|
|
41
|
+
const content = readFileSync(envPath, "utf-8");
|
|
42
|
+
const lines = content.split("\n");
|
|
43
|
+
for (const line of lines) {
|
|
44
|
+
const trimmed = line.trim();
|
|
45
|
+
// Skip empty lines and comments
|
|
46
|
+
if (!trimmed || trimmed.startsWith("#")) {
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
const equalIndex = trimmed.indexOf("=");
|
|
50
|
+
if (equalIndex > 0) {
|
|
51
|
+
const key = trimmed.substring(0, equalIndex);
|
|
52
|
+
const value = trimmed.substring(equalIndex + 1);
|
|
53
|
+
existingEnv[key] = value;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
// Ignore errors reading existing file - we'll create a new one
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
// Merge new variables (new values override existing ones)
|
|
62
|
+
for (const [key, value] of envVars) {
|
|
63
|
+
if (value !== undefined) {
|
|
64
|
+
existingEnv[key] = value;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
// Build new env file content
|
|
68
|
+
const envContent = Object.entries(existingEnv)
|
|
69
|
+
.map(([key, value]) => `${key}=${value}`)
|
|
70
|
+
.join("\n");
|
|
71
|
+
// Backup existing env file if requested
|
|
72
|
+
if (payload.backupEnv && existsSync(envPath)) {
|
|
73
|
+
try {
|
|
74
|
+
const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
|
|
75
|
+
const backupPath = join(cyrusHome, `.env.backup-${timestamp}`);
|
|
76
|
+
const existingEnvFile = readFileSync(envPath, "utf-8");
|
|
77
|
+
writeFileSync(backupPath, existingEnvFile, "utf-8");
|
|
78
|
+
}
|
|
79
|
+
catch (backupError) {
|
|
80
|
+
// Log but don't fail - backup is not critical
|
|
81
|
+
console.warn(`Failed to backup env: ${backupError instanceof Error ? backupError.message : String(backupError)}`);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
// Write env file
|
|
85
|
+
try {
|
|
86
|
+
writeFileSync(envPath, `${envContent}\n`, "utf-8");
|
|
87
|
+
return {
|
|
88
|
+
success: true,
|
|
89
|
+
message: "Environment variables updated successfully",
|
|
90
|
+
data: {
|
|
91
|
+
envPath,
|
|
92
|
+
variablesUpdated: envVars.map(([key]) => key),
|
|
93
|
+
restartCyrus: payload.restartCyrus || false,
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
catch (error) {
|
|
98
|
+
return {
|
|
99
|
+
success: false,
|
|
100
|
+
error: "Failed to save environment variables",
|
|
101
|
+
details: `Could not write to ${envPath}: ${error instanceof Error ? error.message : String(error)}`,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
catch (error) {
|
|
106
|
+
return {
|
|
107
|
+
success: false,
|
|
108
|
+
error: "Environment variables update failed",
|
|
109
|
+
details: error instanceof Error ? error.message : String(error),
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=cyrusEnv.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cyrusEnv.js","sourceRoot":"","sources":["../../src/handlers/cyrusEnv.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAG1C;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CACnC,OAAwB,EACxB,SAAiB;IAEjB,IAAI,CAAC;QACJ,mBAAmB;QACnB,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;YAC7C,OAAO;gBACN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,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;SAC/D,CAAC;IACH,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ApiResponse, RepositoryPayload } from "../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Handle repository cloning or verification
|
|
4
|
+
* - Clones repositories to ~/.cyrus/repos/<repo-name> using GitHub CLI (gh)
|
|
5
|
+
* - If repository exists, verify it's a git repo and do nothing
|
|
6
|
+
* - If repository doesn't exist, clone it to ~/.cyrus/repos/<repo-name>
|
|
7
|
+
*/
|
|
8
|
+
export declare function handleRepository(payload: RepositoryPayload, cyrusHome: string): Promise<ApiResponse>;
|
|
9
|
+
//# sourceMappingURL=repository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repository.d.ts","sourceRoot":"","sources":["../../src/handlers/repository.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AA4BlE;;;;;GAKG;AACH,wBAAsB,gBAAgB,CACrC,OAAO,EAAE,iBAAiB,EAC1B,SAAS,EAAE,MAAM,GACf,OAAO,CAAC,WAAW,CAAC,CA+FtB"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { exec } from "node:child_process";
|
|
2
|
+
import { existsSync, mkdirSync } from "node:fs";
|
|
3
|
+
import { basename, join } from "node:path";
|
|
4
|
+
import { promisify } from "node:util";
|
|
5
|
+
const execAsync = promisify(exec);
|
|
6
|
+
/**
|
|
7
|
+
* Check if a directory contains a git repository
|
|
8
|
+
*/
|
|
9
|
+
function isGitRepository(path) {
|
|
10
|
+
try {
|
|
11
|
+
return existsSync(join(path, ".git"));
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Extract repository name from URL
|
|
19
|
+
*/
|
|
20
|
+
function getRepoNameFromUrl(repoUrl) {
|
|
21
|
+
// Handle URLs like: https://github.com/user/repo.git or git@github.com:user/repo.git
|
|
22
|
+
const match = repoUrl.match(/\/([^/]+?)(\.git)?$/);
|
|
23
|
+
if (match?.[1]) {
|
|
24
|
+
return match[1];
|
|
25
|
+
}
|
|
26
|
+
// Fallback: use last part of URL
|
|
27
|
+
return basename(repoUrl, ".git");
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Handle repository cloning or verification
|
|
31
|
+
* - Clones repositories to ~/.cyrus/repos/<repo-name> using GitHub CLI (gh)
|
|
32
|
+
* - If repository exists, verify it's a git repo and do nothing
|
|
33
|
+
* - If repository doesn't exist, clone it to ~/.cyrus/repos/<repo-name>
|
|
34
|
+
*/
|
|
35
|
+
export async function handleRepository(payload, cyrusHome) {
|
|
36
|
+
try {
|
|
37
|
+
// Validate payload
|
|
38
|
+
if (!payload.repository_url || typeof payload.repository_url !== "string") {
|
|
39
|
+
return {
|
|
40
|
+
success: false,
|
|
41
|
+
error: "Repository URL is required",
|
|
42
|
+
details: "Please provide a valid Git repository URL (e.g., https://github.com/user/repo.git)",
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
// Use repository name from payload or extract from URL
|
|
46
|
+
const repoName = payload.repository_name || getRepoNameFromUrl(payload.repository_url);
|
|
47
|
+
// Construct path within ~/.cyrus/repos
|
|
48
|
+
const reposDir = join(cyrusHome, "repos");
|
|
49
|
+
const repoPath = join(reposDir, repoName);
|
|
50
|
+
// Ensure repos directory exists
|
|
51
|
+
if (!existsSync(reposDir)) {
|
|
52
|
+
try {
|
|
53
|
+
mkdirSync(reposDir, { recursive: true });
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
return {
|
|
57
|
+
success: false,
|
|
58
|
+
error: "Failed to create repositories directory",
|
|
59
|
+
details: `Could not create directory at ${reposDir}: ${error instanceof Error ? error.message : String(error)}`,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
// Check if repository already exists
|
|
64
|
+
if (existsSync(repoPath)) {
|
|
65
|
+
// Verify it's a git repository
|
|
66
|
+
if (isGitRepository(repoPath)) {
|
|
67
|
+
return {
|
|
68
|
+
success: true,
|
|
69
|
+
message: "Repository already exists",
|
|
70
|
+
data: {
|
|
71
|
+
path: repoPath,
|
|
72
|
+
name: repoName,
|
|
73
|
+
action: "verified",
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
return {
|
|
78
|
+
success: false,
|
|
79
|
+
error: "Directory exists but is not a Git repository",
|
|
80
|
+
details: `A non-Git directory already exists at ${repoPath}. Please remove it manually or choose a different repository name.`,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
// Clone the repository using gh
|
|
84
|
+
try {
|
|
85
|
+
const cloneCmd = `gh repo clone "${payload.repository_url}" "${repoPath}"`;
|
|
86
|
+
await execAsync(cloneCmd);
|
|
87
|
+
// Verify the clone was successful
|
|
88
|
+
if (!isGitRepository(repoPath)) {
|
|
89
|
+
return {
|
|
90
|
+
success: false,
|
|
91
|
+
error: "Repository clone verification failed",
|
|
92
|
+
details: `GitHub CLI clone command completed, but the cloned directory at ${repoPath} does not appear to be a valid Git repository.`,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
return {
|
|
96
|
+
success: true,
|
|
97
|
+
message: "Repository cloned successfully",
|
|
98
|
+
data: {
|
|
99
|
+
path: repoPath,
|
|
100
|
+
name: repoName,
|
|
101
|
+
repository_url: payload.repository_url,
|
|
102
|
+
action: "cloned",
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
catch (error) {
|
|
107
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
108
|
+
return {
|
|
109
|
+
success: false,
|
|
110
|
+
error: "Failed to clone repository",
|
|
111
|
+
details: `Could not clone repository from ${payload.repository_url} using GitHub CLI: ${errorMessage}. Please verify the URL is correct, you have access to the repository, and gh is authenticated.`,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
catch (error) {
|
|
116
|
+
return {
|
|
117
|
+
success: false,
|
|
118
|
+
error: "Repository operation failed",
|
|
119
|
+
details: error instanceof Error ? error.message : String(error),
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=repository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repository.js","sourceRoot":"","sources":["../../src/handlers/repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAGtC,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;AAElC;;GAEG;AACH,SAAS,eAAe,CAAC,IAAY;IACpC,IAAI,CAAC;QACJ,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;IACvC,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,KAAK,CAAC;IACd,CAAC;AACF,CAAC;AAED;;GAEG;AACH,SAAS,kBAAkB,CAAC,OAAe;IAC1C,qFAAqF;IACrF,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;IACnD,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAChB,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC;IACD,iCAAiC;IACjC,OAAO,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;AAClC,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACrC,OAA0B,EAC1B,SAAiB;IAE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C,CAAC,MAAM,CAAC,KAAK,CAAC;SAC/D,CAAC;IACH,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ApiResponse, TestMcpPayload } from "../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Handle MCP connection test
|
|
4
|
+
* Tests connectivity and configuration of an MCP server
|
|
5
|
+
*
|
|
6
|
+
* Note: This is a placeholder implementation. The actual MCP testing logic
|
|
7
|
+
* would require integrating with the MCP SDK to test connections.
|
|
8
|
+
*/
|
|
9
|
+
export declare function handleTestMcp(payload: TestMcpPayload): Promise<ApiResponse>;
|
|
10
|
+
//# sourceMappingURL=testMcp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testMcp.d.ts","sourceRoot":"","sources":["../../src/handlers/testMcp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE/D;;;;;;GAMG;AACH,wBAAsB,aAAa,CAClC,OAAO,EAAE,cAAc,GACrB,OAAO,CAAC,WAAW,CAAC,CAsEtB"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Handle MCP connection test
|
|
3
|
+
* Tests connectivity and configuration of an MCP server
|
|
4
|
+
*
|
|
5
|
+
* Note: This is a placeholder implementation. The actual MCP testing logic
|
|
6
|
+
* would require integrating with the MCP SDK to test connections.
|
|
7
|
+
*/
|
|
8
|
+
export async function handleTestMcp(payload) {
|
|
9
|
+
try {
|
|
10
|
+
// Validate payload
|
|
11
|
+
if (!payload.transportType) {
|
|
12
|
+
return {
|
|
13
|
+
success: false,
|
|
14
|
+
error: "MCP test requires transport type",
|
|
15
|
+
details: 'The transportType field is required and must be either "stdio" or "sse".',
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
if (payload.transportType !== "stdio" && payload.transportType !== "sse") {
|
|
19
|
+
return {
|
|
20
|
+
success: false,
|
|
21
|
+
error: "Invalid MCP transport type",
|
|
22
|
+
details: `Transport type "${payload.transportType}" is not supported. Must be either "stdio" or "sse".`,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
// Validate transport-specific requirements
|
|
26
|
+
if (payload.transportType === "stdio") {
|
|
27
|
+
if (!payload.command) {
|
|
28
|
+
return {
|
|
29
|
+
success: false,
|
|
30
|
+
error: "MCP stdio transport requires command",
|
|
31
|
+
details: "The command field is required when using stdio transport type.",
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
else if (payload.transportType === "sse") {
|
|
36
|
+
if (!payload.serverUrl) {
|
|
37
|
+
return {
|
|
38
|
+
success: false,
|
|
39
|
+
error: "MCP SSE transport requires server URL",
|
|
40
|
+
details: "The serverUrl field is required when using SSE transport type.",
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
// TODO: Implement actual MCP connection testing
|
|
45
|
+
// This would involve:
|
|
46
|
+
// 1. Creating an MCP client with the provided configuration
|
|
47
|
+
// 2. Attempting to connect to the MCP server
|
|
48
|
+
// 3. Listing available tools/resources
|
|
49
|
+
// 4. Getting server info
|
|
50
|
+
// 5. Returning the results
|
|
51
|
+
return {
|
|
52
|
+
success: true,
|
|
53
|
+
message: "MCP connection test completed (placeholder implementation)",
|
|
54
|
+
data: {
|
|
55
|
+
transportType: payload.transportType,
|
|
56
|
+
tools: [],
|
|
57
|
+
serverInfo: {
|
|
58
|
+
name: "placeholder",
|
|
59
|
+
version: "0.0.0",
|
|
60
|
+
protocol: "mcp/1.0",
|
|
61
|
+
},
|
|
62
|
+
note: "This is a placeholder response. Full MCP testing will be implemented in a future update.",
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
return {
|
|
68
|
+
success: false,
|
|
69
|
+
error: "MCP connection test failed",
|
|
70
|
+
details: error instanceof Error ? error.message : String(error),
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=testMcp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testMcp.js","sourceRoot":"","sources":["../../src/handlers/testMcp.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAClC,OAAuB;IAEvB,IAAI,CAAC;QACJ,mBAAmB;QACnB,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC;YAC5B,OAAO;gBACN,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,kCAAkC;gBACzC,OAAO,EACN,0EAA0E;aAC3E,CAAC;QACH,CAAC;QAED,IAAI,OAAO,CAAC,aAAa,KAAK,OAAO,IAAI,OAAO,CAAC,aAAa,KAAK,KAAK,EAAE,CAAC;YAC1E,OAAO;gBACN,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,4BAA4B;gBACnC,OAAO,EAAE,mBAAmB,OAAO,CAAC,aAAa,sDAAsD;aACvG,CAAC;QACH,CAAC;QAED,2CAA2C;QAC3C,IAAI,OAAO,CAAC,aAAa,KAAK,OAAO,EAAE,CAAC;YACvC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;gBACtB,OAAO;oBACN,OAAO,EAAE,KAAK;oBACd,KAAK,EAAE,sCAAsC;oBAC7C,OAAO,EACN,gEAAgE;iBACjE,CAAC;YACH,CAAC;QACF,CAAC;aAAM,IAAI,OAAO,CAAC,aAAa,KAAK,KAAK,EAAE,CAAC;YAC5C,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;gBACxB,OAAO;oBACN,OAAO,EAAE,KAAK;oBACd,KAAK,EAAE,uCAAuC;oBAC9C,OAAO,EACN,gEAAgE;iBACjE,CAAC;YACH,CAAC;QACF,CAAC;QAED,gDAAgD;QAChD,sBAAsB;QACtB,4DAA4D;QAC5D,6CAA6C;QAC7C,uCAAuC;QACvC,yBAAyB;QACzB,2BAA2B;QAE3B,OAAO;YACN,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,4DAA4D;YACrE,IAAI,EAAE;gBACL,aAAa,EAAE,OAAO,CAAC,aAAa;gBACpC,KAAK,EAAE,EAAE;gBACT,UAAU,EAAE;oBACX,IAAI,EAAE,aAAa;oBACnB,OAAO,EAAE,OAAO;oBAChB,QAAQ,EAAE,SAAS;iBACnB;gBACD,IAAI,EAAE,0FAA0F;aAChG;SACD,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,OAAO;YACN,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,4BAA4B;YACnC,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;SAC/D,CAAC;IACH,CAAC;AACF,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,cAAc,YAAY,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,cAAc,YAAY,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Repository configuration payload
|
|
3
|
+
* Matches the format sent by cyrus-hosted
|
|
4
|
+
*/
|
|
5
|
+
export interface RepositoryPayload {
|
|
6
|
+
repository_url: string;
|
|
7
|
+
repository_name: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Cyrus config update payload
|
|
11
|
+
*/
|
|
12
|
+
export interface CyrusConfigPayload {
|
|
13
|
+
repositories: Array<{
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
repositoryPath: string;
|
|
17
|
+
baseBranch: string;
|
|
18
|
+
linearWorkspaceId?: string;
|
|
19
|
+
linearToken?: string;
|
|
20
|
+
workspaceBaseDir?: string;
|
|
21
|
+
isActive?: boolean;
|
|
22
|
+
allowedTools?: string[];
|
|
23
|
+
mcpConfigPath?: string[];
|
|
24
|
+
teamKeys?: string[];
|
|
25
|
+
labelPrompts?: Record<string, string[]>;
|
|
26
|
+
}>;
|
|
27
|
+
disallowedTools?: string[];
|
|
28
|
+
ngrokAuthToken?: string;
|
|
29
|
+
stripeCustomerId?: string;
|
|
30
|
+
defaultModel?: string;
|
|
31
|
+
defaultFallbackModel?: string;
|
|
32
|
+
global_setup_script?: string;
|
|
33
|
+
restartCyrus?: boolean;
|
|
34
|
+
backupConfig?: boolean;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Cyrus environment variables payload (for Claude token)
|
|
38
|
+
*/
|
|
39
|
+
export interface CyrusEnvPayload {
|
|
40
|
+
variables?: Record<string, string>;
|
|
41
|
+
ANTHROPIC_API_KEY?: string;
|
|
42
|
+
restartCyrus?: boolean;
|
|
43
|
+
backupEnv?: boolean;
|
|
44
|
+
[key: string]: string | boolean | Record<string, string> | undefined;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* MCP server configuration
|
|
48
|
+
*/
|
|
49
|
+
export interface McpServerConfig {
|
|
50
|
+
command?: string;
|
|
51
|
+
args?: string[];
|
|
52
|
+
env?: Record<string, string>;
|
|
53
|
+
url?: string;
|
|
54
|
+
transport?: "stdio" | "sse";
|
|
55
|
+
headers?: Record<string, string>;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Test MCP connection payload
|
|
59
|
+
*/
|
|
60
|
+
export interface TestMcpPayload {
|
|
61
|
+
transportType: "stdio" | "sse";
|
|
62
|
+
serverUrl?: string | null;
|
|
63
|
+
command?: string | null;
|
|
64
|
+
commandArgs?: Array<{
|
|
65
|
+
value: string;
|
|
66
|
+
order: number;
|
|
67
|
+
}> | null;
|
|
68
|
+
headers?: Array<{
|
|
69
|
+
name: string;
|
|
70
|
+
value: string;
|
|
71
|
+
}> | null;
|
|
72
|
+
envVars?: Array<{
|
|
73
|
+
key: string;
|
|
74
|
+
value: string;
|
|
75
|
+
}> | null;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Configure MCP servers payload
|
|
79
|
+
*/
|
|
80
|
+
export interface ConfigureMcpPayload {
|
|
81
|
+
mcpServers: Record<string, McpServerConfig>;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Check GitHub CLI payload (empty - no parameters needed)
|
|
85
|
+
*/
|
|
86
|
+
export type CheckGhPayload = Record<string, never>;
|
|
87
|
+
/**
|
|
88
|
+
* Check GitHub CLI response data
|
|
89
|
+
*/
|
|
90
|
+
export interface CheckGhData {
|
|
91
|
+
isInstalled: boolean;
|
|
92
|
+
isAuthenticated: boolean;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Error response to send back to cyrus-hosted
|
|
96
|
+
*/
|
|
97
|
+
export interface ErrorResponse {
|
|
98
|
+
success: false;
|
|
99
|
+
error: string;
|
|
100
|
+
details?: string;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Success response to send back to cyrus-hosted
|
|
104
|
+
*/
|
|
105
|
+
export interface SuccessResponse {
|
|
106
|
+
success: true;
|
|
107
|
+
message: string;
|
|
108
|
+
data?: any;
|
|
109
|
+
}
|
|
110
|
+
export type ApiResponse = SuccessResponse | ErrorResponse;
|
|
111
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IACjC,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,E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O,EAAE,KAAK,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC/B,OAAO,EAAE,IAAI,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,GAAG,CAAC;CACX;AAED,MAAM,MAAM,WAAW,GAAG,eAAe,GAAG,aAAa,CAAC"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "cyrus-config-updater",
|
|
3
|
+
"version": "0.2.0-rc",
|
|
4
|
+
"description": "Configuration update handlers for Cyrus agent",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"fastify": "^5.2.0"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@types/node": "^20.12.7",
|
|
19
|
+
"typescript": "^5.4.5",
|
|
20
|
+
"vitest": "^2.0.0"
|
|
21
|
+
},
|
|
22
|
+
"keywords": [
|
|
23
|
+
"config",
|
|
24
|
+
"update",
|
|
25
|
+
"handler",
|
|
26
|
+
"cyrus"
|
|
27
|
+
],
|
|
28
|
+
"author": "Cyrus Team",
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"scripts": {
|
|
31
|
+
"build": "tsc",
|
|
32
|
+
"dev": "tsc --watch",
|
|
33
|
+
"typecheck": "tsc --noEmit",
|
|
34
|
+
"test": "vitest",
|
|
35
|
+
"test:run": "vitest run --passWithNoTests"
|
|
36
|
+
}
|
|
37
|
+
}
|