@alfe.ai/integration-manifest 0.0.3 → 0.0.4
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/index.d.ts +5 -4
- package/dist/index.js +8 -3
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -99,8 +99,8 @@ interface IntegrationManifest {
|
|
|
99
99
|
config_schema: ConfigSchemaField[];
|
|
100
100
|
capabilities: string[];
|
|
101
101
|
hooks: IntegrationHooks;
|
|
102
|
-
/** Git repository URL (HTTPS
|
|
103
|
-
repository
|
|
102
|
+
/** Git repository URL (HTTPS) — not present in YAML, injected by the publish API */
|
|
103
|
+
repository?: string;
|
|
104
104
|
/**
|
|
105
105
|
* Agent runtimes this integration supports.
|
|
106
106
|
* If omitted or empty, the integration is considered universal (all runtimes).
|
|
@@ -318,7 +318,7 @@ declare const IntegrationManifestSchema: z.ZodObject<{
|
|
|
318
318
|
post_uninstall: z.ZodOptional<z.ZodString>;
|
|
319
319
|
health_check: z.ZodOptional<z.ZodString>;
|
|
320
320
|
}, z.core.$strip>>>;
|
|
321
|
-
repository: z.ZodURL
|
|
321
|
+
repository: z.ZodOptional<z.ZodURL>;
|
|
322
322
|
supported_agents: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
323
323
|
publisherId: z.ZodOptional<z.ZodString>;
|
|
324
324
|
icon: z.ZodOptional<z.ZodString>;
|
|
@@ -366,8 +366,9 @@ declare class ManifestParseError extends Error {
|
|
|
366
366
|
}
|
|
367
367
|
/**
|
|
368
368
|
* Parse a raw YAML string into a validated IntegrationManifest.
|
|
369
|
+
* Optional overrides are merged into the parsed YAML before validation.
|
|
369
370
|
*/
|
|
370
|
-
declare function parseManifestString(yaml: string): IntegrationManifest;
|
|
371
|
+
declare function parseManifestString(yaml: string, overrides?: Record<string, unknown>): IntegrationManifest;
|
|
371
372
|
/**
|
|
372
373
|
* Read and parse an alfe-integration.yaml file from disk.
|
|
373
374
|
*/
|
package/dist/index.js
CHANGED
|
@@ -122,7 +122,7 @@ const IntegrationManifestSchema = z.object({
|
|
|
122
122
|
config_schema: z.array(ConfigSchemaFieldSchema).optional().default([]),
|
|
123
123
|
capabilities: z.array(z.string()).optional().default([]),
|
|
124
124
|
hooks: IntegrationHooksSchema.optional().default({}),
|
|
125
|
-
repository: z.url(),
|
|
125
|
+
repository: z.url().optional(),
|
|
126
126
|
supported_agents: z.array(RuntimeKeySchema).optional(),
|
|
127
127
|
publisherId: z.string().optional(),
|
|
128
128
|
icon: z.string().optional(),
|
|
@@ -197,8 +197,9 @@ var ManifestParseError = class extends Error {
|
|
|
197
197
|
};
|
|
198
198
|
/**
|
|
199
199
|
* Parse a raw YAML string into a validated IntegrationManifest.
|
|
200
|
+
* Optional overrides are merged into the parsed YAML before validation.
|
|
200
201
|
*/
|
|
201
|
-
function parseManifestString(yaml) {
|
|
202
|
+
function parseManifestString(yaml, overrides) {
|
|
202
203
|
let raw;
|
|
203
204
|
try {
|
|
204
205
|
raw = parse(yaml);
|
|
@@ -206,7 +207,11 @@ function parseManifestString(yaml) {
|
|
|
206
207
|
throw new ManifestParseError(`Invalid YAML: ${err instanceof Error ? err.message : String(err)}`);
|
|
207
208
|
}
|
|
208
209
|
if (typeof raw !== "object" || raw === null) throw new ManifestParseError("Manifest must be a YAML object");
|
|
209
|
-
const
|
|
210
|
+
const merged = overrides ? {
|
|
211
|
+
...raw,
|
|
212
|
+
...overrides
|
|
213
|
+
} : raw;
|
|
214
|
+
const result = IntegrationManifestSchema.safeParse(merged);
|
|
210
215
|
if (!result.success) {
|
|
211
216
|
const issues = result.error.issues.map((i) => ({
|
|
212
217
|
path: i.path.join("."),
|