@alfe.ai/integration-manifest 0.0.11 → 0.1.0
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 +45 -3
- package/dist/index.js +25 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -28,6 +28,10 @@ interface ConfigSchemaField {
|
|
|
28
28
|
select_options?: SelectOption[];
|
|
29
29
|
/** OAuth provider identifier for oauth_connect fields */
|
|
30
30
|
oauth_provider?: string;
|
|
31
|
+
/** Force specific scope groups for OAuth (e.g. ["chat"]) — hides other scopes in the dashboard */
|
|
32
|
+
oauth_scopes?: string[];
|
|
33
|
+
/** Integration ID to patch on OAuth callback (when using a shared OAuth provider) */
|
|
34
|
+
oauth_integration_id?: string;
|
|
31
35
|
/** If true, this field is not shown in the dashboard UI (install wizard or configure modal) */
|
|
32
36
|
hidden?: boolean;
|
|
33
37
|
/** Only show this field if another field has a truthy value (string) or matches a specific value (object) */
|
|
@@ -45,11 +49,39 @@ interface McpServerDeclaration {
|
|
|
45
49
|
command: string;
|
|
46
50
|
/** Arguments for the command */
|
|
47
51
|
args?: string[];
|
|
48
|
-
/**
|
|
52
|
+
/**
|
|
53
|
+
* Environment variables. Two interpolation syntaxes are supported:
|
|
54
|
+
*
|
|
55
|
+
* - `{{config.KEY}}` — resolved from the integration's user-supplied
|
|
56
|
+
* config + secrets via `resolveConfig()`. Existing behavior.
|
|
57
|
+
* - `{{credentials.<provider>.<field>}}` — resolved by the
|
|
58
|
+
* `mcp-applier` via `AgentApiClient.get<Provider>Credentials()`.
|
|
59
|
+
* `<provider>` is the OAuth provider key (`atlassian`, `github`,
|
|
60
|
+
* `xero`, `notion`, `myob`, …); `<field>` is a top-level key on the
|
|
61
|
+
* credentials response (`accessToken`, `clientId`, `cloudId`, …).
|
|
62
|
+
* Used in conjunction with `requires_credentials` to signal the
|
|
63
|
+
* precondition.
|
|
64
|
+
*/
|
|
49
65
|
env?: Record<string, string>;
|
|
50
66
|
/** Working directory (optional) */
|
|
51
67
|
cwd?: string;
|
|
52
|
-
/**
|
|
68
|
+
/**
|
|
69
|
+
* OAuth provider whose credentials this server requires. When set and
|
|
70
|
+
* the credentials are missing or 404, the applier logs and skips
|
|
71
|
+
* registration silently — same graceful no-op the `post_activate.mjs`
|
|
72
|
+
* hooks do today. Pair with `{{credentials.<provider>.<field>}}` env
|
|
73
|
+
* references; the explicit field is preferred over inferring from the
|
|
74
|
+
* presence of the interpolation pattern for clarity.
|
|
75
|
+
*/
|
|
76
|
+
requires_credentials?: string;
|
|
77
|
+
/**
|
|
78
|
+
* @deprecated As of 2026-05-18 the `mcp-applier` handles every case
|
|
79
|
+
* end-to-end (config + credentials interpolation, requires_credentials
|
|
80
|
+
* skip-silently, manager.addServer with owner attribution). The
|
|
81
|
+
* legacy `OpenClawApplier.applyMcpServers` path has been deleted so
|
|
82
|
+
* the field is now accepted but completely ignored on parse. Drop
|
|
83
|
+
* from new manifests.
|
|
84
|
+
*/
|
|
53
85
|
hook_managed?: boolean;
|
|
54
86
|
}
|
|
55
87
|
interface CommandDeclaration {
|
|
@@ -257,6 +289,7 @@ declare const McpServerDeclarationSchema: z.ZodObject<{
|
|
|
257
289
|
args: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
258
290
|
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
259
291
|
cwd: z.ZodOptional<z.ZodString>;
|
|
292
|
+
requires_credentials: z.ZodOptional<z.ZodString>;
|
|
260
293
|
hook_managed: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
261
294
|
}, z.core.$strip>;
|
|
262
295
|
declare const CommandDeclarationSchema: z.ZodObject<{
|
|
@@ -397,6 +430,7 @@ declare const IntegrationManifestSchema: z.ZodObject<{
|
|
|
397
430
|
args: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
398
431
|
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
399
432
|
cwd: z.ZodOptional<z.ZodString>;
|
|
433
|
+
requires_credentials: z.ZodOptional<z.ZodString>;
|
|
400
434
|
hook_managed: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
401
435
|
}, z.core.$strip>>>>;
|
|
402
436
|
repository: z.ZodOptional<z.ZodURL>;
|
|
@@ -443,6 +477,14 @@ declare function buildConfigValidationSchema(configSchema: z.infer<typeof Config
|
|
|
443
477
|
type ManifestSchemaType = z.infer<typeof IntegrationManifestSchema>;
|
|
444
478
|
//#endregion
|
|
445
479
|
//#region src/parser.d.ts
|
|
480
|
+
/**
|
|
481
|
+
* Pluggable warn-sink for parse-time advisories. Defaults to the
|
|
482
|
+
* Node `console.warn` so the message lands in the right place
|
|
483
|
+
* regardless of which logger the caller uses; callers that want
|
|
484
|
+
* structured logs can override.
|
|
485
|
+
*/
|
|
486
|
+
type ParseWarner = (message: string, meta?: Record<string, unknown>) => void;
|
|
487
|
+
declare function setParseWarner(warner: ParseWarner): void;
|
|
446
488
|
declare class ManifestParseError extends Error {
|
|
447
489
|
readonly issues?: {
|
|
448
490
|
path: string;
|
|
@@ -569,4 +611,4 @@ declare function migrateConfig(currentConfig: Record<string, unknown>, diff: Con
|
|
|
569
611
|
warnings: string[];
|
|
570
612
|
};
|
|
571
613
|
//#endregion
|
|
572
|
-
export { type AgentRuntime, type CommandContext, type CommandDeclaration, CommandDeclarationSchema, type CommandHandlerFn, type CommandResult, type ConfigFieldType, ConfigFieldTypeSchema, type ConfigSchemaDiff, type ConfigSchemaField, ConfigSchemaFieldSchema, type HealthCheckResult, type HealthReport, type InstallTargets, InstallTargetsSchema, type IntegrationHooks, IntegrationHooksSchema, type IntegrationManifest, IntegrationManifestSchema, type IntegrationPricing, type IntegrationPricingPlan, type IntegrationStateEntry, type IntegrationStatus, type IntegrationsStateFile, type InterpolationContext, ManifestParseError, type ManifestSchemaType, type McpServerDeclaration, McpServerDeclarationSchema, type PluginInstall, PluginInstallSchema, type PublishedIntegration, type PublishedVersion, type RuntimeInstall, RuntimeInstallSchema, type SelectOption, SelectOptionSchema, type SkillInstall, SkillInstallSchema, buildConfigValidationSchema, diffConfigSchemas, extractTemplateReferences, interpolateConfig, isRelativePath, migrateConfig, parseManifestFile, parseManifestString, resolveAssetUrl };
|
|
614
|
+
export { type AgentRuntime, type CommandContext, type CommandDeclaration, CommandDeclarationSchema, type CommandHandlerFn, type CommandResult, type ConfigFieldType, ConfigFieldTypeSchema, type ConfigSchemaDiff, type ConfigSchemaField, ConfigSchemaFieldSchema, type HealthCheckResult, type HealthReport, type InstallTargets, InstallTargetsSchema, type IntegrationHooks, IntegrationHooksSchema, type IntegrationManifest, IntegrationManifestSchema, type IntegrationPricing, type IntegrationPricingPlan, type IntegrationStateEntry, type IntegrationStatus, type IntegrationsStateFile, type InterpolationContext, ManifestParseError, type ManifestSchemaType, type McpServerDeclaration, McpServerDeclarationSchema, type ParseWarner, type PluginInstall, PluginInstallSchema, type PublishedIntegration, type PublishedVersion, type RuntimeInstall, RuntimeInstallSchema, type SelectOption, SelectOptionSchema, type SkillInstall, SkillInstallSchema, buildConfigValidationSchema, diffConfigSchemas, extractTemplateReferences, interpolateConfig, isRelativePath, migrateConfig, parseManifestFile, parseManifestString, resolveAssetUrl, setParseWarner };
|
package/dist/index.js
CHANGED
|
@@ -65,6 +65,7 @@ const McpServerDeclarationSchema = z.object({
|
|
|
65
65
|
args: z.array(z.string()).optional().default([]),
|
|
66
66
|
env: z.record(z.string(), z.string()).optional(),
|
|
67
67
|
cwd: z.string().optional(),
|
|
68
|
+
requires_credentials: z.string().min(1).optional(),
|
|
68
69
|
hook_managed: z.boolean().optional().default(false)
|
|
69
70
|
});
|
|
70
71
|
const CommandDeclarationSchema = z.object({
|
|
@@ -217,6 +218,13 @@ function buildConfigValidationSchema(configSchema) {
|
|
|
217
218
|
* and validates against the Zod schema. Returns a fully typed
|
|
218
219
|
* IntegrationManifest or throws a descriptive error.
|
|
219
220
|
*/
|
|
221
|
+
let parseWarner = (msg, meta) => {
|
|
222
|
+
if (meta && Object.keys(meta).length > 0) console.warn(`[integration-manifest] ${msg}`, meta);
|
|
223
|
+
else console.warn(`[integration-manifest] ${msg}`);
|
|
224
|
+
};
|
|
225
|
+
function setParseWarner(warner) {
|
|
226
|
+
parseWarner = warner;
|
|
227
|
+
}
|
|
220
228
|
var ManifestParseError = class extends Error {
|
|
221
229
|
constructor(message, issues) {
|
|
222
230
|
super(message);
|
|
@@ -248,7 +256,22 @@ function parseManifestString(yaml, overrides) {
|
|
|
248
256
|
}));
|
|
249
257
|
throw new ManifestParseError(`Invalid integration manifest:\n${issues.map((i) => ` ${i.path ? `${i.path}: ` : ""}${i.message}`).join("\n")}`, issues);
|
|
250
258
|
}
|
|
251
|
-
|
|
259
|
+
const manifest = result.data;
|
|
260
|
+
warnDeprecatedFields(manifest);
|
|
261
|
+
return manifest;
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Emit one-time-per-parse advisories for fields that pass schema
|
|
265
|
+
* validation but are deprecated. The flag is accepted-but-ignored,
|
|
266
|
+
* not rejected — the warn is the only signal manifest authors get
|
|
267
|
+
* since the `@deprecated` JSDoc only surfaces in TS callers' IDEs.
|
|
268
|
+
*/
|
|
269
|
+
function warnDeprecatedFields(manifest) {
|
|
270
|
+
const hookManagedServers = manifest.mcp_servers.filter((s) => s.hook_managed === true).map((s) => s.id);
|
|
271
|
+
if (hookManagedServers.length > 0) parseWarner(`manifest "${manifest.id}" declares mcp_servers with deprecated hook_managed:true — drop the field, the mcp-applier handles every case end-to-end now`, {
|
|
272
|
+
integration: manifest.id,
|
|
273
|
+
servers: hookManagedServers
|
|
274
|
+
});
|
|
252
275
|
}
|
|
253
276
|
/**
|
|
254
277
|
* Read and parse an alfe-integration.yaml file from disk.
|
|
@@ -398,4 +421,4 @@ function migrateConfig(currentConfig, diff) {
|
|
|
398
421
|
};
|
|
399
422
|
}
|
|
400
423
|
//#endregion
|
|
401
|
-
export { CommandDeclarationSchema, ConfigFieldTypeSchema, ConfigSchemaFieldSchema, InstallTargetsSchema, IntegrationHooksSchema, IntegrationManifestSchema, ManifestParseError, McpServerDeclarationSchema, PluginInstallSchema, RuntimeInstallSchema, SelectOptionSchema, SkillInstallSchema, buildConfigValidationSchema, diffConfigSchemas, extractTemplateReferences, interpolateConfig, isRelativePath, migrateConfig, parseManifestFile, parseManifestString, resolveAssetUrl };
|
|
424
|
+
export { CommandDeclarationSchema, ConfigFieldTypeSchema, ConfigSchemaFieldSchema, InstallTargetsSchema, IntegrationHooksSchema, IntegrationManifestSchema, ManifestParseError, McpServerDeclarationSchema, PluginInstallSchema, RuntimeInstallSchema, SelectOptionSchema, SkillInstallSchema, buildConfigValidationSchema, diffConfigSchemas, extractTemplateReferences, interpolateConfig, isRelativePath, migrateConfig, parseManifestFile, parseManifestString, resolveAssetUrl, setParseWarner };
|