@alfe.ai/integration-manifest 0.0.10 → 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 +47 -3
- package/dist/index.js +31 -3
- 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>;
|
|
@@ -404,6 +438,8 @@ declare const IntegrationManifestSchema: z.ZodObject<{
|
|
|
404
438
|
supported_scopes: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
405
439
|
agent: "agent";
|
|
406
440
|
org: "org";
|
|
441
|
+
team: "team";
|
|
442
|
+
project: "project";
|
|
407
443
|
}>>>>;
|
|
408
444
|
publisherId: z.ZodOptional<z.ZodString>;
|
|
409
445
|
icon: z.ZodOptional<z.ZodString>;
|
|
@@ -441,6 +477,14 @@ declare function buildConfigValidationSchema(configSchema: z.infer<typeof Config
|
|
|
441
477
|
type ManifestSchemaType = z.infer<typeof IntegrationManifestSchema>;
|
|
442
478
|
//#endregion
|
|
443
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;
|
|
444
488
|
declare class ManifestParseError extends Error {
|
|
445
489
|
readonly issues?: {
|
|
446
490
|
path: string;
|
|
@@ -567,4 +611,4 @@ declare function migrateConfig(currentConfig: Record<string, unknown>, diff: Con
|
|
|
567
611
|
warnings: string[];
|
|
568
612
|
};
|
|
569
613
|
//#endregion
|
|
570
|
-
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({
|
|
@@ -150,7 +151,12 @@ const IntegrationManifestSchema = z.object({
|
|
|
150
151
|
mcp_servers: z.array(McpServerDeclarationSchema).optional().default([]),
|
|
151
152
|
repository: z.url().optional(),
|
|
152
153
|
supported_agents: z.array(RuntimeKeySchema).optional(),
|
|
153
|
-
supported_scopes: z.array(z.enum([
|
|
154
|
+
supported_scopes: z.array(z.enum([
|
|
155
|
+
"agent",
|
|
156
|
+
"org",
|
|
157
|
+
"team",
|
|
158
|
+
"project"
|
|
159
|
+
])).optional().default(["agent"]),
|
|
154
160
|
publisherId: z.string().optional(),
|
|
155
161
|
icon: z.string().optional(),
|
|
156
162
|
pricing: IntegrationPricingSchema.optional(),
|
|
@@ -212,6 +218,13 @@ function buildConfigValidationSchema(configSchema) {
|
|
|
212
218
|
* and validates against the Zod schema. Returns a fully typed
|
|
213
219
|
* IntegrationManifest or throws a descriptive error.
|
|
214
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
|
+
}
|
|
215
228
|
var ManifestParseError = class extends Error {
|
|
216
229
|
constructor(message, issues) {
|
|
217
230
|
super(message);
|
|
@@ -243,7 +256,22 @@ function parseManifestString(yaml, overrides) {
|
|
|
243
256
|
}));
|
|
244
257
|
throw new ManifestParseError(`Invalid integration manifest:\n${issues.map((i) => ` ${i.path ? `${i.path}: ` : ""}${i.message}`).join("\n")}`, issues);
|
|
245
258
|
}
|
|
246
|
-
|
|
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
|
+
});
|
|
247
275
|
}
|
|
248
276
|
/**
|
|
249
277
|
* Read and parse an alfe-integration.yaml file from disk.
|
|
@@ -393,4 +421,4 @@ function migrateConfig(currentConfig, diff) {
|
|
|
393
421
|
};
|
|
394
422
|
}
|
|
395
423
|
//#endregion
|
|
396
|
-
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 };
|