cyrus-config-updater 0.2.16 → 0.2.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/handlers/cyrusConfig.d.ts +5 -2
- package/dist/handlers/cyrusConfig.d.ts.map +1 -1
- package/dist/handlers/cyrusConfig.js +31 -95
- package/dist/handlers/cyrusConfig.js.map +1 -1
- package/dist/types.d.ts +130 -14
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +12 -1
- package/dist/types.js.map +1 -1
- package/package.json +3 -2
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ApiResponse } from "../types.js";
|
|
2
2
|
/**
|
|
3
3
|
* Handle Cyrus configuration update
|
|
4
4
|
* Updates the ~/.cyrus/config.json file with the provided configuration
|
|
5
|
+
*
|
|
6
|
+
* @param rawPayload - Unvalidated payload from the request
|
|
7
|
+
* @param cyrusHome - Path to the Cyrus home directory
|
|
5
8
|
*/
|
|
6
|
-
export declare function handleCyrusConfig(
|
|
9
|
+
export declare function handleCyrusConfig(rawPayload: unknown, cyrusHome: string): Promise<ApiResponse>;
|
|
7
10
|
/**
|
|
8
11
|
* Read current Cyrus configuration
|
|
9
12
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cyrusConfig.d.ts","sourceRoot":"","sources":["../../src/handlers/cyrusConfig.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cyrusConfig.d.ts","sourceRoot":"","sources":["../../src/handlers/cyrusConfig.ts"],"names":[],"mappings":"AAGA,OAAO,EACN,KAAK,WAAW,EAGhB,MAAM,aAAa,CAAC;AAErB;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACtC,UAAU,EAAE,OAAO,EACnB,SAAS,EAAE,MAAM,GACf,OAAO,CAAC,WAAW,CAAC,CA4FtB;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,GAAG,CAatD"}
|
|
@@ -1,120 +1,56 @@
|
|
|
1
1
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { dirname, join } from "node:path";
|
|
3
|
+
import { CyrusConfigPayloadSchema, } from "../types.js";
|
|
3
4
|
/**
|
|
4
5
|
* Handle Cyrus configuration update
|
|
5
6
|
* Updates the ~/.cyrus/config.json file with the provided configuration
|
|
7
|
+
*
|
|
8
|
+
* @param rawPayload - Unvalidated payload from the request
|
|
9
|
+
* @param cyrusHome - Path to the Cyrus home directory
|
|
6
10
|
*/
|
|
7
|
-
export async function handleCyrusConfig(
|
|
11
|
+
export async function handleCyrusConfig(rawPayload, cyrusHome) {
|
|
8
12
|
try {
|
|
9
|
-
// Validate payload
|
|
10
|
-
|
|
13
|
+
// Validate payload with Zod schema
|
|
14
|
+
const parseResult = CyrusConfigPayloadSchema.safeParse(rawPayload);
|
|
15
|
+
if (!parseResult.success) {
|
|
16
|
+
const issues = parseResult.error.issues;
|
|
17
|
+
const firstIssue = issues[0];
|
|
18
|
+
const path = firstIssue?.path.join(".") || "unknown";
|
|
19
|
+
const message = firstIssue?.message || "Invalid configuration";
|
|
11
20
|
return {
|
|
12
21
|
success: false,
|
|
13
|
-
error: "Configuration
|
|
14
|
-
details:
|
|
22
|
+
error: "Configuration validation failed",
|
|
23
|
+
details: `${path}: ${message}`,
|
|
15
24
|
};
|
|
16
25
|
}
|
|
17
|
-
|
|
18
|
-
for (const repo of payload.repositories) {
|
|
19
|
-
if (!repo.id || !repo.name || !repo.repositoryPath || !repo.baseBranch) {
|
|
20
|
-
const missingFields = [];
|
|
21
|
-
if (!repo.id)
|
|
22
|
-
missingFields.push("id");
|
|
23
|
-
if (!repo.name)
|
|
24
|
-
missingFields.push("name");
|
|
25
|
-
if (!repo.repositoryPath)
|
|
26
|
-
missingFields.push("repositoryPath");
|
|
27
|
-
if (!repo.baseBranch)
|
|
28
|
-
missingFields.push("baseBranch");
|
|
29
|
-
return {
|
|
30
|
-
success: false,
|
|
31
|
-
error: "Repository configuration is incomplete",
|
|
32
|
-
details: `Repository "${repo.name || "unknown"}" is missing required fields: ${missingFields.join(", ")}`,
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
}
|
|
26
|
+
const payload = parseResult.data;
|
|
36
27
|
const configPath = join(cyrusHome, "config.json");
|
|
37
28
|
// Ensure the .cyrus directory exists
|
|
38
29
|
const configDir = dirname(configPath);
|
|
39
30
|
if (!existsSync(configDir)) {
|
|
40
31
|
mkdirSync(configDir, { recursive: true });
|
|
41
32
|
}
|
|
42
|
-
//
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
33
|
+
// Extract operation flags (not part of EdgeConfig)
|
|
34
|
+
const { restartCyrus, backupConfig, ...edgeConfig } = payload;
|
|
35
|
+
// Process repositories to apply defaults
|
|
36
|
+
const repositories = edgeConfig.repositories.map((repo) => {
|
|
37
|
+
return {
|
|
38
|
+
...repo,
|
|
39
|
+
// Set workspaceBaseDir (use provided or default to ~/.cyrus/workspaces)
|
|
40
|
+
workspaceBaseDir: repo.workspaceBaseDir || join(cyrusHome, "workspaces"),
|
|
41
|
+
// Set isActive (defaults to true)
|
|
42
|
+
isActive: repo.isActive !== false,
|
|
43
|
+
// Ensure teamKeys is always an array
|
|
44
|
+
teamKeys: repo.teamKeys || [],
|
|
49
45
|
};
|
|
50
|
-
// Add optional GitHub URL
|
|
51
|
-
if (repo.githubUrl) {
|
|
52
|
-
repoConfig.githubUrl = repo.githubUrl;
|
|
53
|
-
}
|
|
54
|
-
// Add optional Linear fields
|
|
55
|
-
if (repo.linearWorkspaceId) {
|
|
56
|
-
repoConfig.linearWorkspaceId = repo.linearWorkspaceId;
|
|
57
|
-
}
|
|
58
|
-
if (repo.linearToken) {
|
|
59
|
-
repoConfig.linearToken = repo.linearToken;
|
|
60
|
-
}
|
|
61
|
-
// Set workspaceBaseDir (use provided or default to ~/.cyrus/workspaces)
|
|
62
|
-
repoConfig.workspaceBaseDir =
|
|
63
|
-
repo.workspaceBaseDir || join(cyrusHome, "workspaces");
|
|
64
|
-
// Set isActive (defaults to true)
|
|
65
|
-
repoConfig.isActive = repo.isActive !== false;
|
|
66
|
-
// Optional arrays and objects
|
|
67
|
-
if (repo.allowedTools && repo.allowedTools.length > 0) {
|
|
68
|
-
repoConfig.allowedTools = repo.allowedTools;
|
|
69
|
-
}
|
|
70
|
-
if (repo.mcpConfigPath && repo.mcpConfigPath.length > 0) {
|
|
71
|
-
repoConfig.mcpConfigPath = repo.mcpConfigPath;
|
|
72
|
-
}
|
|
73
|
-
if (repo.teamKeys) {
|
|
74
|
-
repoConfig.teamKeys = repo.teamKeys;
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
repoConfig.teamKeys = [];
|
|
78
|
-
}
|
|
79
|
-
if (repo.routingLabels && repo.routingLabels.length > 0) {
|
|
80
|
-
repoConfig.routingLabels = repo.routingLabels;
|
|
81
|
-
}
|
|
82
|
-
if (repo.projectKeys && repo.projectKeys.length > 0) {
|
|
83
|
-
repoConfig.projectKeys = repo.projectKeys;
|
|
84
|
-
}
|
|
85
|
-
if (repo.labelPrompts && Object.keys(repo.labelPrompts).length > 0) {
|
|
86
|
-
repoConfig.labelPrompts = repo.labelPrompts;
|
|
87
|
-
}
|
|
88
|
-
return repoConfig;
|
|
89
46
|
});
|
|
90
|
-
// Build complete config
|
|
47
|
+
// Build complete config by spreading EdgeConfig fields and overriding repositories
|
|
91
48
|
const config = {
|
|
49
|
+
...edgeConfig,
|
|
92
50
|
repositories,
|
|
93
51
|
};
|
|
94
|
-
// Add optional global settings
|
|
95
|
-
if (payload.disallowedTools && payload.disallowedTools.length > 0) {
|
|
96
|
-
config.disallowedTools = payload.disallowedTools;
|
|
97
|
-
}
|
|
98
|
-
if (payload.ngrokAuthToken) {
|
|
99
|
-
config.ngrokAuthToken = payload.ngrokAuthToken;
|
|
100
|
-
}
|
|
101
|
-
if (payload.stripeCustomerId) {
|
|
102
|
-
config.stripeCustomerId = payload.stripeCustomerId;
|
|
103
|
-
}
|
|
104
|
-
if (payload.linearWorkspaceSlug) {
|
|
105
|
-
config.linearWorkspaceSlug = payload.linearWorkspaceSlug;
|
|
106
|
-
}
|
|
107
|
-
if (payload.defaultModel) {
|
|
108
|
-
config.defaultModel = payload.defaultModel;
|
|
109
|
-
}
|
|
110
|
-
if (payload.defaultFallbackModel) {
|
|
111
|
-
config.defaultFallbackModel = payload.defaultFallbackModel;
|
|
112
|
-
}
|
|
113
|
-
if (payload.global_setup_script) {
|
|
114
|
-
config.global_setup_script = payload.global_setup_script;
|
|
115
|
-
}
|
|
116
52
|
// Backup existing config if requested
|
|
117
|
-
if (
|
|
53
|
+
if (backupConfig && existsSync(configPath)) {
|
|
118
54
|
try {
|
|
119
55
|
const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
|
|
120
56
|
const backupPath = join(cyrusHome, `config.backup-${timestamp}.json`);
|
|
@@ -135,7 +71,7 @@ export async function handleCyrusConfig(payload, cyrusHome) {
|
|
|
135
71
|
data: {
|
|
136
72
|
configPath,
|
|
137
73
|
repositoriesCount: repositories.length,
|
|
138
|
-
restartCyrus:
|
|
74
|
+
restartCyrus: restartCyrus || false,
|
|
139
75
|
},
|
|
140
76
|
};
|
|
141
77
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cyrusConfig.js","sourceRoot":"","sources":["../../src/handlers/cyrusConfig.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;
|
|
1
|
+
{"version":3,"file":"cyrusConfig.js","sourceRoot":"","sources":["../../src/handlers/cyrusConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SA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|
1
|
+
import { z } from "zod";
|
|
2
2
|
/**
|
|
3
3
|
* Repository configuration payload
|
|
4
4
|
* Matches the format sent by cyrus-hosted
|
|
@@ -17,20 +17,136 @@ export interface DeleteRepositoryPayload {
|
|
|
17
17
|
linear_team_key: string;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
|
-
* Cyrus config update payload
|
|
20
|
+
* Cyrus config update payload schema
|
|
21
|
+
* Extends EdgeConfigPayloadSchema with operation flags for the update process.
|
|
22
|
+
* Uses EdgeConfigPayloadSchema (not EdgeConfigSchema) because incoming payloads
|
|
23
|
+
* may omit workspaceBaseDir - the handler applies a default value.
|
|
21
24
|
*/
|
|
22
|
-
export
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
export declare const CyrusConfigPayloadSchema: z.ZodObject<{
|
|
26
|
+
ngrokAuthToken: z.ZodOptional<z.ZodString>;
|
|
27
|
+
stripeCustomerId: z.ZodOptional<z.ZodString>;
|
|
28
|
+
linearWorkspaceSlug: z.ZodOptional<z.ZodString>;
|
|
29
|
+
defaultModel: z.ZodOptional<z.ZodString>;
|
|
30
|
+
defaultFallbackModel: z.ZodOptional<z.ZodString>;
|
|
31
|
+
global_setup_script: z.ZodOptional<z.ZodString>;
|
|
32
|
+
defaultAllowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
33
|
+
defaultDisallowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
34
|
+
issueUpdateTrigger: z.ZodOptional<z.ZodBoolean>;
|
|
35
|
+
userAccessControl: z.ZodOptional<z.ZodObject<{
|
|
36
|
+
allowedUsers: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
37
|
+
id: z.ZodString;
|
|
38
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
39
|
+
email: z.ZodString;
|
|
40
|
+
}, z.core.$strip>]>>>;
|
|
41
|
+
blockedUsers: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
42
|
+
id: z.ZodString;
|
|
43
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
44
|
+
email: z.ZodString;
|
|
45
|
+
}, z.core.$strip>]>>>;
|
|
46
|
+
blockBehavior: z.ZodOptional<z.ZodEnum<{
|
|
47
|
+
comment: "comment";
|
|
48
|
+
silent: "silent";
|
|
49
|
+
}>>;
|
|
50
|
+
blockMessage: z.ZodOptional<z.ZodString>;
|
|
51
|
+
}, z.core.$strip>>;
|
|
52
|
+
promptDefaults: z.ZodOptional<z.ZodObject<{
|
|
53
|
+
debugger: z.ZodOptional<z.ZodObject<{
|
|
54
|
+
allowedTools: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodLiteral<"readOnly">, z.ZodLiteral<"safe">, z.ZodLiteral<"all">, z.ZodLiteral<"coordinator">]>>;
|
|
55
|
+
disallowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
56
|
+
}, z.core.$strip>>;
|
|
57
|
+
builder: z.ZodOptional<z.ZodObject<{
|
|
58
|
+
allowedTools: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodLiteral<"readOnly">, z.ZodLiteral<"safe">, z.ZodLiteral<"all">, z.ZodLiteral<"coordinator">]>>;
|
|
59
|
+
disallowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
60
|
+
}, z.core.$strip>>;
|
|
61
|
+
scoper: z.ZodOptional<z.ZodObject<{
|
|
62
|
+
allowedTools: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodLiteral<"readOnly">, z.ZodLiteral<"safe">, z.ZodLiteral<"all">, z.ZodLiteral<"coordinator">]>>;
|
|
63
|
+
disallowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
64
|
+
}, z.core.$strip>>;
|
|
65
|
+
orchestrator: z.ZodOptional<z.ZodObject<{
|
|
66
|
+
allowedTools: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodLiteral<"readOnly">, z.ZodLiteral<"safe">, z.ZodLiteral<"all">, z.ZodLiteral<"coordinator">]>>;
|
|
67
|
+
disallowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
68
|
+
}, z.core.$strip>>;
|
|
69
|
+
"graphite-orchestrator": z.ZodOptional<z.ZodObject<{
|
|
70
|
+
allowedTools: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodLiteral<"readOnly">, z.ZodLiteral<"safe">, z.ZodLiteral<"all">, z.ZodLiteral<"coordinator">]>>;
|
|
71
|
+
disallowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
72
|
+
}, z.core.$strip>>;
|
|
73
|
+
}, z.core.$strip>>;
|
|
74
|
+
repositories: z.ZodArray<z.ZodObject<{
|
|
75
|
+
id: z.ZodString;
|
|
76
|
+
name: z.ZodString;
|
|
77
|
+
repositoryPath: z.ZodString;
|
|
78
|
+
baseBranch: z.ZodString;
|
|
79
|
+
githubUrl: z.ZodOptional<z.ZodString>;
|
|
80
|
+
linearWorkspaceId: z.ZodString;
|
|
81
|
+
linearWorkspaceName: z.ZodOptional<z.ZodString>;
|
|
82
|
+
linearToken: z.ZodString;
|
|
83
|
+
linearRefreshToken: z.ZodOptional<z.ZodString>;
|
|
84
|
+
teamKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
85
|
+
routingLabels: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
86
|
+
projectKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
87
|
+
isActive: z.ZodOptional<z.ZodBoolean>;
|
|
88
|
+
promptTemplatePath: z.ZodOptional<z.ZodString>;
|
|
89
|
+
allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
90
|
+
disallowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
91
|
+
mcpConfigPath: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
92
|
+
appendInstruction: z.ZodOptional<z.ZodString>;
|
|
93
|
+
model: z.ZodOptional<z.ZodString>;
|
|
94
|
+
fallbackModel: z.ZodOptional<z.ZodString>;
|
|
95
|
+
openaiApiKey: z.ZodOptional<z.ZodString>;
|
|
96
|
+
openaiOutputDirectory: z.ZodOptional<z.ZodString>;
|
|
97
|
+
labelPrompts: z.ZodOptional<z.ZodObject<{
|
|
98
|
+
debugger: z.ZodOptional<z.ZodObject<{
|
|
99
|
+
labels: z.ZodArray<z.ZodString>;
|
|
100
|
+
allowedTools: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodLiteral<"readOnly">, z.ZodLiteral<"safe">, z.ZodLiteral<"all">, z.ZodLiteral<"coordinator">]>>;
|
|
101
|
+
disallowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
102
|
+
}, z.core.$strip>>;
|
|
103
|
+
builder: z.ZodOptional<z.ZodObject<{
|
|
104
|
+
labels: z.ZodArray<z.ZodString>;
|
|
105
|
+
allowedTools: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodLiteral<"readOnly">, z.ZodLiteral<"safe">, z.ZodLiteral<"all">, z.ZodLiteral<"coordinator">]>>;
|
|
106
|
+
disallowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
107
|
+
}, z.core.$strip>>;
|
|
108
|
+
scoper: z.ZodOptional<z.ZodObject<{
|
|
109
|
+
labels: z.ZodArray<z.ZodString>;
|
|
110
|
+
allowedTools: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodLiteral<"readOnly">, z.ZodLiteral<"safe">, z.ZodLiteral<"all">, z.ZodLiteral<"coordinator">]>>;
|
|
111
|
+
disallowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
112
|
+
}, z.core.$strip>>;
|
|
113
|
+
orchestrator: z.ZodOptional<z.ZodObject<{
|
|
114
|
+
labels: z.ZodArray<z.ZodString>;
|
|
115
|
+
allowedTools: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodLiteral<"readOnly">, z.ZodLiteral<"safe">, z.ZodLiteral<"all">, z.ZodLiteral<"coordinator">]>>;
|
|
116
|
+
disallowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
117
|
+
}, z.core.$strip>>;
|
|
118
|
+
"graphite-orchestrator": z.ZodOptional<z.ZodObject<{
|
|
119
|
+
labels: z.ZodArray<z.ZodString>;
|
|
120
|
+
allowedTools: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodLiteral<"readOnly">, z.ZodLiteral<"safe">, z.ZodLiteral<"all">, z.ZodLiteral<"coordinator">]>>;
|
|
121
|
+
disallowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
122
|
+
}, z.core.$strip>>;
|
|
123
|
+
graphite: z.ZodOptional<z.ZodObject<{
|
|
124
|
+
labels: z.ZodArray<z.ZodString>;
|
|
125
|
+
}, z.core.$strip>>;
|
|
126
|
+
}, z.core.$strip>>;
|
|
127
|
+
userAccessControl: z.ZodOptional<z.ZodObject<{
|
|
128
|
+
allowedUsers: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
129
|
+
id: z.ZodString;
|
|
130
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
131
|
+
email: z.ZodString;
|
|
132
|
+
}, z.core.$strip>]>>>;
|
|
133
|
+
blockedUsers: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
134
|
+
id: z.ZodString;
|
|
135
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
136
|
+
email: z.ZodString;
|
|
137
|
+
}, z.core.$strip>]>>>;
|
|
138
|
+
blockBehavior: z.ZodOptional<z.ZodEnum<{
|
|
139
|
+
comment: "comment";
|
|
140
|
+
silent: "silent";
|
|
141
|
+
}>>;
|
|
142
|
+
blockMessage: z.ZodOptional<z.ZodString>;
|
|
143
|
+
}, z.core.$strip>>;
|
|
144
|
+
workspaceBaseDir: z.ZodOptional<z.ZodString>;
|
|
145
|
+
}, z.core.$strip>>;
|
|
146
|
+
restartCyrus: z.ZodOptional<z.ZodBoolean>;
|
|
147
|
+
backupConfig: z.ZodOptional<z.ZodBoolean>;
|
|
148
|
+
}, z.core.$strip>;
|
|
149
|
+
export type CyrusConfigPayload = z.infer<typeof CyrusConfigPayloadSchema>;
|
|
34
150
|
/**
|
|
35
151
|
* Cyrus environment variables payload (for Claude token)
|
|
36
152
|
*/
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IACjC,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACvC,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;CACxB;AAED;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAGnC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO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AC,GAAG,IAAI,CAAC;CACvD;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;CAC5C;AAED;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,WAAW;IAC3B,WAAW,EAAE,OAAO,CAAC;IACrB,eAAe,EAAE,OAAO,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B,OAAO,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
CHANGED
|
@@ -1,2 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
import { EdgeConfigPayloadSchema } from "cyrus-core";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
/**
|
|
4
|
+
* Cyrus config update payload schema
|
|
5
|
+
* Extends EdgeConfigPayloadSchema with operation flags for the update process.
|
|
6
|
+
* Uses EdgeConfigPayloadSchema (not EdgeConfigSchema) because incoming payloads
|
|
7
|
+
* may omit workspaceBaseDir - the handler applies a default value.
|
|
8
|
+
*/
|
|
9
|
+
export const CyrusConfigPayloadSchema = EdgeConfigPayloadSchema.extend({
|
|
10
|
+
restartCyrus: z.boolean().optional(),
|
|
11
|
+
backupConfig: z.boolean().optional(),
|
|
12
|
+
});
|
|
2
13
|
//# sourceMappingURL=types.js.map
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAqBxB;;;;;GAKG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,uBAAuB,CAAC,MAAM,CAAC;IACtE,YAAY,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACpC,YAAY,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CACpC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cyrus-config-updater",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.18",
|
|
4
4
|
"description": "Configuration update handlers for Cyrus agent",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"fastify": "^5.2.0",
|
|
19
|
-
"
|
|
19
|
+
"zod": "^4.3.6",
|
|
20
|
+
"cyrus-core": "0.2.18"
|
|
20
21
|
},
|
|
21
22
|
"devDependencies": {
|
|
22
23
|
"@types/node": "^20.12.7",
|