@enactprotocol/shared 2.0.0 → 2.0.2
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/config.d.ts +164 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +386 -0
- package/dist/config.js.map +1 -0
- package/dist/constants.d.ts +17 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +26 -0
- package/dist/constants.js.map +1 -0
- package/dist/execution/command.d.ts +102 -0
- package/dist/execution/command.d.ts.map +1 -0
- package/dist/execution/command.js +262 -0
- package/dist/execution/command.js.map +1 -0
- package/dist/execution/index.d.ts +12 -0
- package/dist/execution/index.d.ts.map +1 -0
- package/dist/execution/index.js +17 -0
- package/dist/execution/index.js.map +1 -0
- package/dist/execution/runtime.d.ts +82 -0
- package/dist/execution/runtime.d.ts.map +1 -0
- package/dist/execution/runtime.js +273 -0
- package/dist/execution/runtime.js.map +1 -0
- package/dist/execution/types.d.ts +306 -0
- package/dist/execution/types.d.ts.map +1 -0
- package/dist/execution/types.js +14 -0
- package/dist/execution/types.js.map +1 -0
- package/dist/execution/validation.d.ts +43 -0
- package/dist/execution/validation.d.ts.map +1 -0
- package/dist/execution/validation.js +430 -0
- package/dist/execution/validation.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +49 -0
- package/dist/index.js.map +1 -0
- package/dist/manifest/index.d.ts +7 -0
- package/dist/manifest/index.d.ts.map +1 -0
- package/dist/manifest/index.js +10 -0
- package/dist/manifest/index.js.map +1 -0
- package/dist/manifest/loader.d.ts +76 -0
- package/dist/manifest/loader.d.ts.map +1 -0
- package/dist/manifest/loader.js +146 -0
- package/dist/manifest/loader.js.map +1 -0
- package/dist/manifest/parser.d.ts +64 -0
- package/dist/manifest/parser.d.ts.map +1 -0
- package/dist/manifest/parser.js +135 -0
- package/dist/manifest/parser.js.map +1 -0
- package/dist/manifest/validator.d.ts +95 -0
- package/dist/manifest/validator.d.ts.map +1 -0
- package/dist/manifest/validator.js +258 -0
- package/dist/manifest/validator.js.map +1 -0
- package/dist/paths.d.ts +57 -0
- package/dist/paths.d.ts.map +1 -0
- package/dist/paths.js +93 -0
- package/dist/paths.js.map +1 -0
- package/dist/registry.d.ts +73 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +147 -0
- package/dist/registry.js.map +1 -0
- package/dist/resolver.d.ts +89 -0
- package/dist/resolver.d.ts.map +1 -0
- package/dist/resolver.js +282 -0
- package/dist/resolver.js.map +1 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +5 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/manifest.d.ts +201 -0
- package/dist/types/manifest.d.ts.map +1 -0
- package/dist/types/manifest.js +13 -0
- package/dist/types/manifest.js.map +1 -0
- package/dist/types.d.ts +5 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/fs.d.ts +105 -0
- package/dist/utils/fs.d.ts.map +1 -0
- package/dist/utils/fs.js +233 -0
- package/dist/utils/fs.js.map +1 -0
- package/dist/utils/logger.d.ts +112 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +232 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/version.d.ts +62 -0
- package/dist/utils/version.d.ts.map +1 -0
- package/dist/utils/version.js +259 -0
- package/dist/utils/version.js.map +1 -0
- package/package.json +2 -2
- package/src/config.ts +36 -2
- package/src/index.ts +1 -0
- package/tests/config.test.ts +190 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Input validation using JSON Schema
|
|
3
|
+
*
|
|
4
|
+
* Validates tool inputs against the manifest's inputSchema.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Validate inputs against a JSON Schema
|
|
8
|
+
*
|
|
9
|
+
* @param inputs - The inputs to validate
|
|
10
|
+
* @param schema - The JSON Schema to validate against
|
|
11
|
+
* @returns Validation result with errors and coerced values
|
|
12
|
+
*/
|
|
13
|
+
export function validateInputs(inputs, schema) {
|
|
14
|
+
// If no schema, everything is valid
|
|
15
|
+
if (!schema) {
|
|
16
|
+
return { valid: true, errors: [], coercedValues: inputs };
|
|
17
|
+
}
|
|
18
|
+
const errors = [];
|
|
19
|
+
const coercedValues = { ...inputs };
|
|
20
|
+
// Check schema type (should be object)
|
|
21
|
+
if (schema.type !== "object") {
|
|
22
|
+
return { valid: true, errors: [], coercedValues: inputs };
|
|
23
|
+
}
|
|
24
|
+
const properties = schema.properties || {};
|
|
25
|
+
const required = schema.required || [];
|
|
26
|
+
// Check required properties
|
|
27
|
+
for (const propName of required) {
|
|
28
|
+
if (inputs[propName] === undefined) {
|
|
29
|
+
errors.push({
|
|
30
|
+
path: `params.${propName}`,
|
|
31
|
+
message: `Missing required parameter: ${propName}`,
|
|
32
|
+
expected: "value",
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
// Validate each property
|
|
37
|
+
for (const [propName, propValue] of Object.entries(inputs)) {
|
|
38
|
+
const propSchema = properties[propName];
|
|
39
|
+
if (propSchema) {
|
|
40
|
+
const propErrors = validateProperty(propName, propValue, propSchema);
|
|
41
|
+
errors.push(...propErrors);
|
|
42
|
+
// Attempt type coercion
|
|
43
|
+
const coerced = coerceValue(propValue, propSchema);
|
|
44
|
+
if (coerced !== undefined) {
|
|
45
|
+
coercedValues[propName] = coerced;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
// Check for additional properties if not allowed
|
|
50
|
+
if (schema.additionalProperties === false) {
|
|
51
|
+
for (const propName of Object.keys(inputs)) {
|
|
52
|
+
if (!properties[propName]) {
|
|
53
|
+
errors.push({
|
|
54
|
+
path: `params.${propName}`,
|
|
55
|
+
message: `Unknown parameter: ${propName}`,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return {
|
|
61
|
+
valid: errors.length === 0,
|
|
62
|
+
errors,
|
|
63
|
+
coercedValues,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Validate a single property against its schema
|
|
68
|
+
*/
|
|
69
|
+
function validateProperty(name, value, schema) {
|
|
70
|
+
const errors = [];
|
|
71
|
+
const path = `params.${name}`;
|
|
72
|
+
// Type validation
|
|
73
|
+
if (schema.type) {
|
|
74
|
+
const typeValid = validateType(value, schema.type);
|
|
75
|
+
if (!typeValid) {
|
|
76
|
+
errors.push({
|
|
77
|
+
path,
|
|
78
|
+
message: `Invalid type for ${name}: expected ${schema.type}, got ${typeof value}`,
|
|
79
|
+
expected: String(schema.type),
|
|
80
|
+
actual: value,
|
|
81
|
+
});
|
|
82
|
+
return errors; // Skip further validation if type is wrong
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
// String validations
|
|
86
|
+
if (typeof value === "string") {
|
|
87
|
+
// minLength
|
|
88
|
+
if (schema.minLength !== undefined && value.length < schema.minLength) {
|
|
89
|
+
errors.push({
|
|
90
|
+
path,
|
|
91
|
+
message: `${name} must be at least ${schema.minLength} characters`,
|
|
92
|
+
expected: `minLength: ${schema.minLength}`,
|
|
93
|
+
actual: value,
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
// maxLength
|
|
97
|
+
if (schema.maxLength !== undefined && value.length > schema.maxLength) {
|
|
98
|
+
errors.push({
|
|
99
|
+
path,
|
|
100
|
+
message: `${name} must be at most ${schema.maxLength} characters`,
|
|
101
|
+
expected: `maxLength: ${schema.maxLength}`,
|
|
102
|
+
actual: value,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
// pattern
|
|
106
|
+
if (schema.pattern) {
|
|
107
|
+
const regex = new RegExp(schema.pattern);
|
|
108
|
+
if (!regex.test(value)) {
|
|
109
|
+
errors.push({
|
|
110
|
+
path,
|
|
111
|
+
message: `${name} must match pattern: ${schema.pattern}`,
|
|
112
|
+
expected: `pattern: ${schema.pattern}`,
|
|
113
|
+
actual: value,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
// format (basic support)
|
|
118
|
+
if (schema.format) {
|
|
119
|
+
const formatError = validateFormat(value, schema.format);
|
|
120
|
+
if (formatError) {
|
|
121
|
+
errors.push({
|
|
122
|
+
path,
|
|
123
|
+
message: `${name}: ${formatError}`,
|
|
124
|
+
expected: `format: ${schema.format}`,
|
|
125
|
+
actual: value,
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
// Number validations
|
|
131
|
+
if (typeof value === "number") {
|
|
132
|
+
// minimum
|
|
133
|
+
if (schema.minimum !== undefined && value < schema.minimum) {
|
|
134
|
+
errors.push({
|
|
135
|
+
path,
|
|
136
|
+
message: `${name} must be >= ${schema.minimum}`,
|
|
137
|
+
expected: `minimum: ${schema.minimum}`,
|
|
138
|
+
actual: value,
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
// maximum
|
|
142
|
+
if (schema.maximum !== undefined && value > schema.maximum) {
|
|
143
|
+
errors.push({
|
|
144
|
+
path,
|
|
145
|
+
message: `${name} must be <= ${schema.maximum}`,
|
|
146
|
+
expected: `maximum: ${schema.maximum}`,
|
|
147
|
+
actual: value,
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
// exclusiveMinimum
|
|
151
|
+
if (schema.exclusiveMinimum !== undefined && value <= schema.exclusiveMinimum) {
|
|
152
|
+
errors.push({
|
|
153
|
+
path,
|
|
154
|
+
message: `${name} must be > ${schema.exclusiveMinimum}`,
|
|
155
|
+
expected: `exclusiveMinimum: ${schema.exclusiveMinimum}`,
|
|
156
|
+
actual: value,
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
// exclusiveMaximum
|
|
160
|
+
if (schema.exclusiveMaximum !== undefined && value >= schema.exclusiveMaximum) {
|
|
161
|
+
errors.push({
|
|
162
|
+
path,
|
|
163
|
+
message: `${name} must be < ${schema.exclusiveMaximum}`,
|
|
164
|
+
expected: `exclusiveMaximum: ${schema.exclusiveMaximum}`,
|
|
165
|
+
actual: value,
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
// multipleOf
|
|
169
|
+
if (schema.multipleOf !== undefined && value % schema.multipleOf !== 0) {
|
|
170
|
+
errors.push({
|
|
171
|
+
path,
|
|
172
|
+
message: `${name} must be a multiple of ${schema.multipleOf}`,
|
|
173
|
+
expected: `multipleOf: ${schema.multipleOf}`,
|
|
174
|
+
actual: value,
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
// Enum validation
|
|
179
|
+
if (schema.enum && !schema.enum.includes(value)) {
|
|
180
|
+
errors.push({
|
|
181
|
+
path,
|
|
182
|
+
message: `${name} must be one of: ${schema.enum.join(", ")}`,
|
|
183
|
+
expected: `enum: [${schema.enum.join(", ")}]`,
|
|
184
|
+
actual: value,
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
// Const validation
|
|
188
|
+
if (schema.const !== undefined && value !== schema.const) {
|
|
189
|
+
errors.push({
|
|
190
|
+
path,
|
|
191
|
+
message: `${name} must be: ${schema.const}`,
|
|
192
|
+
expected: `const: ${schema.const}`,
|
|
193
|
+
actual: value,
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
// Array validations
|
|
197
|
+
if (Array.isArray(value)) {
|
|
198
|
+
// minItems
|
|
199
|
+
if (schema.minItems !== undefined && value.length < schema.minItems) {
|
|
200
|
+
errors.push({
|
|
201
|
+
path,
|
|
202
|
+
message: `${name} must have at least ${schema.minItems} items`,
|
|
203
|
+
expected: `minItems: ${schema.minItems}`,
|
|
204
|
+
actual: value,
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
// maxItems
|
|
208
|
+
if (schema.maxItems !== undefined && value.length > schema.maxItems) {
|
|
209
|
+
errors.push({
|
|
210
|
+
path,
|
|
211
|
+
message: `${name} must have at most ${schema.maxItems} items`,
|
|
212
|
+
expected: `maxItems: ${schema.maxItems}`,
|
|
213
|
+
actual: value,
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
// uniqueItems
|
|
217
|
+
if (schema.uniqueItems) {
|
|
218
|
+
const seen = new Set();
|
|
219
|
+
const hasDuplicates = value.some((item) => {
|
|
220
|
+
const key = JSON.stringify(item);
|
|
221
|
+
if (seen.has(key))
|
|
222
|
+
return true;
|
|
223
|
+
seen.add(key);
|
|
224
|
+
return false;
|
|
225
|
+
});
|
|
226
|
+
if (hasDuplicates) {
|
|
227
|
+
errors.push({
|
|
228
|
+
path,
|
|
229
|
+
message: `${name} must contain unique items`,
|
|
230
|
+
expected: "uniqueItems: true",
|
|
231
|
+
actual: value,
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
return errors;
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Validate a value matches the expected type
|
|
240
|
+
*/
|
|
241
|
+
function validateType(value, type) {
|
|
242
|
+
if (type === undefined)
|
|
243
|
+
return true;
|
|
244
|
+
// Handle array of types
|
|
245
|
+
if (Array.isArray(type)) {
|
|
246
|
+
return type.some((t) => validateType(value, t));
|
|
247
|
+
}
|
|
248
|
+
switch (type) {
|
|
249
|
+
case "string":
|
|
250
|
+
return typeof value === "string";
|
|
251
|
+
case "number":
|
|
252
|
+
return typeof value === "number" && !Number.isNaN(value);
|
|
253
|
+
case "integer":
|
|
254
|
+
return typeof value === "number" && Number.isInteger(value);
|
|
255
|
+
case "boolean":
|
|
256
|
+
return typeof value === "boolean";
|
|
257
|
+
case "array":
|
|
258
|
+
return Array.isArray(value);
|
|
259
|
+
case "object":
|
|
260
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
261
|
+
case "null":
|
|
262
|
+
return value === null;
|
|
263
|
+
default:
|
|
264
|
+
return true;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Validate string format
|
|
269
|
+
*/
|
|
270
|
+
function validateFormat(value, format) {
|
|
271
|
+
switch (format) {
|
|
272
|
+
case "email": {
|
|
273
|
+
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
274
|
+
if (!emailRegex.test(value)) {
|
|
275
|
+
return "Invalid email format";
|
|
276
|
+
}
|
|
277
|
+
break;
|
|
278
|
+
}
|
|
279
|
+
case "uri":
|
|
280
|
+
case "url": {
|
|
281
|
+
try {
|
|
282
|
+
new URL(value);
|
|
283
|
+
}
|
|
284
|
+
catch {
|
|
285
|
+
return "Invalid URL format";
|
|
286
|
+
}
|
|
287
|
+
break;
|
|
288
|
+
}
|
|
289
|
+
case "date": {
|
|
290
|
+
const dateRegex = /^\d{4}-\d{2}-\d{2}$/;
|
|
291
|
+
if (!dateRegex.test(value) || Number.isNaN(Date.parse(value))) {
|
|
292
|
+
return "Invalid date format (expected YYYY-MM-DD)";
|
|
293
|
+
}
|
|
294
|
+
break;
|
|
295
|
+
}
|
|
296
|
+
case "date-time": {
|
|
297
|
+
if (Number.isNaN(Date.parse(value))) {
|
|
298
|
+
return "Invalid date-time format";
|
|
299
|
+
}
|
|
300
|
+
break;
|
|
301
|
+
}
|
|
302
|
+
case "time": {
|
|
303
|
+
const timeRegex = /^\d{2}:\d{2}(:\d{2})?$/;
|
|
304
|
+
if (!timeRegex.test(value)) {
|
|
305
|
+
return "Invalid time format (expected HH:MM or HH:MM:SS)";
|
|
306
|
+
}
|
|
307
|
+
break;
|
|
308
|
+
}
|
|
309
|
+
case "uuid": {
|
|
310
|
+
const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
311
|
+
if (!uuidRegex.test(value)) {
|
|
312
|
+
return "Invalid UUID format";
|
|
313
|
+
}
|
|
314
|
+
break;
|
|
315
|
+
}
|
|
316
|
+
case "hostname": {
|
|
317
|
+
const hostnameRegex = /^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
|
|
318
|
+
if (!hostnameRegex.test(value)) {
|
|
319
|
+
return "Invalid hostname format";
|
|
320
|
+
}
|
|
321
|
+
break;
|
|
322
|
+
}
|
|
323
|
+
case "ipv4": {
|
|
324
|
+
const ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
|
|
325
|
+
if (!ipv4Regex.test(value)) {
|
|
326
|
+
return "Invalid IPv4 format";
|
|
327
|
+
}
|
|
328
|
+
break;
|
|
329
|
+
}
|
|
330
|
+
// Note: Add more formats as needed
|
|
331
|
+
}
|
|
332
|
+
return null;
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Attempt to coerce a value to match the schema type
|
|
336
|
+
*/
|
|
337
|
+
function coerceValue(value, schema) {
|
|
338
|
+
if (value === undefined || value === null) {
|
|
339
|
+
return schema.default;
|
|
340
|
+
}
|
|
341
|
+
const type = schema.type;
|
|
342
|
+
if (!type || Array.isArray(type)) {
|
|
343
|
+
return value;
|
|
344
|
+
}
|
|
345
|
+
// String coercion
|
|
346
|
+
if (type === "string" && typeof value !== "string") {
|
|
347
|
+
return String(value);
|
|
348
|
+
}
|
|
349
|
+
// Number coercion
|
|
350
|
+
if ((type === "number" || type === "integer") && typeof value === "string") {
|
|
351
|
+
const parsed = Number(value);
|
|
352
|
+
if (!Number.isNaN(parsed)) {
|
|
353
|
+
if (type === "integer") {
|
|
354
|
+
return Math.floor(parsed);
|
|
355
|
+
}
|
|
356
|
+
return parsed;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
// Boolean coercion
|
|
360
|
+
if (type === "boolean" && typeof value === "string") {
|
|
361
|
+
if (value.toLowerCase() === "true")
|
|
362
|
+
return true;
|
|
363
|
+
if (value.toLowerCase() === "false")
|
|
364
|
+
return false;
|
|
365
|
+
}
|
|
366
|
+
return value;
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* Apply default values from schema to inputs
|
|
370
|
+
*
|
|
371
|
+
* @param inputs - Current inputs
|
|
372
|
+
* @param schema - Input schema with defaults
|
|
373
|
+
* @returns Inputs with defaults applied
|
|
374
|
+
*/
|
|
375
|
+
export function applyDefaults(inputs, schema) {
|
|
376
|
+
if (!schema || schema.type !== "object" || !schema.properties) {
|
|
377
|
+
return inputs;
|
|
378
|
+
}
|
|
379
|
+
const result = { ...inputs };
|
|
380
|
+
for (const [propName, propSchema] of Object.entries(schema.properties)) {
|
|
381
|
+
if (result[propName] === undefined) {
|
|
382
|
+
const prop = propSchema;
|
|
383
|
+
if (prop.default !== undefined) {
|
|
384
|
+
result[propName] = prop.default;
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
return result;
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* Get the list of required parameters from a schema
|
|
392
|
+
*
|
|
393
|
+
* @param schema - Input schema
|
|
394
|
+
* @returns Array of required parameter names
|
|
395
|
+
*/
|
|
396
|
+
export function getRequiredParams(schema) {
|
|
397
|
+
if (!schema || !schema.required) {
|
|
398
|
+
return [];
|
|
399
|
+
}
|
|
400
|
+
return [...schema.required];
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* Get parameter info from schema for help/documentation
|
|
404
|
+
*
|
|
405
|
+
* @param schema - Input schema
|
|
406
|
+
* @returns Map of parameter name to info
|
|
407
|
+
*/
|
|
408
|
+
export function getParamInfo(schema) {
|
|
409
|
+
const info = new Map();
|
|
410
|
+
if (!schema || schema.type !== "object" || !schema.properties) {
|
|
411
|
+
return info;
|
|
412
|
+
}
|
|
413
|
+
const required = new Set(schema.required || []);
|
|
414
|
+
for (const [propName, propSchema] of Object.entries(schema.properties)) {
|
|
415
|
+
const prop = propSchema;
|
|
416
|
+
const entry = {
|
|
417
|
+
type: Array.isArray(prop.type) ? prop.type.join(" | ") : prop.type || "any",
|
|
418
|
+
required: required.has(propName),
|
|
419
|
+
};
|
|
420
|
+
if (prop.description !== undefined) {
|
|
421
|
+
entry.description = prop.description;
|
|
422
|
+
}
|
|
423
|
+
if (prop.default !== undefined) {
|
|
424
|
+
entry.default = prop.default;
|
|
425
|
+
}
|
|
426
|
+
info.set(propName, entry);
|
|
427
|
+
}
|
|
428
|
+
return info;
|
|
429
|
+
}
|
|
430
|
+
//# sourceMappingURL=validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../src/execution/validation.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAC5B,MAA+B,EAC/B,MAA+B;IAE/B,oCAAoC;IACpC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE,CAAC;IAC5D,CAAC;IAED,MAAM,MAAM,GAA2B,EAAE,CAAC;IAC1C,MAAM,aAAa,GAA4B,EAAE,GAAG,MAAM,EAAE,CAAC;IAE7D,uCAAuC;IACvC,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7B,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE,CAAC;IAC5D,CAAC;IAED,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,IAAI,EAAE,CAAC;IAC3C,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,IAAI,EAAE,CAAC;IAEvC,4BAA4B;IAC5B,KAAK,MAAM,QAAQ,IAAI,QAAQ,EAAE,CAAC;QAChC,IAAI,MAAM,CAAC,QA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C,QAAQ,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC;QACvE,MAAM,IAAI,GAAG,UAAyB,CAAC;QACvC,MAAM,KAAK,GAKP;YACF,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,IAAI,KAAK;YAC3E,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC;SACjC,CAAC;QACF,IAAI,IAAI,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;YACnC,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;QACvC,CAAC;QACD,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YAC/B,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC/B,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @enactprotocol/shared
|
|
3
|
+
*
|
|
4
|
+
* Core business logic and utilities for Enact.
|
|
5
|
+
* Provides manifest parsing, configuration management, tool resolution,
|
|
6
|
+
* and execution engine interfaces.
|
|
7
|
+
*/
|
|
8
|
+
export declare const version = "0.1.0";
|
|
9
|
+
export { ENACT_BASE_URL, ENACT_API_URL, ENACT_WEB_URL, ENACT_TOOL_TYPE, ENACT_AUDIT_TYPE, ENACT_BUILD_TYPE, INTOTO_STATEMENT_TYPE, SLSA_PROVENANCE_TYPE, } from "./constants";
|
|
10
|
+
export { getEnactHome, getProjectEnactDir, getToolsDir, getCacheDir, getConfigPath, getGlobalEnvPath, getProjectEnvPath, type ToolScope, } from "./paths";
|
|
11
|
+
export { loadConfig, saveConfig, getConfigValue, setConfigValue, resetConfig, configExists, ensureGlobalSetup, DEFAULT_CONFIG, getTrustedIdentities, addTrustedIdentity, removeTrustedIdentity, isIdentityTrusted, getMinimumAttestations, getTrustPolicy, emailToProviderIdentity, getTrustedAuditors, addTrustedAuditor, removeTrustedAuditor, isAuditorTrusted, type EnactConfig, type TrustConfig, type CacheConfig, type ExecutionConfig, type RegistryConfig, } from "./config";
|
|
12
|
+
export type { ToolManifest, PackageManifest, ParsedManifest, EnvVariable, EnvVariables, Author, ToolAnnotations, ResourceRequirements, ToolExample, ValidationResult, ValidationError, ValidationWarning, ToolLocation, ToolResolution, ManifestFileName, } from "./types/manifest";
|
|
13
|
+
export { MANIFEST_FILES, PACKAGE_MANIFEST_FILE } from "./types/manifest";
|
|
14
|
+
export { ManifestParseError, parseManifest, parseManifestAuto, parseYaml, extractFrontmatter, detectFormat, type ManifestFormat, validateManifest, validateManifestStrict, isValidToolName, isValidVersion, isValidTimeout, ToolManifestSchema, ManifestLoadError, loadManifest, loadManifestFromDir, findManifestFile, hasManifest, tryLoadManifest, tryLoadManifestFromDir, type LoadedManifest, } from "./manifest";
|
|
15
|
+
export { ToolResolveError, resolveTool, resolveToolAuto, resolveToolFromPath, tryResolveTool, normalizeToolName, toolNameToPath, getToolPath, getToolSearchPaths, type ResolveOptions, } from "./resolver";
|
|
16
|
+
export { loadToolsRegistry, saveToolsRegistry, addToolToRegistry, removeToolFromRegistry, isToolInstalled, getInstalledVersion, getToolCachePath, listInstalledTools, getInstalledToolInfo, getToolsJsonPath, type ToolsRegistry, type RegistryScope, type InstalledToolInfo, } from "./registry";
|
|
17
|
+
export { Logger, createLogger, configureLogger, getLogger, debug, info, warn, error, type LogLevel, type LogEntry, type LoggerOptions, } from "./utils/logger";
|
|
18
|
+
export { parseVersion, isValidVersion as isValidSemver, compareVersions, parseRange, satisfiesRange, sortVersions, getHighestVersion, incrementVersion, coerceVersion, formatVersion, type ParsedVersion, type VersionRange, } from "./utils/version";
|
|
19
|
+
export { ensureDir, ensureParentDir, pathExists, isDirectory, isFile, readJsonFile, tryReadJsonFile, writeJsonFile, readTextFile, tryReadTextFile, writeTextFile, copyFile, copyDir, remove, listDir, listDirEntries, findFiles, findFilesRecursive, getStats, getFileSize, touchFile, } from "./utils/fs";
|
|
20
|
+
export { type ExecutionInput, type FileInput, type ExecutionOutput, type ExecutionResult, type ExecutionMetadata, type ExecutionError, type ExecutionErrorCode, type ExecutionOptions, type RetryConfig, type ContainerRuntime, type RuntimeDetection, type RuntimeStatus, type EngineHealth, type EngineState, type ExecutionProvider, type ParsedCommand, type CommandToken, type InterpolationOptions, type InputValidationResult, type InputValidationError, type DryRunResult, DEFAULT_RETRY_CONFIG, detectRuntime, clearRuntimeCache, isRuntimeAvailable, getAvailableRuntimes, RuntimeStatusTracker, createRuntimeTracker, parseCommand, interpolateCommand, shellEscape, parseCommandArgs, prepareCommand, getMissingParams, validateInputs, applyDefaults, getRequiredParams, getParamInfo, } from "./execution";
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,OAAO,UAAU,CAAC;AAG/B,OAAO,EACL,cAAc,EACd,aAAa,EACb,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,WAAW,EACX,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,KAAK,SAAS,GACf,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,UAAU,EACV,UAAU,EACV,cAAc,EACd,cAAc,EACd,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,cA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Y,EACZ,kBAAkB,EAClB,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAEhB,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,YAAY,GACb,MAAM,aAAa,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @enactprotocol/shared
|
|
3
|
+
*
|
|
4
|
+
* Core business logic and utilities for Enact.
|
|
5
|
+
* Provides manifest parsing, configuration management, tool resolution,
|
|
6
|
+
* and execution engine interfaces.
|
|
7
|
+
*/
|
|
8
|
+
export const version = "0.1.0";
|
|
9
|
+
// Constants
|
|
10
|
+
export { ENACT_BASE_URL, ENACT_API_URL, ENACT_WEB_URL, ENACT_TOOL_TYPE, ENACT_AUDIT_TYPE, ENACT_BUILD_TYPE, INTOTO_STATEMENT_TYPE, SLSA_PROVENANCE_TYPE, } from "./constants";
|
|
11
|
+
// Path utilities
|
|
12
|
+
export { getEnactHome, getProjectEnactDir, getToolsDir, getCacheDir, getConfigPath, getGlobalEnvPath, getProjectEnvPath, } from "./paths";
|
|
13
|
+
// Configuration manager
|
|
14
|
+
export { loadConfig, saveConfig, getConfigValue, setConfigValue, resetConfig, configExists, ensureGlobalSetup, DEFAULT_CONFIG,
|
|
15
|
+
// Local trust management (new unified API)
|
|
16
|
+
getTrustedIdentities, addTrustedIdentity, removeTrustedIdentity, isIdentityTrusted, getMinimumAttestations, getTrustPolicy, emailToProviderIdentity,
|
|
17
|
+
// Legacy aliases (deprecated)
|
|
18
|
+
getTrustedAuditors, addTrustedAuditor, removeTrustedAuditor, isAuditorTrusted, } from "./config";
|
|
19
|
+
export { MANIFEST_FILES, PACKAGE_MANIFEST_FILE } from "./types/manifest";
|
|
20
|
+
// Manifest parsing, validation, and loading
|
|
21
|
+
export {
|
|
22
|
+
// Parser
|
|
23
|
+
ManifestParseError, parseManifest, parseManifestAuto, parseYaml, extractFrontmatter, detectFormat,
|
|
24
|
+
// Validator
|
|
25
|
+
validateManifest, validateManifestStrict, isValidToolName, isValidVersion, isValidTimeout, ToolManifestSchema,
|
|
26
|
+
// Loader
|
|
27
|
+
ManifestLoadError, loadManifest, loadManifestFromDir, findManifestFile, hasManifest, tryLoadManifest, tryLoadManifestFromDir, } from "./manifest";
|
|
28
|
+
// Tool resolver
|
|
29
|
+
export { ToolResolveError, resolveTool, resolveToolAuto, resolveToolFromPath, tryResolveTool, normalizeToolName, toolNameToPath, getToolPath, getToolSearchPaths, } from "./resolver";
|
|
30
|
+
// Local tool registry (tools.json management)
|
|
31
|
+
export { loadToolsRegistry, saveToolsRegistry, addToolToRegistry, removeToolFromRegistry, isToolInstalled, getInstalledVersion, getToolCachePath, listInstalledTools, getInstalledToolInfo, getToolsJsonPath, } from "./registry";
|
|
32
|
+
// Logger utility
|
|
33
|
+
export { Logger, createLogger, configureLogger, getLogger, debug, info, warn, error, } from "./utils/logger";
|
|
34
|
+
// Version utilities
|
|
35
|
+
export { parseVersion, isValidVersion as isValidSemver, compareVersions, parseRange, satisfiesRange, sortVersions, getHighestVersion, incrementVersion, coerceVersion, formatVersion, } from "./utils/version";
|
|
36
|
+
// File system helpers
|
|
37
|
+
export { ensureDir, ensureParentDir, pathExists, isDirectory, isFile, readJsonFile, tryReadJsonFile, writeJsonFile, readTextFile, tryReadTextFile, writeTextFile, copyFile, copyDir, remove, listDir, listDirEntries, findFiles, findFilesRecursive, getStats, getFileSize, touchFile, } from "./utils/fs";
|
|
38
|
+
// Execution engine (browser-safe utilities only)
|
|
39
|
+
// NOTE: DaggerExecutionProvider moved to @enactprotocol/execution package
|
|
40
|
+
export {
|
|
41
|
+
// Constants
|
|
42
|
+
DEFAULT_RETRY_CONFIG,
|
|
43
|
+
// Runtime
|
|
44
|
+
detectRuntime, clearRuntimeCache, isRuntimeAvailable, getAvailableRuntimes, RuntimeStatusTracker, createRuntimeTracker,
|
|
45
|
+
// Command
|
|
46
|
+
parseCommand, interpolateCommand, shellEscape, parseCommandArgs, prepareCommand, getMissingParams,
|
|
47
|
+
// Validation
|
|
48
|
+
validateInputs, applyDefaults, getRequiredParams, getParamInfo, } from "./execution";
|
|
49
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC;AAE/B,YAAY;AACZ,OAAO,EACL,cAAc,EACd,aAAa,EACb,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,aAAa,CAAC;AAErB,iBAAiB;AACjB,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,WAAW,EACX,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,iBAAiB,GAElB,MAAM,SAAS,CAAC;AAEjB,wBAAwB;AACxB,OAAO,EACL,UAAU,EACV,UAAU,EACV,cAAc,EACd,cAAc,EACd,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,cAAc;AACd,2CAA2C;AAC3C,oBAAoB,EACpB,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EACjB,sBAAsB,EACtB,cAAc,EACd,uBAAuB;AACvB,8BAA8B;AAC9B,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,GAMjB,MAAM,UAAU,CAAC;AAqBlB,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAEzE,4CAA4C;AAC5C,OAAO;AACL,SAAS;AACT,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EACjB,SAAS,EACT,kBAAkB,EAClB,YAAY;AAEZ,YAAY;AACZ,gBAAgB,EAChB,sBAAsB,EACtB,eAAe,EACf,cAAc,EACd,cAAc,EACd,kBAAkB;AAClB,SAAS;AACT,iBAAiB,EACjB,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB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EAClB,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,gBAAgB;AAChB,aAAa;AACb,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,YAAY,GACb,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Manifest module exports
|
|
3
|
+
*/
|
|
4
|
+
export { ManifestParseError, parseManifest, parseManifestAuto, parseYaml, extractFrontmatter, detectFormat, type ManifestFormat, } from "./parser";
|
|
5
|
+
export { validateManifest, validateManifestStrict, isValidToolName, isValidVersion, isValidTimeout, ToolManifestSchema, } from "./validator";
|
|
6
|
+
export { ManifestLoadError, loadManifest, loadManifestFromDir, findManifestFile, hasManifest, tryLoadManifest, tryLoadManifestFromDir, type LoadedManifest, } from "./loader";
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/manifest/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EACjB,SAAS,EACT,kBAAkB,EAClB,YAAY,EACZ,KAAK,cAAc,GACpB,MAAM,UAAU,CAAC;AAGlB,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,eAAe,EACf,cAAc,EACd,cAAc,EACd,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,sBAAsB,EACtB,KAAK,cAAc,GACpB,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Manifest module exports
|
|
3
|
+
*/
|
|
4
|
+
// Parser
|
|
5
|
+
export { ManifestParseError, parseManifest, parseManifestAuto, parseYaml, extractFrontmatter, detectFormat, } from "./parser";
|
|
6
|
+
// Validator
|
|
7
|
+
export { validateManifest, validateManifestStrict, isValidToolName, isValidVersion, isValidTimeout, ToolManifestSchema, } from "./validator";
|
|
8
|
+
// Loader
|
|
9
|
+
export { ManifestLoadError, loadManifest, loadManifestFromDir, findManifestFile, hasManifest, tryLoadManifest, tryLoadManifestFromDir, } from "./loader";
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/manifest/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,SAAS;AACT,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EACjB,SAAS,EACT,kBAAkB,EAClB,YAAY,GAEb,MAAM,UAAU,CAAC;AAElB,YAAY;AACZ,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,eAAe,EACf,cAAc,EACd,cAAc,EACd,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAErB,SAAS;AACT,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,sBAAsB,GAEvB,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Manifest loader - combines parsing and validation
|
|
3
|
+
*
|
|
4
|
+
* Provides high-level functions to load tool manifests from files
|
|
5
|
+
*/
|
|
6
|
+
import type { ToolManifest, ValidationResult } from "../types/manifest";
|
|
7
|
+
/**
|
|
8
|
+
* Error thrown when loading a manifest fails
|
|
9
|
+
*/
|
|
10
|
+
export declare class ManifestLoadError extends Error {
|
|
11
|
+
readonly filePath: string;
|
|
12
|
+
readonly originalError?: Error | undefined;
|
|
13
|
+
constructor(message: string, filePath: string, originalError?: Error | undefined);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Result of loading a manifest
|
|
17
|
+
*/
|
|
18
|
+
export interface LoadedManifest {
|
|
19
|
+
/** The validated manifest */
|
|
20
|
+
manifest: ToolManifest;
|
|
21
|
+
/** The markdown body (if from .md file) */
|
|
22
|
+
body?: string;
|
|
23
|
+
/** The format the manifest was loaded from */
|
|
24
|
+
format: "yaml" | "md";
|
|
25
|
+
/** The file path the manifest was loaded from */
|
|
26
|
+
filePath: string;
|
|
27
|
+
/** Validation warnings (if any) */
|
|
28
|
+
warnings?: ValidationResult["warnings"];
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Load a manifest from a file path
|
|
32
|
+
*
|
|
33
|
+
* @param filePath - Path to the manifest file (enact.yaml, enact.yml, or enact.md)
|
|
34
|
+
* @returns LoadedManifest with validated manifest and metadata
|
|
35
|
+
* @throws ManifestLoadError if file doesn't exist, parse fails, or validation fails
|
|
36
|
+
*/
|
|
37
|
+
export declare function loadManifest(filePath: string): LoadedManifest;
|
|
38
|
+
/**
|
|
39
|
+
* Find and load a manifest from a directory
|
|
40
|
+
*
|
|
41
|
+
* Searches for enact.md, enact.yaml, or enact.yml in the given directory
|
|
42
|
+
*
|
|
43
|
+
* @param dir - Directory to search for manifest
|
|
44
|
+
* @returns LoadedManifest if found
|
|
45
|
+
* @throws ManifestLoadError if no manifest found or loading fails
|
|
46
|
+
*/
|
|
47
|
+
export declare function loadManifestFromDir(dir: string): LoadedManifest;
|
|
48
|
+
/**
|
|
49
|
+
* Find a manifest file in a directory without loading it
|
|
50
|
+
*
|
|
51
|
+
* @param dir - Directory to search
|
|
52
|
+
* @returns Path to manifest file or null if not found
|
|
53
|
+
*/
|
|
54
|
+
export declare function findManifestFile(dir: string): string | null;
|
|
55
|
+
/**
|
|
56
|
+
* Check if a directory contains a manifest file
|
|
57
|
+
*
|
|
58
|
+
* @param dir - Directory to check
|
|
59
|
+
* @returns true if a manifest file exists
|
|
60
|
+
*/
|
|
61
|
+
export declare function hasManifest(dir: string): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Try to load a manifest, returning null instead of throwing
|
|
64
|
+
*
|
|
65
|
+
* @param filePath - Path to the manifest file
|
|
66
|
+
* @returns LoadedManifest or null if loading fails
|
|
67
|
+
*/
|
|
68
|
+
export declare function tryLoadManifest(filePath: string): LoadedManifest | null;
|
|
69
|
+
/**
|
|
70
|
+
* Try to load a manifest from a directory, returning null instead of throwing
|
|
71
|
+
*
|
|
72
|
+
* @param dir - Directory to search
|
|
73
|
+
* @returns LoadedManifest or null if no manifest found or loading fails
|
|
74
|
+
*/
|
|
75
|
+
export declare function tryLoadManifestFromDir(dir: string): LoadedManifest | null;
|
|
76
|
+
//# sourceMappingURL=loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/manifest/loader.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAkB,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAKxF;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;aAGxB,QAAQ,EAAE,MAAM;aAChB,aAAa,CAAC,EAAE,KAAK;gBAFrC,OAAO,EAAE,MAAM,EACC,QAAQ,EAAE,MAAM,EAChB,aAAa,CAAC,EAAE,KAAK,YAAA;CAKxC;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,6BAA6B;IAC7B,QAAQ,EAAE,YAAY,CAAC;IACvB,2CAA2C;IAC3C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,iDAAiD;IACjD,QAAQ,EAAE,MAAM,CAAC;IACjB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAC;CACzC;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc,CA0D7D;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAa/D;AAED;;;;;GAKG;A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