task-o-matic 0.0.14 → 0.0.16
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/cli/display/progress.d.ts +15 -2
- package/dist/cli/display/progress.d.ts.map +1 -1
- package/dist/cli/display/progress.js +72 -4
- package/dist/commands/benchmark.d.ts.map +1 -1
- package/dist/commands/benchmark.js +11 -3
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +19 -4
- package/dist/commands/prd.js +7 -1
- package/dist/commands/tasks/delete.d.ts.map +1 -1
- package/dist/commands/tasks/delete.js +2 -1
- package/dist/commands/tasks/document/add.d.ts.map +1 -1
- package/dist/commands/tasks/document/add.js +2 -1
- package/dist/commands/tasks/document/get.d.ts.map +1 -1
- package/dist/commands/tasks/document/get.js +2 -1
- package/dist/commands/tasks/plan/set.d.ts.map +1 -1
- package/dist/commands/tasks/plan/set.js +11 -3
- package/dist/commands/tasks/show.d.ts.map +1 -1
- package/dist/commands/tasks/show.js +2 -1
- package/dist/commands/tasks/status.d.ts.map +1 -1
- package/dist/commands/tasks/status.js +2 -1
- package/dist/commands/tasks/update.d.ts.map +1 -1
- package/dist/commands/tasks/update.js +7 -1
- package/dist/commands/workflow.d.ts.map +1 -1
- package/dist/commands/workflow.js +15 -2
- package/dist/lib/ai-service/base-operations.d.ts +8 -0
- package/dist/lib/ai-service/base-operations.d.ts.map +1 -1
- package/dist/lib/ai-service/base-operations.js +23 -10
- package/dist/lib/ai-service/model-provider.d.ts.map +1 -1
- package/dist/lib/ai-service/model-provider.js +37 -6
- package/dist/lib/ai-service/prd-operations.d.ts.map +1 -1
- package/dist/lib/ai-service/prd-operations.js +50 -7
- package/dist/lib/ai-service/task-operations.d.ts +1 -0
- package/dist/lib/ai-service/task-operations.d.ts.map +1 -1
- package/dist/lib/ai-service/task-operations.js +158 -171
- package/dist/lib/benchmark/registry.d.ts.map +1 -1
- package/dist/lib/benchmark/registry.js +6 -10
- package/dist/lib/config-validation.d.ts +215 -0
- package/dist/lib/config-validation.d.ts.map +1 -0
- package/dist/lib/config-validation.js +246 -0
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +30 -7
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +2 -1
- package/dist/lib/storage/file-system.d.ts.map +1 -1
- package/dist/lib/storage/file-system.js +81 -21
- package/dist/lib/task-execution-core.d.ts.map +1 -1
- package/dist/lib/task-execution-core.js +3 -2
- package/dist/services/prd.d.ts +17 -0
- package/dist/services/prd.d.ts.map +1 -1
- package/dist/services/prd.js +69 -84
- package/dist/services/tasks.d.ts +315 -1
- package/dist/services/tasks.d.ts.map +1 -1
- package/dist/services/tasks.js +486 -121
- package/dist/services/workflow-ai-assistant.d.ts.map +1 -1
- package/dist/services/workflow-ai-assistant.js +19 -6
- package/dist/services/workflow.d.ts.map +1 -1
- package/dist/services/workflow.js +7 -1
- package/dist/test/lib/ai-service/task-operations.test.d.ts +2 -0
- package/dist/test/lib/ai-service/task-operations.test.d.ts.map +1 -0
- package/dist/test/lib/ai-service/task-operations.test.js +362 -0
- package/dist/test/mocks/mock-ai-operations.d.ts +15 -0
- package/dist/test/mocks/mock-ai-operations.d.ts.map +1 -0
- package/dist/test/mocks/mock-ai-operations.js +107 -0
- package/dist/test/mocks/mock-context-builder.d.ts +10 -0
- package/dist/test/mocks/mock-context-builder.d.ts.map +1 -0
- package/dist/test/mocks/mock-context-builder.js +81 -0
- package/dist/test/mocks/mock-model-provider.d.ts +7 -0
- package/dist/test/mocks/mock-model-provider.d.ts.map +1 -0
- package/dist/test/mocks/mock-model-provider.js +21 -0
- package/dist/test/mocks/mock-service-factory.d.ts +11 -0
- package/dist/test/mocks/mock-service-factory.d.ts.map +1 -0
- package/dist/test/mocks/mock-service-factory.js +61 -0
- package/dist/test/mocks/mock-storage.d.ts +50 -0
- package/dist/test/mocks/mock-storage.d.ts.map +1 -0
- package/dist/test/mocks/mock-storage.js +145 -0
- package/dist/test/services/task-service.test.d.ts +2 -0
- package/dist/test/services/task-service.test.d.ts.map +1 -0
- package/dist/test/services/task-service.test.js +459 -0
- package/dist/test/test-mock-setup.d.ts +26 -0
- package/dist/test/test-mock-setup.d.ts.map +1 -0
- package/dist/test/test-mock-setup.js +41 -0
- package/dist/test/test-setup.d.ts +9 -0
- package/dist/test/test-setup.d.ts.map +1 -0
- package/dist/test/test-setup.js +44 -0
- package/dist/test/test-utils.d.ts +22 -0
- package/dist/test/test-utils.d.ts.map +1 -0
- package/dist/test/test-utils.js +37 -0
- package/dist/test/utils/ai-operation-utility.test.d.ts +2 -0
- package/dist/test/utils/ai-operation-utility.test.d.ts.map +1 -0
- package/dist/test/utils/ai-operation-utility.test.js +290 -0
- package/dist/test/utils/error-handling.test.d.ts +2 -0
- package/dist/test/utils/error-handling.test.d.ts.map +1 -0
- package/dist/test/utils/error-handling.test.js +231 -0
- package/dist/utils/ai-operation-utility.d.ts +142 -0
- package/dist/utils/ai-operation-utility.d.ts.map +1 -0
- package/dist/utils/ai-operation-utility.js +279 -0
- package/dist/utils/ai-service-factory.d.ts +10 -0
- package/dist/utils/ai-service-factory.d.ts.map +1 -1
- package/dist/utils/ai-service-factory.js +19 -1
- package/dist/utils/cli-validators.d.ts +2 -2
- package/dist/utils/cli-validators.d.ts.map +1 -1
- package/dist/utils/cli-validators.js +7 -6
- package/dist/utils/error-utils.d.ts +3 -3
- package/dist/utils/error-utils.d.ts.map +1 -1
- package/dist/utils/error-utils.js +5 -4
- package/dist/utils/file-utils.d.ts +27 -4
- package/dist/utils/file-utils.d.ts.map +1 -1
- package/dist/utils/file-utils.js +46 -6
- package/dist/utils/id-generator.d.ts +1 -1
- package/dist/utils/id-generator.d.ts.map +1 -1
- package/dist/utils/id-generator.js +8 -2
- package/dist/utils/metadata-utils.d.ts +40 -0
- package/dist/utils/metadata-utils.d.ts.map +1 -0
- package/dist/utils/metadata-utils.js +43 -0
- package/dist/utils/model-executor-parser.d.ts +1 -1
- package/dist/utils/model-executor-parser.d.ts.map +1 -1
- package/dist/utils/model-executor-parser.js +3 -2
- package/dist/utils/storage-utils.d.ts +3 -3
- package/dist/utils/storage-utils.d.ts.map +1 -1
- package/dist/utils/storage-utils.js +7 -6
- package/dist/utils/task-o-matic-error.d.ts +206 -0
- package/dist/utils/task-o-matic-error.d.ts.map +1 -0
- package/dist/utils/task-o-matic-error.js +304 -0
- package/package.json +7 -2
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Zod schema for AI Provider
|
|
4
|
+
*/
|
|
5
|
+
export declare const AIProviderSchema: z.ZodEnum<["openai", "anthropic", "openrouter", "custom"]>;
|
|
6
|
+
/**
|
|
7
|
+
* Zod schema for AI Configuration
|
|
8
|
+
*/
|
|
9
|
+
export declare const AIConfigSchema: z.ZodObject<{
|
|
10
|
+
provider: z.ZodEnum<["openai", "anthropic", "openrouter", "custom"]>;
|
|
11
|
+
model: z.ZodString;
|
|
12
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
13
|
+
baseURL: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
14
|
+
maxTokens: z.ZodOptional<z.ZodNumber>;
|
|
15
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
context7Enabled: z.ZodOptional<z.ZodBoolean>;
|
|
17
|
+
reasoning: z.ZodOptional<z.ZodObject<{
|
|
18
|
+
maxTokens: z.ZodOptional<z.ZodNumber>;
|
|
19
|
+
}, "strip", z.ZodTypeAny, {
|
|
20
|
+
maxTokens?: number | undefined;
|
|
21
|
+
}, {
|
|
22
|
+
maxTokens?: number | undefined;
|
|
23
|
+
}>>;
|
|
24
|
+
}, "strip", z.ZodTypeAny, {
|
|
25
|
+
provider: "openai" | "anthropic" | "openrouter" | "custom";
|
|
26
|
+
model: string;
|
|
27
|
+
apiKey?: string | undefined;
|
|
28
|
+
baseURL?: string | undefined;
|
|
29
|
+
maxTokens?: number | undefined;
|
|
30
|
+
temperature?: number | undefined;
|
|
31
|
+
context7Enabled?: boolean | undefined;
|
|
32
|
+
reasoning?: {
|
|
33
|
+
maxTokens?: number | undefined;
|
|
34
|
+
} | undefined;
|
|
35
|
+
}, {
|
|
36
|
+
provider: "openai" | "anthropic" | "openrouter" | "custom";
|
|
37
|
+
model: string;
|
|
38
|
+
apiKey?: string | undefined;
|
|
39
|
+
baseURL?: string | undefined;
|
|
40
|
+
maxTokens?: number | undefined;
|
|
41
|
+
temperature?: number | undefined;
|
|
42
|
+
context7Enabled?: boolean | undefined;
|
|
43
|
+
reasoning?: {
|
|
44
|
+
maxTokens?: number | undefined;
|
|
45
|
+
} | undefined;
|
|
46
|
+
}>;
|
|
47
|
+
/**
|
|
48
|
+
* Zod schema for full Config object
|
|
49
|
+
*/
|
|
50
|
+
export declare const ConfigSchema: z.ZodObject<{
|
|
51
|
+
ai: z.ZodObject<{
|
|
52
|
+
provider: z.ZodEnum<["openai", "anthropic", "openrouter", "custom"]>;
|
|
53
|
+
model: z.ZodString;
|
|
54
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
55
|
+
baseURL: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
|
|
56
|
+
maxTokens: z.ZodOptional<z.ZodNumber>;
|
|
57
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
58
|
+
context7Enabled: z.ZodOptional<z.ZodBoolean>;
|
|
59
|
+
reasoning: z.ZodOptional<z.ZodObject<{
|
|
60
|
+
maxTokens: z.ZodOptional<z.ZodNumber>;
|
|
61
|
+
}, "strip", z.ZodTypeAny, {
|
|
62
|
+
maxTokens?: number | undefined;
|
|
63
|
+
}, {
|
|
64
|
+
maxTokens?: number | undefined;
|
|
65
|
+
}>>;
|
|
66
|
+
}, "strip", z.ZodTypeAny, {
|
|
67
|
+
provider: "openai" | "anthropic" | "openrouter" | "custom";
|
|
68
|
+
model: string;
|
|
69
|
+
apiKey?: string | undefined;
|
|
70
|
+
baseURL?: string | undefined;
|
|
71
|
+
maxTokens?: number | undefined;
|
|
72
|
+
temperature?: number | undefined;
|
|
73
|
+
context7Enabled?: boolean | undefined;
|
|
74
|
+
reasoning?: {
|
|
75
|
+
maxTokens?: number | undefined;
|
|
76
|
+
} | undefined;
|
|
77
|
+
}, {
|
|
78
|
+
provider: "openai" | "anthropic" | "openrouter" | "custom";
|
|
79
|
+
model: string;
|
|
80
|
+
apiKey?: string | undefined;
|
|
81
|
+
baseURL?: string | undefined;
|
|
82
|
+
maxTokens?: number | undefined;
|
|
83
|
+
temperature?: number | undefined;
|
|
84
|
+
context7Enabled?: boolean | undefined;
|
|
85
|
+
reasoning?: {
|
|
86
|
+
maxTokens?: number | undefined;
|
|
87
|
+
} | undefined;
|
|
88
|
+
}>;
|
|
89
|
+
workingDirectory: z.ZodOptional<z.ZodString>;
|
|
90
|
+
}, "strip", z.ZodTypeAny, {
|
|
91
|
+
ai: {
|
|
92
|
+
provider: "openai" | "anthropic" | "openrouter" | "custom";
|
|
93
|
+
model: string;
|
|
94
|
+
apiKey?: string | undefined;
|
|
95
|
+
baseURL?: string | undefined;
|
|
96
|
+
maxTokens?: number | undefined;
|
|
97
|
+
temperature?: number | undefined;
|
|
98
|
+
context7Enabled?: boolean | undefined;
|
|
99
|
+
reasoning?: {
|
|
100
|
+
maxTokens?: number | undefined;
|
|
101
|
+
} | undefined;
|
|
102
|
+
};
|
|
103
|
+
workingDirectory?: string | undefined;
|
|
104
|
+
}, {
|
|
105
|
+
ai: {
|
|
106
|
+
provider: "openai" | "anthropic" | "openrouter" | "custom";
|
|
107
|
+
model: string;
|
|
108
|
+
apiKey?: string | undefined;
|
|
109
|
+
baseURL?: string | undefined;
|
|
110
|
+
maxTokens?: number | undefined;
|
|
111
|
+
temperature?: number | undefined;
|
|
112
|
+
context7Enabled?: boolean | undefined;
|
|
113
|
+
reasoning?: {
|
|
114
|
+
maxTokens?: number | undefined;
|
|
115
|
+
} | undefined;
|
|
116
|
+
};
|
|
117
|
+
workingDirectory?: string | undefined;
|
|
118
|
+
}>;
|
|
119
|
+
/**
|
|
120
|
+
* Validation result type
|
|
121
|
+
*/
|
|
122
|
+
export interface ValidationResult<T> {
|
|
123
|
+
success: boolean;
|
|
124
|
+
data?: T;
|
|
125
|
+
errors?: Array<{
|
|
126
|
+
path: string;
|
|
127
|
+
message: string;
|
|
128
|
+
}>;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Validate AI configuration
|
|
132
|
+
*
|
|
133
|
+
* @param config - AI configuration to validate
|
|
134
|
+
* @returns Validated and typed configuration
|
|
135
|
+
* @throws {TaskOMaticError} If validation fails
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* ```typescript
|
|
139
|
+
* const aiConfig = {
|
|
140
|
+
* provider: "openai",
|
|
141
|
+
* model: "gpt-4",
|
|
142
|
+
* temperature: 0.7,
|
|
143
|
+
* maxTokens: 4000
|
|
144
|
+
* };
|
|
145
|
+
*
|
|
146
|
+
* const validated = validateAIConfig(aiConfig);
|
|
147
|
+
* // validated is now type-safe and guaranteed valid
|
|
148
|
+
* ```
|
|
149
|
+
*/
|
|
150
|
+
export declare function validateAIConfig(config: unknown): z.infer<typeof AIConfigSchema>;
|
|
151
|
+
/**
|
|
152
|
+
* Validate full configuration object
|
|
153
|
+
*
|
|
154
|
+
* @param config - Configuration object to validate
|
|
155
|
+
* @returns Validated and typed configuration
|
|
156
|
+
* @throws {TaskOMaticError} If validation fails
|
|
157
|
+
*
|
|
158
|
+
* @example
|
|
159
|
+
* ```typescript
|
|
160
|
+
* const config = {
|
|
161
|
+
* ai: {
|
|
162
|
+
* provider: "anthropic",
|
|
163
|
+
* model: "claude-sonnet-4.5",
|
|
164
|
+
* temperature: 0.5
|
|
165
|
+
* },
|
|
166
|
+
* workingDirectory: "/path/to/project"
|
|
167
|
+
* };
|
|
168
|
+
*
|
|
169
|
+
* const validated = validateConfig(config);
|
|
170
|
+
* ```
|
|
171
|
+
*/
|
|
172
|
+
export declare function validateConfig(config: unknown): z.infer<typeof ConfigSchema>;
|
|
173
|
+
/**
|
|
174
|
+
* Safe validation that returns a result object instead of throwing
|
|
175
|
+
*
|
|
176
|
+
* @param config - Configuration to validate
|
|
177
|
+
* @returns Validation result with success flag and data or errors
|
|
178
|
+
*
|
|
179
|
+
* @example
|
|
180
|
+
* ```typescript
|
|
181
|
+
* const result = safeValidateConfig(userInput);
|
|
182
|
+
* if (result.success) {
|
|
183
|
+
* console.log("Valid config:", result.data);
|
|
184
|
+
* } else {
|
|
185
|
+
* console.error("Validation errors:", result.errors);
|
|
186
|
+
* }
|
|
187
|
+
* ```
|
|
188
|
+
*/
|
|
189
|
+
export declare function safeValidateConfig(config: unknown): ValidationResult<z.infer<typeof ConfigSchema>>;
|
|
190
|
+
/**
|
|
191
|
+
* Safe AI config validation
|
|
192
|
+
*
|
|
193
|
+
* @param config - AI configuration to validate
|
|
194
|
+
* @returns Validation result with success flag and data or errors
|
|
195
|
+
*/
|
|
196
|
+
export declare function safeValidateAIConfig(config: unknown): ValidationResult<z.infer<typeof AIConfigSchema>>;
|
|
197
|
+
/**
|
|
198
|
+
* Validate partial AI config (for updates)
|
|
199
|
+
*
|
|
200
|
+
* @param config - Partial AI configuration to validate
|
|
201
|
+
* @returns Validated partial configuration
|
|
202
|
+
* @throws {TaskOMaticError} If validation fails
|
|
203
|
+
*
|
|
204
|
+
* @example
|
|
205
|
+
* ```typescript
|
|
206
|
+
* // Only validating fields that are present
|
|
207
|
+
* const updates = {
|
|
208
|
+
* temperature: 0.8
|
|
209
|
+
* };
|
|
210
|
+
*
|
|
211
|
+
* const validated = validatePartialAIConfig(updates);
|
|
212
|
+
* ```
|
|
213
|
+
*/
|
|
214
|
+
export declare function validatePartialAIConfig(config: unknown): Partial<z.infer<typeof AIConfigSchema>>;
|
|
215
|
+
//# sourceMappingURL=config-validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version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BAAuB,CACrC,MAAM,EAAE,OAAO,GACd,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC,CAsBzC"}
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConfigSchema = exports.AIConfigSchema = exports.AIProviderSchema = void 0;
|
|
4
|
+
exports.validateAIConfig = validateAIConfig;
|
|
5
|
+
exports.validateConfig = validateConfig;
|
|
6
|
+
exports.safeValidateConfig = safeValidateConfig;
|
|
7
|
+
exports.safeValidateAIConfig = safeValidateAIConfig;
|
|
8
|
+
exports.validatePartialAIConfig = validatePartialAIConfig;
|
|
9
|
+
const zod_1 = require("zod");
|
|
10
|
+
const task_o_matic_error_1 = require("../utils/task-o-matic-error");
|
|
11
|
+
/**
|
|
12
|
+
* Zod schema for AI Provider
|
|
13
|
+
*/
|
|
14
|
+
exports.AIProviderSchema = zod_1.z.enum(["openai", "anthropic", "openrouter", "custom"], {
|
|
15
|
+
errorMap: () => ({
|
|
16
|
+
message: "Provider must be one of: openai, anthropic, openrouter, custom",
|
|
17
|
+
}),
|
|
18
|
+
});
|
|
19
|
+
/**
|
|
20
|
+
* Zod schema for AI Configuration
|
|
21
|
+
*/
|
|
22
|
+
exports.AIConfigSchema = zod_1.z.object({
|
|
23
|
+
provider: exports.AIProviderSchema,
|
|
24
|
+
model: zod_1.z.string().min(1, "Model name cannot be empty"),
|
|
25
|
+
apiKey: zod_1.z.string().optional(),
|
|
26
|
+
baseURL: zod_1.z.string().url("Base URL must be a valid URL").optional().or(zod_1.z.literal("")),
|
|
27
|
+
maxTokens: zod_1.z
|
|
28
|
+
.number()
|
|
29
|
+
.int("Max tokens must be an integer")
|
|
30
|
+
.positive("Max tokens must be positive")
|
|
31
|
+
.max(1000000, "Max tokens cannot exceed 1,000,000")
|
|
32
|
+
.optional(),
|
|
33
|
+
temperature: zod_1.z
|
|
34
|
+
.number()
|
|
35
|
+
.min(0, "Temperature must be between 0 and 2")
|
|
36
|
+
.max(2, "Temperature must be between 0 and 2")
|
|
37
|
+
.optional(),
|
|
38
|
+
context7Enabled: zod_1.z.boolean().optional(),
|
|
39
|
+
reasoning: zod_1.z
|
|
40
|
+
.object({
|
|
41
|
+
maxTokens: zod_1.z
|
|
42
|
+
.number()
|
|
43
|
+
.int("Reasoning max tokens must be an integer")
|
|
44
|
+
.positive("Reasoning max tokens must be positive")
|
|
45
|
+
.max(100000, "Reasoning max tokens cannot exceed 100,000")
|
|
46
|
+
.optional(),
|
|
47
|
+
})
|
|
48
|
+
.optional(),
|
|
49
|
+
});
|
|
50
|
+
/**
|
|
51
|
+
* Zod schema for full Config object
|
|
52
|
+
*/
|
|
53
|
+
exports.ConfigSchema = zod_1.z.object({
|
|
54
|
+
ai: exports.AIConfigSchema,
|
|
55
|
+
workingDirectory: zod_1.z.string().optional(),
|
|
56
|
+
});
|
|
57
|
+
/**
|
|
58
|
+
* Validate AI configuration
|
|
59
|
+
*
|
|
60
|
+
* @param config - AI configuration to validate
|
|
61
|
+
* @returns Validated and typed configuration
|
|
62
|
+
* @throws {TaskOMaticError} If validation fails
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```typescript
|
|
66
|
+
* const aiConfig = {
|
|
67
|
+
* provider: "openai",
|
|
68
|
+
* model: "gpt-4",
|
|
69
|
+
* temperature: 0.7,
|
|
70
|
+
* maxTokens: 4000
|
|
71
|
+
* };
|
|
72
|
+
*
|
|
73
|
+
* const validated = validateAIConfig(aiConfig);
|
|
74
|
+
* // validated is now type-safe and guaranteed valid
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
function validateAIConfig(config) {
|
|
78
|
+
try {
|
|
79
|
+
return exports.AIConfigSchema.parse(config);
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
if (error instanceof zod_1.z.ZodError) {
|
|
83
|
+
const errors = error.errors.map((err) => ({
|
|
84
|
+
path: err.path.join("."),
|
|
85
|
+
message: err.message,
|
|
86
|
+
}));
|
|
87
|
+
throw new task_o_matic_error_1.TaskOMaticError("AI configuration validation failed", {
|
|
88
|
+
code: task_o_matic_error_1.TaskOMaticErrorCodes.CONFIGURATION_ERROR,
|
|
89
|
+
context: JSON.stringify(config, null, 2),
|
|
90
|
+
suggestions: [
|
|
91
|
+
"Check that all required fields are present",
|
|
92
|
+
"Verify provider is one of: openai, anthropic, openrouter, custom",
|
|
93
|
+
"Ensure model name is not empty",
|
|
94
|
+
"Check temperature is between 0 and 2",
|
|
95
|
+
"Verify maxTokens is a positive integer",
|
|
96
|
+
...errors.map((e) => `Fix ${e.path}: ${e.message}`),
|
|
97
|
+
],
|
|
98
|
+
metadata: { errors },
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
throw error;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Validate full configuration object
|
|
106
|
+
*
|
|
107
|
+
* @param config - Configuration object to validate
|
|
108
|
+
* @returns Validated and typed configuration
|
|
109
|
+
* @throws {TaskOMaticError} If validation fails
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* ```typescript
|
|
113
|
+
* const config = {
|
|
114
|
+
* ai: {
|
|
115
|
+
* provider: "anthropic",
|
|
116
|
+
* model: "claude-sonnet-4.5",
|
|
117
|
+
* temperature: 0.5
|
|
118
|
+
* },
|
|
119
|
+
* workingDirectory: "/path/to/project"
|
|
120
|
+
* };
|
|
121
|
+
*
|
|
122
|
+
* const validated = validateConfig(config);
|
|
123
|
+
* ```
|
|
124
|
+
*/
|
|
125
|
+
function validateConfig(config) {
|
|
126
|
+
try {
|
|
127
|
+
return exports.ConfigSchema.parse(config);
|
|
128
|
+
}
|
|
129
|
+
catch (error) {
|
|
130
|
+
if (error instanceof zod_1.z.ZodError) {
|
|
131
|
+
const errors = error.errors.map((err) => ({
|
|
132
|
+
path: err.path.join("."),
|
|
133
|
+
message: err.message,
|
|
134
|
+
}));
|
|
135
|
+
throw new task_o_matic_error_1.TaskOMaticError("Configuration validation failed", {
|
|
136
|
+
code: task_o_matic_error_1.TaskOMaticErrorCodes.CONFIGURATION_ERROR,
|
|
137
|
+
context: JSON.stringify(config, null, 2),
|
|
138
|
+
suggestions: [
|
|
139
|
+
"Check that all required fields are present",
|
|
140
|
+
"Verify the configuration structure is correct",
|
|
141
|
+
...errors.map((e) => `Fix ${e.path}: ${e.message}`),
|
|
142
|
+
],
|
|
143
|
+
metadata: { errors },
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
throw error;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Safe validation that returns a result object instead of throwing
|
|
151
|
+
*
|
|
152
|
+
* @param config - Configuration to validate
|
|
153
|
+
* @returns Validation result with success flag and data or errors
|
|
154
|
+
*
|
|
155
|
+
* @example
|
|
156
|
+
* ```typescript
|
|
157
|
+
* const result = safeValidateConfig(userInput);
|
|
158
|
+
* if (result.success) {
|
|
159
|
+
* console.log("Valid config:", result.data);
|
|
160
|
+
* } else {
|
|
161
|
+
* console.error("Validation errors:", result.errors);
|
|
162
|
+
* }
|
|
163
|
+
* ```
|
|
164
|
+
*/
|
|
165
|
+
function safeValidateConfig(config) {
|
|
166
|
+
const result = exports.ConfigSchema.safeParse(config);
|
|
167
|
+
if (result.success) {
|
|
168
|
+
return {
|
|
169
|
+
success: true,
|
|
170
|
+
data: result.data,
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
return {
|
|
175
|
+
success: false,
|
|
176
|
+
errors: result.error.errors.map((err) => ({
|
|
177
|
+
path: err.path.join("."),
|
|
178
|
+
message: err.message,
|
|
179
|
+
})),
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Safe AI config validation
|
|
185
|
+
*
|
|
186
|
+
* @param config - AI configuration to validate
|
|
187
|
+
* @returns Validation result with success flag and data or errors
|
|
188
|
+
*/
|
|
189
|
+
function safeValidateAIConfig(config) {
|
|
190
|
+
const result = exports.AIConfigSchema.safeParse(config);
|
|
191
|
+
if (result.success) {
|
|
192
|
+
return {
|
|
193
|
+
success: true,
|
|
194
|
+
data: result.data,
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
return {
|
|
199
|
+
success: false,
|
|
200
|
+
errors: result.error.errors.map((err) => ({
|
|
201
|
+
path: err.path.join("."),
|
|
202
|
+
message: err.message,
|
|
203
|
+
})),
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Validate partial AI config (for updates)
|
|
209
|
+
*
|
|
210
|
+
* @param config - Partial AI configuration to validate
|
|
211
|
+
* @returns Validated partial configuration
|
|
212
|
+
* @throws {TaskOMaticError} If validation fails
|
|
213
|
+
*
|
|
214
|
+
* @example
|
|
215
|
+
* ```typescript
|
|
216
|
+
* // Only validating fields that are present
|
|
217
|
+
* const updates = {
|
|
218
|
+
* temperature: 0.8
|
|
219
|
+
* };
|
|
220
|
+
*
|
|
221
|
+
* const validated = validatePartialAIConfig(updates);
|
|
222
|
+
* ```
|
|
223
|
+
*/
|
|
224
|
+
function validatePartialAIConfig(config) {
|
|
225
|
+
try {
|
|
226
|
+
return exports.AIConfigSchema.partial().parse(config);
|
|
227
|
+
}
|
|
228
|
+
catch (error) {
|
|
229
|
+
if (error instanceof zod_1.z.ZodError) {
|
|
230
|
+
const errors = error.errors.map((err) => ({
|
|
231
|
+
path: err.path.join("."),
|
|
232
|
+
message: err.message,
|
|
233
|
+
}));
|
|
234
|
+
throw new task_o_matic_error_1.TaskOMaticError("AI configuration update validation failed", {
|
|
235
|
+
code: task_o_matic_error_1.TaskOMaticErrorCodes.CONFIGURATION_ERROR,
|
|
236
|
+
context: JSON.stringify(config, null, 2),
|
|
237
|
+
suggestions: [
|
|
238
|
+
"Check that field values are valid",
|
|
239
|
+
...errors.map((e) => `Fix ${e.path}: ${e.message}`),
|
|
240
|
+
],
|
|
241
|
+
metadata: { errors },
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
throw error;
|
|
245
|
+
}
|
|
246
|
+
}
|
package/dist/lib/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAA6C,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAA6C,MAAM,UAAU,CAAC;AAS/E,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,QAAQ,CAAC;IACb,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC9C,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrD,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;CAC7C;AA4CD,wBAAgB,4BAA4B,CAC1C,UAAU,GAAE,MAAc,GACzB,eAAe,CA+BjB;AAED,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,gBAAgB,CAAuB;IAC/C,OAAO,CAAC,SAAS,CAAkB;gBAEvB,SAAS,CAAC,EAAE,eAAe,EAAE,gBAAgB,CAAC,EAAE,MAAM;IAiBlE,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAQtC,YAAY,CAAC,SAAS,EAAE,eAAe,GAAG,IAAI;IAK9C,mBAAmB,IAAI,MAAM;IAI7B,gBAAgB,IAAI,MAAM;IAI1B,OAAO,CAAC,aAAa;IAoBf,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC;IA6CvB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAqB3B,SAAS,IAAI,MAAM;IAqBnB,WAAW,IAAI,QAAQ;IAIjB,WAAW,CAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAmB7D,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAK/B,iBAAiB,IAAI,MAAM;CAG5B;AAED,eAAO,MAAM,aAAa,eAAsB,CAAC;AAEjD;;;;;;;;;;;;GAYG;AACH,wBAAsB,qBAAqB,CACzC,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,aAA6B,GACrC,OAAO,CAAC,MAAM,CAAC,CAGjB"}
|
package/dist/lib/config.js
CHANGED
|
@@ -7,6 +7,8 @@ const path_1 = require("path");
|
|
|
7
7
|
const process_1 = require("process");
|
|
8
8
|
const fs_1 = require("fs");
|
|
9
9
|
const dotenv_1 = require("dotenv");
|
|
10
|
+
const config_validation_1 = require("./config-validation");
|
|
11
|
+
const task_o_matic_error_1 = require("../utils/task-o-matic-error");
|
|
10
12
|
// Provider-specific sensible defaults for 2025
|
|
11
13
|
const PROVIDER_DEFAULTS = {
|
|
12
14
|
openrouter: {
|
|
@@ -140,28 +142,35 @@ class ConfigManager {
|
|
|
140
142
|
const configData = await this.callbacks.read("config.json");
|
|
141
143
|
if (configData) {
|
|
142
144
|
const fileConfig = JSON.parse(configData);
|
|
143
|
-
|
|
145
|
+
const mergedConfig = {
|
|
144
146
|
...defaultConfig,
|
|
145
147
|
...fileConfig,
|
|
146
148
|
ai: { ...defaultConfig.ai, ...fileConfig.ai, ...envConfig },
|
|
147
149
|
};
|
|
150
|
+
// Validate the merged configuration
|
|
151
|
+
const validatedConfig = (0, config_validation_1.validateConfig)(mergedConfig);
|
|
152
|
+
this.config = validatedConfig;
|
|
148
153
|
if (this.config && this.config.workingDirectory) {
|
|
149
154
|
this.customWorkingDir = this.config.workingDirectory;
|
|
150
155
|
}
|
|
151
156
|
}
|
|
152
157
|
else {
|
|
153
|
-
|
|
158
|
+
// Validate default config too
|
|
159
|
+
this.config = (0, config_validation_1.validateConfig)(defaultConfig);
|
|
154
160
|
}
|
|
155
161
|
}
|
|
156
162
|
catch (error) {
|
|
157
|
-
console.warn("Failed to read config, using defaults:", error);
|
|
158
|
-
|
|
163
|
+
console.warn("Failed to read or validate config, using defaults:", error);
|
|
164
|
+
// Even defaults should be validated
|
|
165
|
+
this.config = (0, config_validation_1.validateConfig)(defaultConfig);
|
|
159
166
|
}
|
|
160
167
|
return this.config;
|
|
161
168
|
}
|
|
162
169
|
async save() {
|
|
163
170
|
if (!this.config) {
|
|
164
|
-
throw
|
|
171
|
+
throw (0, task_o_matic_error_1.createStandardError)(task_o_matic_error_1.TaskOMaticErrorCodes.CONFIGURATION_ERROR, "Config not loaded, cannot save.", {
|
|
172
|
+
suggestions: ["Call await configManager.load() before saving"],
|
|
173
|
+
});
|
|
165
174
|
}
|
|
166
175
|
try {
|
|
167
176
|
await this.callbacks.write("config.json", JSON.stringify(this.config, null, 2));
|
|
@@ -177,7 +186,13 @@ class ConfigManager {
|
|
|
177
186
|
// Since we can't be async here, we must throw or return defaults.
|
|
178
187
|
// Returning defaults might hide issues.
|
|
179
188
|
// Throwing forces users to await load().
|
|
180
|
-
throw
|
|
189
|
+
throw (0, task_o_matic_error_1.createStandardError)(task_o_matic_error_1.TaskOMaticErrorCodes.CONFIGURATION_ERROR, "Config not loaded. Call await configManager.load() first.", {
|
|
190
|
+
context: "Configuration must be loaded before access",
|
|
191
|
+
suggestions: [
|
|
192
|
+
"Call await configManager.load() first",
|
|
193
|
+
"Check initialization order",
|
|
194
|
+
],
|
|
195
|
+
});
|
|
181
196
|
}
|
|
182
197
|
return this.config;
|
|
183
198
|
}
|
|
@@ -188,7 +203,15 @@ class ConfigManager {
|
|
|
188
203
|
if (!this.config) {
|
|
189
204
|
await this.load();
|
|
190
205
|
}
|
|
191
|
-
|
|
206
|
+
// Validate the partial config before merging
|
|
207
|
+
const validatedPartial = (0, config_validation_1.validatePartialAIConfig)(aiConfig);
|
|
208
|
+
// Merge and validate the full config
|
|
209
|
+
const mergedAIConfig = { ...this.config.ai, ...validatedPartial };
|
|
210
|
+
const validatedConfig = (0, config_validation_1.validateConfig)({
|
|
211
|
+
...this.config,
|
|
212
|
+
ai: mergedAIConfig,
|
|
213
|
+
});
|
|
214
|
+
this.config = validatedConfig;
|
|
192
215
|
await this.save();
|
|
193
216
|
}
|
|
194
217
|
setConfig(config) {
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -57,7 +57,7 @@ export type { CreateTaskOptions, SplitTaskOptions, PlanTaskOptions, EnhanceTaskO
|
|
|
57
57
|
* Factory functions for getting singleton instances of core services
|
|
58
58
|
* These ensure only one instance exists throughout the application
|
|
59
59
|
*/
|
|
60
|
-
export { getAIOperations, getModelProvider, getStorage, getContextBuilder, resetServiceInstances, } from "../utils/ai-service-factory";
|
|
60
|
+
export { getAIOperations, getModelProvider, getStorage, getContextBuilder, resetServiceInstances, initializeServices, } from "../utils/ai-service-factory";
|
|
61
61
|
/**
|
|
62
62
|
* AI configuration builder utility
|
|
63
63
|
*/
|
package/dist/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAMH;;;GAGG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;GAGG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C;;;GAGG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD;;;GAGG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAMzD;;GAEG;AACH,YAAY,EACV,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,2BAA2B,CAAC;AAMnC;;;GAGG;AACH,cAAc,UAAU,CAAC;AAEzB;;GAEG;AACH,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D;;GAEG;AACH,YAAY,EACV,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAM1B;;;GAGG;AACH,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,iBAAiB,EACjB,qBAAqB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAMH;;;GAGG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;GAGG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C;;;GAGG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD;;;GAGG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAMzD;;GAEG;AACH,YAAY,EACV,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,2BAA2B,CAAC;AAMnC;;;GAGG;AACH,cAAc,UAAU,CAAC;AAEzB;;GAEG;AACH,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D;;GAEG;AACH,YAAY,EACV,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAM1B;;;GAGG;AACH,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,6BAA6B,CAAC;AAErC;;GAEG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,YAAY,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAM5D;;;GAGG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,YAAY,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD;;GAEG;AACH,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAExD;;GAEG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D;;GAEG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D;;GAEG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;GAEG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAMjD;;GAEG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D;;GAEG;AACH,OAAO,EACL,sBAAsB,EACtB,wCAAwC,GACzC,MAAM,4BAA4B,CAAC;AAMpC;;GAEG;AACH,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/lib/index.js
CHANGED
|
@@ -32,7 +32,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
32
32
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
33
33
|
};
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.runValidations = exports.isValidAIProvider = exports.createStreamingOptionsWithCustomHandlers = exports.createStreamingOptions = exports.formatStackInfo = exports.PromptBuilder = exports.ContextBuilder = exports.ModelProvider = exports.AIOperations = exports.configManager = exports.ConfigManager = exports.FileSystemStorage = exports.buildAIConfig = exports.resetServiceInstances = exports.getContextBuilder = exports.getStorage = exports.getModelProvider = exports.getAIOperations = exports.BenchmarkService = exports.WorkflowService = exports.PRDService = exports.TaskService = void 0;
|
|
35
|
+
exports.runValidations = exports.isValidAIProvider = exports.createStreamingOptionsWithCustomHandlers = exports.createStreamingOptions = exports.formatStackInfo = exports.PromptBuilder = exports.ContextBuilder = exports.ModelProvider = exports.AIOperations = exports.configManager = exports.ConfigManager = exports.FileSystemStorage = exports.buildAIConfig = exports.initializeServices = exports.resetServiceInstances = exports.getContextBuilder = exports.getStorage = exports.getModelProvider = exports.getAIOperations = exports.BenchmarkService = exports.WorkflowService = exports.PRDService = exports.TaskService = void 0;
|
|
36
36
|
// ============================================================================
|
|
37
37
|
// Main Services - Business Logic Layer
|
|
38
38
|
// ============================================================================
|
|
@@ -81,6 +81,7 @@ Object.defineProperty(exports, "getModelProvider", { enumerable: true, get: func
|
|
|
81
81
|
Object.defineProperty(exports, "getStorage", { enumerable: true, get: function () { return ai_service_factory_1.getStorage; } });
|
|
82
82
|
Object.defineProperty(exports, "getContextBuilder", { enumerable: true, get: function () { return ai_service_factory_1.getContextBuilder; } });
|
|
83
83
|
Object.defineProperty(exports, "resetServiceInstances", { enumerable: true, get: function () { return ai_service_factory_1.resetServiceInstances; } });
|
|
84
|
+
Object.defineProperty(exports, "initializeServices", { enumerable: true, get: function () { return ai_service_factory_1.initializeServices; } });
|
|
84
85
|
/**
|
|
85
86
|
* AI configuration builder utility
|
|
86
87
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-system.d.ts","sourceRoot":"","sources":["../../../src/lib/storage/file-system.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEtE,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EACL,gBAAgB,EAEjB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"file-system.d.ts","sourceRoot":"","sources":["../../../src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