@defai.digital/ax-cli 0.0.34 → 0.2.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/README.md +749 -272
- package/dist/agent/grok-agent.d.ts +7 -1
- package/dist/agent/grok-agent.js +22 -9
- package/dist/agent/grok-agent.js.map +1 -1
- package/dist/commands/mcp.js +1 -1
- package/dist/commands/mcp.js.map +1 -1
- package/dist/constants.d.ts +116 -0
- package/dist/constants.js +115 -0
- package/dist/constants.js.map +1 -0
- package/dist/grok/client.d.ts +133 -2
- package/dist/grok/client.js +173 -16
- package/dist/grok/client.js.map +1 -1
- package/dist/grok/types.d.ts +291 -0
- package/dist/grok/types.js +127 -0
- package/dist/grok/types.js.map +1 -0
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/mcp/client.d.ts +3 -8
- package/dist/mcp/client.js +17 -9
- package/dist/mcp/client.js.map +1 -1
- package/dist/mcp/config.d.ts +1 -1
- package/dist/mcp/config.js +24 -4
- package/dist/mcp/config.js.map +1 -1
- package/dist/mcp/transports.js +1 -1
- package/dist/mcp/transports.js.map +1 -1
- package/dist/schemas/api-schemas.d.ts +569 -0
- package/dist/schemas/api-schemas.js +116 -0
- package/dist/schemas/api-schemas.js.map +1 -0
- package/dist/schemas/confirmation-schemas.d.ts +60 -0
- package/dist/schemas/confirmation-schemas.js +41 -0
- package/dist/schemas/confirmation-schemas.js.map +1 -0
- package/dist/schemas/index-unified.d.ts +12 -0
- package/dist/schemas/index-unified.js +17 -0
- package/dist/schemas/index-unified.js.map +1 -0
- package/dist/schemas/index.d.ts +229 -37
- package/dist/schemas/settings-schemas.d.ts +179 -0
- package/dist/schemas/settings-schemas.js +52 -0
- package/dist/schemas/settings-schemas.js.map +1 -0
- package/dist/schemas/tool-schemas.d.ts +241 -0
- package/dist/schemas/tool-schemas.js +79 -0
- package/dist/schemas/tool-schemas.js.map +1 -0
- package/dist/tools/search.js +2 -2
- package/dist/tools/search.js.map +1 -1
- package/dist/ui/components/api-key-input.js +2 -2
- package/dist/ui/components/api-key-input.js.map +1 -1
- package/dist/ui/components/chat-history.js +2 -0
- package/dist/ui/components/chat-history.js.map +1 -1
- package/dist/ui/components/chat-interface.js +31 -1
- package/dist/ui/components/chat-interface.js.map +1 -1
- package/dist/ui/components/mcp-status.js +1 -1
- package/dist/ui/components/mcp-status.js.map +1 -1
- package/dist/ui/components/reasoning-display.d.ts +109 -0
- package/dist/ui/components/reasoning-display.js +110 -0
- package/dist/ui/components/reasoning-display.js.map +1 -0
- package/dist/ui/shared/max-sized-box.js +1 -1
- package/dist/ui/shared/max-sized-box.js.map +1 -1
- package/dist/utils/cache.d.ts +75 -0
- package/dist/utils/cache.js +137 -0
- package/dist/utils/cache.js.map +1 -0
- package/dist/utils/confirmation-service.js +2 -2
- package/dist/utils/confirmation-service.js.map +1 -1
- package/dist/utils/error-handler.d.ts +43 -0
- package/dist/utils/error-handler.js +70 -0
- package/dist/utils/error-handler.js.map +1 -0
- package/dist/utils/index.d.ts +13 -0
- package/dist/utils/index.js +23 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/path-validator.d.ts +30 -0
- package/dist/utils/path-validator.js +67 -0
- package/dist/utils/path-validator.js.map +1 -0
- package/dist/utils/performance.d.ts +72 -0
- package/dist/utils/performance.js +114 -0
- package/dist/utils/performance.js.map +1 -0
- package/dist/utils/settings-manager.d.ts +2 -18
- package/dist/utils/settings-manager.js +19 -6
- package/dist/utils/settings-manager.js.map +1 -1
- package/dist/utils/token-counter.d.ts +10 -1
- package/dist/utils/token-counter.js +27 -6
- package/dist/utils/token-counter.js.map +1 -1
- package/eslint.config.js +60 -0
- package/package.json +24 -6
- package/vitest.config.ts +20 -0
- package/.automatosx/agents/aerospace-scientist.yaml +0 -159
- package/.automatosx/agents/architecture.yaml +0 -244
- package/.automatosx/agents/backend.yaml +0 -172
- package/.automatosx/agents/ceo.yaml +0 -105
- package/.automatosx/agents/creative-marketer.yaml +0 -173
- package/.automatosx/agents/cto.yaml +0 -118
- package/.automatosx/agents/data-scientist.yaml +0 -200
- package/.automatosx/agents/data.yaml +0 -106
- package/.automatosx/agents/design.yaml +0 -115
- package/.automatosx/agents/devops.yaml +0 -124
- package/.automatosx/agents/frontend.yaml +0 -171
- package/.automatosx/agents/fullstack.yaml +0 -172
- package/.automatosx/agents/mobile.yaml +0 -185
- package/.automatosx/agents/product.yaml +0 -103
- package/.automatosx/agents/quality.yaml +0 -93
- package/.automatosx/agents/quantum-engineer.yaml +0 -167
- package/.automatosx/agents/researcher.yaml +0 -122
- package/.automatosx/agents/security.yaml +0 -115
- package/.automatosx/agents/standard.yaml +0 -214
- package/.automatosx/agents/writer.yaml +0 -122
- package/.automatosx/feature-flags.json +0 -13
- package/.automatosx/memory/memory.db +0 -0
- package/.automatosx/providers/README.md +0 -117
- package/.automatosx/providers/grok-zai.yaml.template +0 -61
- package/.automatosx/providers/grok.yaml.template +0 -71
- package/.automatosx/status/backend-1763517593334-85037.json +0 -9
- package/.automatosx/status/quality-1763516867087-82043.json +0 -9
- package/.automatosx/status/quality-1763516976722-84817.json +0 -9
- package/.automatosx/status/security-1763517871950-87357.json +0 -9
- package/.automatosx/teams/business.yaml +0 -56
- package/.automatosx/teams/core.yaml +0 -60
- package/.automatosx/teams/design.yaml +0 -58
- package/.automatosx/teams/engineering.yaml +0 -69
- package/.automatosx/teams/research.yaml +0 -56
- package/.automatosx/templates/analyst.yaml +0 -60
- package/.automatosx/templates/assistant.yaml +0 -48
- package/.automatosx/templates/basic-agent.yaml +0 -28
- package/.automatosx/templates/code-reviewer.yaml +0 -52
- package/.automatosx/templates/debugger.yaml +0 -63
- package/.automatosx/templates/designer.yaml +0 -69
- package/.automatosx/templates/developer.yaml +0 -60
- package/.automatosx/templates/fullstack-developer.yaml +0 -395
- package/.automatosx/templates/qa-specialist.yaml +0 -71
- package/.claude/mcp/automatosx.json +0 -244
- package/.claude/settings.local.json +0 -34
- package/.grok/settings.json +0 -37
- package/automatosx/PRD/README.md +0 -9
- package/automatosx/tmp/README.md +0 -10
- package/automatosx.config.json +0 -333
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schemas for confirmation service validation
|
|
3
|
+
* Ensures type safety for user confirmation dialogs
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
export declare const ConfirmationOptionsSchema: z.ZodObject<{
|
|
7
|
+
operation: z.ZodString;
|
|
8
|
+
filename: z.ZodString;
|
|
9
|
+
showVSCodeOpen: z.ZodOptional<z.ZodBoolean>;
|
|
10
|
+
content: z.ZodOptional<z.ZodString>;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
filename: string;
|
|
13
|
+
operation: string;
|
|
14
|
+
content?: string | undefined;
|
|
15
|
+
showVSCodeOpen?: boolean | undefined;
|
|
16
|
+
}, {
|
|
17
|
+
filename: string;
|
|
18
|
+
operation: string;
|
|
19
|
+
content?: string | undefined;
|
|
20
|
+
showVSCodeOpen?: boolean | undefined;
|
|
21
|
+
}>;
|
|
22
|
+
export type ConfirmationOptions = z.infer<typeof ConfirmationOptionsSchema>;
|
|
23
|
+
export declare const ConfirmationResultSchema: z.ZodObject<{
|
|
24
|
+
confirmed: z.ZodBoolean;
|
|
25
|
+
dontAskAgain: z.ZodOptional<z.ZodBoolean>;
|
|
26
|
+
feedback: z.ZodOptional<z.ZodString>;
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
confirmed: boolean;
|
|
29
|
+
dontAskAgain?: boolean | undefined;
|
|
30
|
+
feedback?: string | undefined;
|
|
31
|
+
}, {
|
|
32
|
+
confirmed: boolean;
|
|
33
|
+
dontAskAgain?: boolean | undefined;
|
|
34
|
+
feedback?: string | undefined;
|
|
35
|
+
}>;
|
|
36
|
+
export type ConfirmationResult = z.infer<typeof ConfirmationResultSchema>;
|
|
37
|
+
export declare const SessionFlagsSchema: z.ZodObject<{
|
|
38
|
+
fileOperations: z.ZodBoolean;
|
|
39
|
+
bashCommands: z.ZodBoolean;
|
|
40
|
+
allOperations: z.ZodBoolean;
|
|
41
|
+
}, "strip", z.ZodTypeAny, {
|
|
42
|
+
fileOperations: boolean;
|
|
43
|
+
bashCommands: boolean;
|
|
44
|
+
allOperations: boolean;
|
|
45
|
+
}, {
|
|
46
|
+
fileOperations: boolean;
|
|
47
|
+
bashCommands: boolean;
|
|
48
|
+
allOperations: boolean;
|
|
49
|
+
}>;
|
|
50
|
+
export type SessionFlags = z.infer<typeof SessionFlagsSchema>;
|
|
51
|
+
/**
|
|
52
|
+
* Validation helper functions
|
|
53
|
+
*/
|
|
54
|
+
export declare function validateConfirmationOptions(data: unknown): ConfirmationOptions;
|
|
55
|
+
export declare function safeValidateConfirmationOptions(data: unknown): {
|
|
56
|
+
success: boolean;
|
|
57
|
+
data?: ConfirmationOptions;
|
|
58
|
+
error?: z.ZodError;
|
|
59
|
+
};
|
|
60
|
+
export declare function validateConfirmationResult(data: unknown): ConfirmationResult;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schemas for confirmation service validation
|
|
3
|
+
* Ensures type safety for user confirmation dialogs
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
// Confirmation Options Schema
|
|
7
|
+
export const ConfirmationOptionsSchema = z.object({
|
|
8
|
+
operation: z.string().min(1, 'Operation description required'),
|
|
9
|
+
filename: z.string().min(1, 'Filename required'),
|
|
10
|
+
showVSCodeOpen: z.boolean().optional(),
|
|
11
|
+
content: z.string().optional(),
|
|
12
|
+
});
|
|
13
|
+
// Confirmation Result Schema
|
|
14
|
+
export const ConfirmationResultSchema = z.object({
|
|
15
|
+
confirmed: z.boolean(),
|
|
16
|
+
dontAskAgain: z.boolean().optional(),
|
|
17
|
+
feedback: z.string().optional(),
|
|
18
|
+
});
|
|
19
|
+
// Session Flags Schema
|
|
20
|
+
export const SessionFlagsSchema = z.object({
|
|
21
|
+
fileOperations: z.boolean(),
|
|
22
|
+
bashCommands: z.boolean(),
|
|
23
|
+
allOperations: z.boolean(),
|
|
24
|
+
});
|
|
25
|
+
/**
|
|
26
|
+
* Validation helper functions
|
|
27
|
+
*/
|
|
28
|
+
export function validateConfirmationOptions(data) {
|
|
29
|
+
return ConfirmationOptionsSchema.parse(data);
|
|
30
|
+
}
|
|
31
|
+
export function safeValidateConfirmationOptions(data) {
|
|
32
|
+
const result = ConfirmationOptionsSchema.safeParse(data);
|
|
33
|
+
if (result.success) {
|
|
34
|
+
return { success: true, data: result.data };
|
|
35
|
+
}
|
|
36
|
+
return { success: false, error: result.error };
|
|
37
|
+
}
|
|
38
|
+
export function validateConfirmationResult(data) {
|
|
39
|
+
return ConfirmationResultSchema.parse(data);
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=confirmation-schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"confirmation-schemas.js","sourceRoot":"","sources":["../../src/schemas/confirmation-schemas.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,8BAA8B;AAC9B,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,gCAAgC,CAAC;IAC9D,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,mBAAmB,CAAC;IAChD,cAAc,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACtC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC;AAIH,6BAA6B;AAC7B,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE;IACtB,YAAY,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACpC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAChC,CAAC,CAAC;AAIH,uBAAuB;AACvB,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,cAAc,EAAE,CAAC,CAAC,OAAO,EAAE;IAC3B,YAAY,EAAE,CAAC,CAAC,OAAO,EAAE;IACzB,aAAa,EAAE,CAAC,CAAC,OAAO,EAAE;CAC3B,CAAC,CAAC;AAIH;;GAEG;AAEH,MAAM,UAAU,2BAA2B,CACzC,IAAa;IAEb,OAAO,yBAAyB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,+BAA+B,CAAC,IAAa;IAK3D,MAAM,MAAM,GAAG,yBAAyB,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IACzD,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACnB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;IAC9C,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,IAAa;IACtD,OAAO,wBAAwB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified schema exports
|
|
3
|
+
* Central location for all Zod schemas and types
|
|
4
|
+
*/
|
|
5
|
+
export * from './settings-schemas.js';
|
|
6
|
+
export * from './tool-schemas.js';
|
|
7
|
+
export * from './api-schemas.js';
|
|
8
|
+
export * from './confirmation-schemas.js';
|
|
9
|
+
/**
|
|
10
|
+
* Re-export commonly used Zod utilities
|
|
11
|
+
*/
|
|
12
|
+
export { z } from 'zod';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified schema exports
|
|
3
|
+
* Central location for all Zod schemas and types
|
|
4
|
+
*/
|
|
5
|
+
// Settings schemas
|
|
6
|
+
export * from './settings-schemas.js';
|
|
7
|
+
// Tool schemas
|
|
8
|
+
export * from './tool-schemas.js';
|
|
9
|
+
// API schemas
|
|
10
|
+
export * from './api-schemas.js';
|
|
11
|
+
// Confirmation schemas
|
|
12
|
+
export * from './confirmation-schemas.js';
|
|
13
|
+
/**
|
|
14
|
+
* Re-export commonly used Zod utilities
|
|
15
|
+
*/
|
|
16
|
+
export { z } from 'zod';
|
|
17
|
+
//# sourceMappingURL=index-unified.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-unified.js","sourceRoot":"","sources":["../../src/schemas/index-unified.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,mBAAmB;AACnB,cAAc,uBAAuB,CAAC;AAEtC,eAAe;AACf,cAAc,mBAAmB,CAAC;AAElC,cAAc;AACd,cAAc,kBAAkB,CAAC;AAEjC,uBAAuB;AACvB,cAAc,2BAA2B,CAAC;AAE1C;;GAEG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC"}
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -6,42 +6,112 @@ export declare const UserSettingsSchema: z.ZodObject<{
|
|
|
6
6
|
apiKey: z.ZodOptional<z.ZodString>;
|
|
7
7
|
baseURL: z.ZodOptional<z.ZodString>;
|
|
8
8
|
defaultModel: z.ZodOptional<z.ZodString>;
|
|
9
|
-
models: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
10
|
-
}, z.
|
|
9
|
+
models: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
apiKey?: string | undefined;
|
|
12
|
+
baseURL?: string | undefined;
|
|
13
|
+
defaultModel?: string | undefined;
|
|
14
|
+
models?: string[] | undefined;
|
|
15
|
+
}, {
|
|
16
|
+
apiKey?: string | undefined;
|
|
17
|
+
baseURL?: string | undefined;
|
|
18
|
+
defaultModel?: string | undefined;
|
|
19
|
+
models?: string[] | undefined;
|
|
20
|
+
}>;
|
|
11
21
|
export type UserSettings = z.infer<typeof UserSettingsSchema>;
|
|
12
22
|
export declare const ProjectSettingsSchema: z.ZodObject<{
|
|
13
23
|
model: z.ZodOptional<z.ZodString>;
|
|
14
24
|
mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
15
25
|
name: z.ZodString;
|
|
16
|
-
transport: z.ZodEnum<
|
|
17
|
-
stdio: "stdio";
|
|
18
|
-
http: "http";
|
|
19
|
-
sse: "sse";
|
|
20
|
-
}>;
|
|
26
|
+
transport: z.ZodEnum<["stdio", "http", "sse"]>;
|
|
21
27
|
command: z.ZodOptional<z.ZodString>;
|
|
22
|
-
args: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
28
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
23
29
|
url: z.ZodOptional<z.ZodString>;
|
|
24
30
|
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
25
|
-
}, z.
|
|
26
|
-
|
|
31
|
+
}, "strip", z.ZodTypeAny, {
|
|
32
|
+
name: string;
|
|
33
|
+
transport: "stdio" | "http" | "sse";
|
|
34
|
+
url?: string | undefined;
|
|
35
|
+
env?: Record<string, string> | undefined;
|
|
36
|
+
command?: string | undefined;
|
|
37
|
+
args?: string[] | undefined;
|
|
38
|
+
}, {
|
|
39
|
+
name: string;
|
|
40
|
+
transport: "stdio" | "http" | "sse";
|
|
41
|
+
url?: string | undefined;
|
|
42
|
+
env?: Record<string, string> | undefined;
|
|
43
|
+
command?: string | undefined;
|
|
44
|
+
args?: string[] | undefined;
|
|
45
|
+
}>>>;
|
|
46
|
+
}, "strip", z.ZodTypeAny, {
|
|
47
|
+
model?: string | undefined;
|
|
48
|
+
mcpServers?: Record<string, {
|
|
49
|
+
name: string;
|
|
50
|
+
transport: "stdio" | "http" | "sse";
|
|
51
|
+
url?: string | undefined;
|
|
52
|
+
env?: Record<string, string> | undefined;
|
|
53
|
+
command?: string | undefined;
|
|
54
|
+
args?: string[] | undefined;
|
|
55
|
+
}> | undefined;
|
|
56
|
+
}, {
|
|
57
|
+
model?: string | undefined;
|
|
58
|
+
mcpServers?: Record<string, {
|
|
59
|
+
name: string;
|
|
60
|
+
transport: "stdio" | "http" | "sse";
|
|
61
|
+
url?: string | undefined;
|
|
62
|
+
env?: Record<string, string> | undefined;
|
|
63
|
+
command?: string | undefined;
|
|
64
|
+
args?: string[] | undefined;
|
|
65
|
+
}> | undefined;
|
|
66
|
+
}>;
|
|
27
67
|
export type ProjectSettings = z.infer<typeof ProjectSettingsSchema>;
|
|
28
|
-
export declare const MCPServerConfigSchema: z.ZodObject<{
|
|
68
|
+
export declare const MCPServerConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
29
69
|
name: z.ZodString;
|
|
30
|
-
transport: z.ZodEnum<
|
|
31
|
-
stdio: "stdio";
|
|
32
|
-
http: "http";
|
|
33
|
-
sse: "sse";
|
|
34
|
-
}>;
|
|
70
|
+
transport: z.ZodEnum<["stdio", "http", "sse"]>;
|
|
35
71
|
command: z.ZodOptional<z.ZodString>;
|
|
36
|
-
args: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
72
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
37
73
|
url: z.ZodOptional<z.ZodString>;
|
|
38
74
|
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
39
|
-
}, z.
|
|
75
|
+
}, "strip", z.ZodTypeAny, {
|
|
76
|
+
name: string;
|
|
77
|
+
transport: "stdio" | "http" | "sse";
|
|
78
|
+
url?: string | undefined;
|
|
79
|
+
env?: Record<string, string> | undefined;
|
|
80
|
+
command?: string | undefined;
|
|
81
|
+
args?: string[] | undefined;
|
|
82
|
+
}, {
|
|
83
|
+
name: string;
|
|
84
|
+
transport: "stdio" | "http" | "sse";
|
|
85
|
+
url?: string | undefined;
|
|
86
|
+
env?: Record<string, string> | undefined;
|
|
87
|
+
command?: string | undefined;
|
|
88
|
+
args?: string[] | undefined;
|
|
89
|
+
}>, {
|
|
90
|
+
name: string;
|
|
91
|
+
transport: "stdio" | "http" | "sse";
|
|
92
|
+
url?: string | undefined;
|
|
93
|
+
env?: Record<string, string> | undefined;
|
|
94
|
+
command?: string | undefined;
|
|
95
|
+
args?: string[] | undefined;
|
|
96
|
+
}, {
|
|
97
|
+
name: string;
|
|
98
|
+
transport: "stdio" | "http" | "sse";
|
|
99
|
+
url?: string | undefined;
|
|
100
|
+
env?: Record<string, string> | undefined;
|
|
101
|
+
command?: string | undefined;
|
|
102
|
+
args?: string[] | undefined;
|
|
103
|
+
}>;
|
|
40
104
|
export type MCPServerConfig = z.infer<typeof MCPServerConfigSchema>;
|
|
41
105
|
export declare const ToolExecutionSchema: z.ZodObject<{
|
|
42
106
|
name: z.ZodString;
|
|
43
107
|
arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
44
|
-
}, z.
|
|
108
|
+
}, "strip", z.ZodTypeAny, {
|
|
109
|
+
name: string;
|
|
110
|
+
arguments: Record<string, unknown>;
|
|
111
|
+
}, {
|
|
112
|
+
name: string;
|
|
113
|
+
arguments: Record<string, unknown>;
|
|
114
|
+
}>;
|
|
45
115
|
export type ToolExecution = z.infer<typeof ToolExecutionSchema>;
|
|
46
116
|
export declare const APIResponseSchema: z.ZodObject<{
|
|
47
117
|
id: z.ZodString;
|
|
@@ -51,12 +121,7 @@ export declare const APIResponseSchema: z.ZodObject<{
|
|
|
51
121
|
choices: z.ZodArray<z.ZodObject<{
|
|
52
122
|
index: z.ZodNumber;
|
|
53
123
|
message: z.ZodObject<{
|
|
54
|
-
role: z.ZodEnum<
|
|
55
|
-
system: "system";
|
|
56
|
-
user: "user";
|
|
57
|
-
assistant: "assistant";
|
|
58
|
-
tool: "tool";
|
|
59
|
-
}>;
|
|
124
|
+
role: z.ZodEnum<["system", "user", "assistant", "tool"]>;
|
|
60
125
|
content: z.ZodNullable<z.ZodString>;
|
|
61
126
|
tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
62
127
|
id: z.ZodString;
|
|
@@ -64,22 +129,149 @@ export declare const APIResponseSchema: z.ZodObject<{
|
|
|
64
129
|
function: z.ZodObject<{
|
|
65
130
|
name: z.ZodString;
|
|
66
131
|
arguments: z.ZodString;
|
|
67
|
-
}, z.
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
132
|
+
}, "strip", z.ZodTypeAny, {
|
|
133
|
+
name: string;
|
|
134
|
+
arguments: string;
|
|
135
|
+
}, {
|
|
136
|
+
name: string;
|
|
137
|
+
arguments: string;
|
|
138
|
+
}>;
|
|
139
|
+
}, "strip", z.ZodTypeAny, {
|
|
140
|
+
function: {
|
|
141
|
+
name: string;
|
|
142
|
+
arguments: string;
|
|
143
|
+
};
|
|
144
|
+
id: string;
|
|
145
|
+
type: "function";
|
|
146
|
+
}, {
|
|
147
|
+
function: {
|
|
148
|
+
name: string;
|
|
149
|
+
arguments: string;
|
|
150
|
+
};
|
|
151
|
+
id: string;
|
|
152
|
+
type: "function";
|
|
153
|
+
}>, "many">>;
|
|
154
|
+
}, "strip", z.ZodTypeAny, {
|
|
155
|
+
role: "system" | "user" | "assistant" | "tool";
|
|
156
|
+
content: string | null;
|
|
157
|
+
tool_calls?: {
|
|
158
|
+
function: {
|
|
159
|
+
name: string;
|
|
160
|
+
arguments: string;
|
|
161
|
+
};
|
|
162
|
+
id: string;
|
|
163
|
+
type: "function";
|
|
164
|
+
}[] | undefined;
|
|
165
|
+
}, {
|
|
166
|
+
role: "system" | "user" | "assistant" | "tool";
|
|
167
|
+
content: string | null;
|
|
168
|
+
tool_calls?: {
|
|
169
|
+
function: {
|
|
170
|
+
name: string;
|
|
171
|
+
arguments: string;
|
|
172
|
+
};
|
|
173
|
+
id: string;
|
|
174
|
+
type: "function";
|
|
175
|
+
}[] | undefined;
|
|
176
|
+
}>;
|
|
177
|
+
finish_reason: z.ZodNullable<z.ZodEnum<["stop", "length", "tool_calls", "content_filter"]>>;
|
|
178
|
+
}, "strip", z.ZodTypeAny, {
|
|
179
|
+
message: {
|
|
180
|
+
role: "system" | "user" | "assistant" | "tool";
|
|
181
|
+
content: string | null;
|
|
182
|
+
tool_calls?: {
|
|
183
|
+
function: {
|
|
184
|
+
name: string;
|
|
185
|
+
arguments: string;
|
|
186
|
+
};
|
|
187
|
+
id: string;
|
|
188
|
+
type: "function";
|
|
189
|
+
}[] | undefined;
|
|
190
|
+
};
|
|
191
|
+
index: number;
|
|
192
|
+
finish_reason: "length" | "tool_calls" | "stop" | "content_filter" | null;
|
|
193
|
+
}, {
|
|
194
|
+
message: {
|
|
195
|
+
role: "system" | "user" | "assistant" | "tool";
|
|
196
|
+
content: string | null;
|
|
197
|
+
tool_calls?: {
|
|
198
|
+
function: {
|
|
199
|
+
name: string;
|
|
200
|
+
arguments: string;
|
|
201
|
+
};
|
|
202
|
+
id: string;
|
|
203
|
+
type: "function";
|
|
204
|
+
}[] | undefined;
|
|
205
|
+
};
|
|
206
|
+
index: number;
|
|
207
|
+
finish_reason: "length" | "tool_calls" | "stop" | "content_filter" | null;
|
|
208
|
+
}>, "many">;
|
|
77
209
|
usage: z.ZodOptional<z.ZodObject<{
|
|
78
210
|
prompt_tokens: z.ZodNumber;
|
|
79
211
|
completion_tokens: z.ZodNumber;
|
|
80
212
|
total_tokens: z.ZodNumber;
|
|
81
|
-
}, z.
|
|
82
|
-
|
|
213
|
+
}, "strip", z.ZodTypeAny, {
|
|
214
|
+
prompt_tokens: number;
|
|
215
|
+
completion_tokens: number;
|
|
216
|
+
total_tokens: number;
|
|
217
|
+
}, {
|
|
218
|
+
prompt_tokens: number;
|
|
219
|
+
completion_tokens: number;
|
|
220
|
+
total_tokens: number;
|
|
221
|
+
}>>;
|
|
222
|
+
}, "strip", z.ZodTypeAny, {
|
|
223
|
+
object: string;
|
|
224
|
+
id: string;
|
|
225
|
+
created: number;
|
|
226
|
+
model: string;
|
|
227
|
+
choices: {
|
|
228
|
+
message: {
|
|
229
|
+
role: "system" | "user" | "assistant" | "tool";
|
|
230
|
+
content: string | null;
|
|
231
|
+
tool_calls?: {
|
|
232
|
+
function: {
|
|
233
|
+
name: string;
|
|
234
|
+
arguments: string;
|
|
235
|
+
};
|
|
236
|
+
id: string;
|
|
237
|
+
type: "function";
|
|
238
|
+
}[] | undefined;
|
|
239
|
+
};
|
|
240
|
+
index: number;
|
|
241
|
+
finish_reason: "length" | "tool_calls" | "stop" | "content_filter" | null;
|
|
242
|
+
}[];
|
|
243
|
+
usage?: {
|
|
244
|
+
prompt_tokens: number;
|
|
245
|
+
completion_tokens: number;
|
|
246
|
+
total_tokens: number;
|
|
247
|
+
} | undefined;
|
|
248
|
+
}, {
|
|
249
|
+
object: string;
|
|
250
|
+
id: string;
|
|
251
|
+
created: number;
|
|
252
|
+
model: string;
|
|
253
|
+
choices: {
|
|
254
|
+
message: {
|
|
255
|
+
role: "system" | "user" | "assistant" | "tool";
|
|
256
|
+
content: string | null;
|
|
257
|
+
tool_calls?: {
|
|
258
|
+
function: {
|
|
259
|
+
name: string;
|
|
260
|
+
arguments: string;
|
|
261
|
+
};
|
|
262
|
+
id: string;
|
|
263
|
+
type: "function";
|
|
264
|
+
}[] | undefined;
|
|
265
|
+
};
|
|
266
|
+
index: number;
|
|
267
|
+
finish_reason: "length" | "tool_calls" | "stop" | "content_filter" | null;
|
|
268
|
+
}[];
|
|
269
|
+
usage?: {
|
|
270
|
+
prompt_tokens: number;
|
|
271
|
+
completion_tokens: number;
|
|
272
|
+
total_tokens: number;
|
|
273
|
+
} | undefined;
|
|
274
|
+
}>;
|
|
83
275
|
export type APIResponse = z.infer<typeof APIResponseSchema>;
|
|
84
276
|
/**
|
|
85
277
|
* Validation helper functions
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schemas for validating user and project settings
|
|
3
|
+
* Ensures graceful degradation on corrupted config files
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
export declare const UserSettingsSchema: z.ZodObject<{
|
|
7
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
8
|
+
baseURL: z.ZodOptional<z.ZodString>;
|
|
9
|
+
defaultModel: z.ZodOptional<z.ZodString>;
|
|
10
|
+
currentModel: z.ZodOptional<z.ZodString>;
|
|
11
|
+
maxTokens: z.ZodOptional<z.ZodNumber>;
|
|
12
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
models: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
14
|
+
confirmations: z.ZodOptional<z.ZodObject<{
|
|
15
|
+
fileOperations: z.ZodOptional<z.ZodBoolean>;
|
|
16
|
+
bashCommands: z.ZodOptional<z.ZodBoolean>;
|
|
17
|
+
}, "strip", z.ZodTypeAny, {
|
|
18
|
+
fileOperations?: boolean | undefined;
|
|
19
|
+
bashCommands?: boolean | undefined;
|
|
20
|
+
}, {
|
|
21
|
+
fileOperations?: boolean | undefined;
|
|
22
|
+
bashCommands?: boolean | undefined;
|
|
23
|
+
}>>;
|
|
24
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
25
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
26
|
+
baseURL: z.ZodOptional<z.ZodString>;
|
|
27
|
+
defaultModel: z.ZodOptional<z.ZodString>;
|
|
28
|
+
currentModel: z.ZodOptional<z.ZodString>;
|
|
29
|
+
maxTokens: z.ZodOptional<z.ZodNumber>;
|
|
30
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
31
|
+
models: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
32
|
+
confirmations: z.ZodOptional<z.ZodObject<{
|
|
33
|
+
fileOperations: z.ZodOptional<z.ZodBoolean>;
|
|
34
|
+
bashCommands: z.ZodOptional<z.ZodBoolean>;
|
|
35
|
+
}, "strip", z.ZodTypeAny, {
|
|
36
|
+
fileOperations?: boolean | undefined;
|
|
37
|
+
bashCommands?: boolean | undefined;
|
|
38
|
+
}, {
|
|
39
|
+
fileOperations?: boolean | undefined;
|
|
40
|
+
bashCommands?: boolean | undefined;
|
|
41
|
+
}>>;
|
|
42
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
43
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
44
|
+
baseURL: z.ZodOptional<z.ZodString>;
|
|
45
|
+
defaultModel: z.ZodOptional<z.ZodString>;
|
|
46
|
+
currentModel: z.ZodOptional<z.ZodString>;
|
|
47
|
+
maxTokens: z.ZodOptional<z.ZodNumber>;
|
|
48
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
49
|
+
models: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
50
|
+
confirmations: z.ZodOptional<z.ZodObject<{
|
|
51
|
+
fileOperations: z.ZodOptional<z.ZodBoolean>;
|
|
52
|
+
bashCommands: z.ZodOptional<z.ZodBoolean>;
|
|
53
|
+
}, "strip", z.ZodTypeAny, {
|
|
54
|
+
fileOperations?: boolean | undefined;
|
|
55
|
+
bashCommands?: boolean | undefined;
|
|
56
|
+
}, {
|
|
57
|
+
fileOperations?: boolean | undefined;
|
|
58
|
+
bashCommands?: boolean | undefined;
|
|
59
|
+
}>>;
|
|
60
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
61
|
+
export declare const ProjectSettingsSchema: z.ZodObject<{
|
|
62
|
+
name: z.ZodOptional<z.ZodString>;
|
|
63
|
+
model: z.ZodOptional<z.ZodString>;
|
|
64
|
+
currentModel: z.ZodOptional<z.ZodString>;
|
|
65
|
+
customInstructions: z.ZodOptional<z.ZodString>;
|
|
66
|
+
excludePatterns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
67
|
+
includePatterns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
68
|
+
mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
69
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
70
|
+
name: z.ZodOptional<z.ZodString>;
|
|
71
|
+
model: z.ZodOptional<z.ZodString>;
|
|
72
|
+
currentModel: z.ZodOptional<z.ZodString>;
|
|
73
|
+
customInstructions: z.ZodOptional<z.ZodString>;
|
|
74
|
+
excludePatterns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
75
|
+
includePatterns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
76
|
+
mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
77
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
78
|
+
name: z.ZodOptional<z.ZodString>;
|
|
79
|
+
model: z.ZodOptional<z.ZodString>;
|
|
80
|
+
currentModel: z.ZodOptional<z.ZodString>;
|
|
81
|
+
customInstructions: z.ZodOptional<z.ZodString>;
|
|
82
|
+
excludePatterns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
83
|
+
includePatterns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
84
|
+
mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
85
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
86
|
+
export declare const ModelOptionSchema: z.ZodObject<{
|
|
87
|
+
model: z.ZodString;
|
|
88
|
+
description: z.ZodOptional<z.ZodString>;
|
|
89
|
+
maxTokens: z.ZodOptional<z.ZodNumber>;
|
|
90
|
+
}, "strip", z.ZodTypeAny, {
|
|
91
|
+
model: string;
|
|
92
|
+
maxTokens?: number | undefined;
|
|
93
|
+
description?: string | undefined;
|
|
94
|
+
}, {
|
|
95
|
+
model: string;
|
|
96
|
+
maxTokens?: number | undefined;
|
|
97
|
+
description?: string | undefined;
|
|
98
|
+
}>;
|
|
99
|
+
export declare const MCPTransportConfigSchema: z.ZodObject<{
|
|
100
|
+
type: z.ZodEnum<["stdio", "http", "sse", "streamable_http"]>;
|
|
101
|
+
command: z.ZodOptional<z.ZodString>;
|
|
102
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
103
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
104
|
+
url: z.ZodOptional<z.ZodString>;
|
|
105
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
106
|
+
}, "strip", z.ZodTypeAny, {
|
|
107
|
+
type: "stdio" | "http" | "sse" | "streamable_http";
|
|
108
|
+
headers?: Record<string, string> | undefined;
|
|
109
|
+
url?: string | undefined;
|
|
110
|
+
env?: Record<string, string> | undefined;
|
|
111
|
+
command?: string | undefined;
|
|
112
|
+
args?: string[] | undefined;
|
|
113
|
+
}, {
|
|
114
|
+
type: "stdio" | "http" | "sse" | "streamable_http";
|
|
115
|
+
headers?: Record<string, string> | undefined;
|
|
116
|
+
url?: string | undefined;
|
|
117
|
+
env?: Record<string, string> | undefined;
|
|
118
|
+
command?: string | undefined;
|
|
119
|
+
args?: string[] | undefined;
|
|
120
|
+
}>;
|
|
121
|
+
export declare const MCPServerConfigSchema: z.ZodObject<{
|
|
122
|
+
name: z.ZodString;
|
|
123
|
+
transport: z.ZodObject<{
|
|
124
|
+
type: z.ZodEnum<["stdio", "http", "sse", "streamable_http"]>;
|
|
125
|
+
command: z.ZodOptional<z.ZodString>;
|
|
126
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
127
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
128
|
+
url: z.ZodOptional<z.ZodString>;
|
|
129
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
130
|
+
}, "strip", z.ZodTypeAny, {
|
|
131
|
+
type: "stdio" | "http" | "sse" | "streamable_http";
|
|
132
|
+
headers?: Record<string, string> | undefined;
|
|
133
|
+
url?: string | undefined;
|
|
134
|
+
env?: Record<string, string> | undefined;
|
|
135
|
+
command?: string | undefined;
|
|
136
|
+
args?: string[] | undefined;
|
|
137
|
+
}, {
|
|
138
|
+
type: "stdio" | "http" | "sse" | "streamable_http";
|
|
139
|
+
headers?: Record<string, string> | undefined;
|
|
140
|
+
url?: string | undefined;
|
|
141
|
+
env?: Record<string, string> | undefined;
|
|
142
|
+
command?: string | undefined;
|
|
143
|
+
args?: string[] | undefined;
|
|
144
|
+
}>;
|
|
145
|
+
command: z.ZodOptional<z.ZodString>;
|
|
146
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
147
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
148
|
+
}, "strip", z.ZodTypeAny, {
|
|
149
|
+
name: string;
|
|
150
|
+
transport: {
|
|
151
|
+
type: "stdio" | "http" | "sse" | "streamable_http";
|
|
152
|
+
headers?: Record<string, string> | undefined;
|
|
153
|
+
url?: string | undefined;
|
|
154
|
+
env?: Record<string, string> | undefined;
|
|
155
|
+
command?: string | undefined;
|
|
156
|
+
args?: string[] | undefined;
|
|
157
|
+
};
|
|
158
|
+
env?: Record<string, string> | undefined;
|
|
159
|
+
command?: string | undefined;
|
|
160
|
+
args?: string[] | undefined;
|
|
161
|
+
}, {
|
|
162
|
+
name: string;
|
|
163
|
+
transport: {
|
|
164
|
+
type: "stdio" | "http" | "sse" | "streamable_http";
|
|
165
|
+
headers?: Record<string, string> | undefined;
|
|
166
|
+
url?: string | undefined;
|
|
167
|
+
env?: Record<string, string> | undefined;
|
|
168
|
+
command?: string | undefined;
|
|
169
|
+
args?: string[] | undefined;
|
|
170
|
+
};
|
|
171
|
+
env?: Record<string, string> | undefined;
|
|
172
|
+
command?: string | undefined;
|
|
173
|
+
args?: string[] | undefined;
|
|
174
|
+
}>;
|
|
175
|
+
export type UserSettings = z.infer<typeof UserSettingsSchema>;
|
|
176
|
+
export type ProjectSettings = z.infer<typeof ProjectSettingsSchema>;
|
|
177
|
+
export type ModelOption = z.infer<typeof ModelOptionSchema>;
|
|
178
|
+
export type MCPServerConfig = z.infer<typeof MCPServerConfigSchema>;
|
|
179
|
+
export type MCPTransportConfig = z.infer<typeof MCPTransportConfigSchema>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schemas for validating user and project settings
|
|
3
|
+
* Ensures graceful degradation on corrupted config files
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
// User Settings Schema
|
|
7
|
+
export const UserSettingsSchema = z.object({
|
|
8
|
+
apiKey: z.string().optional(),
|
|
9
|
+
baseURL: z.string().optional(), // Remove .url() to allow any string
|
|
10
|
+
defaultModel: z.string().optional(),
|
|
11
|
+
currentModel: z.string().optional(),
|
|
12
|
+
maxTokens: z.number().int().positive().optional(),
|
|
13
|
+
temperature: z.number().min(0).max(2).optional(),
|
|
14
|
+
models: z.array(z.string()).optional(),
|
|
15
|
+
confirmations: z.object({
|
|
16
|
+
fileOperations: z.boolean().optional(),
|
|
17
|
+
bashCommands: z.boolean().optional(),
|
|
18
|
+
}).optional(),
|
|
19
|
+
}).passthrough(); // Allow additional properties for backward compatibility
|
|
20
|
+
// Project Settings Schema
|
|
21
|
+
export const ProjectSettingsSchema = z.object({
|
|
22
|
+
name: z.string().optional(),
|
|
23
|
+
model: z.string().optional(), // Legacy field
|
|
24
|
+
currentModel: z.string().optional(),
|
|
25
|
+
customInstructions: z.string().optional(),
|
|
26
|
+
excludePatterns: z.array(z.string()).optional(),
|
|
27
|
+
includePatterns: z.array(z.string()).optional(),
|
|
28
|
+
mcpServers: z.record(z.any()).optional(), // MCP server configurations
|
|
29
|
+
}).passthrough(); // Allow additional properties for backward compatibility
|
|
30
|
+
// Model Option Schema
|
|
31
|
+
export const ModelOptionSchema = z.object({
|
|
32
|
+
model: z.string().min(1),
|
|
33
|
+
description: z.string().optional(),
|
|
34
|
+
maxTokens: z.number().int().positive().optional(),
|
|
35
|
+
});
|
|
36
|
+
// MCP Server Config Schema
|
|
37
|
+
export const MCPTransportConfigSchema = z.object({
|
|
38
|
+
type: z.enum(['stdio', 'http', 'sse', 'streamable_http']),
|
|
39
|
+
command: z.string().optional(),
|
|
40
|
+
args: z.array(z.string()).optional(),
|
|
41
|
+
env: z.record(z.string()).optional(),
|
|
42
|
+
url: z.string().url().optional(),
|
|
43
|
+
headers: z.record(z.string()).optional(),
|
|
44
|
+
});
|
|
45
|
+
export const MCPServerConfigSchema = z.object({
|
|
46
|
+
name: z.string().min(1),
|
|
47
|
+
transport: MCPTransportConfigSchema,
|
|
48
|
+
command: z.string().optional(), // Legacy support
|
|
49
|
+
args: z.array(z.string()).optional(), // Legacy support
|
|
50
|
+
env: z.record(z.string()).optional(), // Legacy support
|
|
51
|
+
});
|
|
52
|
+
//# sourceMappingURL=settings-schemas.js.map
|