@alfe.ai/integration-manifest 0.0.5 → 0.0.6
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 +54 -1
- package/dist/index.js +9 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -36,6 +36,18 @@ interface ConfigSchemaField {
|
|
|
36
36
|
/** Only show this field if a specific integration is installed */
|
|
37
37
|
depends_on_integration?: string;
|
|
38
38
|
}
|
|
39
|
+
interface CommandDeclaration {
|
|
40
|
+
/** Dot-namespaced command name (e.g. "support.diagnostic") */
|
|
41
|
+
name: string;
|
|
42
|
+
/** Relative path to handler file within integration directory */
|
|
43
|
+
handler: string;
|
|
44
|
+
/** Exported function name (default: "handle") */
|
|
45
|
+
method?: string;
|
|
46
|
+
/** Timeout in milliseconds (default: 30000) */
|
|
47
|
+
timeout_ms?: number;
|
|
48
|
+
/** Human-readable description */
|
|
49
|
+
description?: string;
|
|
50
|
+
}
|
|
39
51
|
interface SkillInstall {
|
|
40
52
|
/** Relative path within the integration repo to the skill directory */
|
|
41
53
|
path: string;
|
|
@@ -100,6 +112,7 @@ interface IntegrationManifest {
|
|
|
100
112
|
config_schema: ConfigSchemaField[];
|
|
101
113
|
capabilities: string[];
|
|
102
114
|
hooks: IntegrationHooks;
|
|
115
|
+
commands: CommandDeclaration[];
|
|
103
116
|
/** Git repository URL (HTTPS) — not present in YAML, injected by the publish API */
|
|
104
117
|
repository?: string;
|
|
105
118
|
/**
|
|
@@ -209,6 +222,13 @@ declare const ConfigSchemaFieldSchema: z.ZodObject<{
|
|
|
209
222
|
}, z.core.$strip>]>>;
|
|
210
223
|
depends_on_integration: z.ZodOptional<z.ZodString>;
|
|
211
224
|
}, z.core.$strip>;
|
|
225
|
+
declare const CommandDeclarationSchema: z.ZodObject<{
|
|
226
|
+
name: z.ZodString;
|
|
227
|
+
handler: z.ZodString;
|
|
228
|
+
method: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
229
|
+
timeout_ms: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
230
|
+
description: z.ZodOptional<z.ZodString>;
|
|
231
|
+
}, z.core.$strip>;
|
|
212
232
|
declare const SkillInstallSchema: z.ZodObject<{
|
|
213
233
|
path: z.ZodString;
|
|
214
234
|
}, z.core.$strip>;
|
|
@@ -321,6 +341,13 @@ declare const IntegrationManifestSchema: z.ZodObject<{
|
|
|
321
341
|
post_uninstall: z.ZodOptional<z.ZodString>;
|
|
322
342
|
health_check: z.ZodOptional<z.ZodString>;
|
|
323
343
|
}, z.core.$strip>>>;
|
|
344
|
+
commands: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
345
|
+
name: z.ZodString;
|
|
346
|
+
handler: z.ZodString;
|
|
347
|
+
method: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
348
|
+
timeout_ms: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
349
|
+
description: z.ZodOptional<z.ZodString>;
|
|
350
|
+
}, z.core.$strip>>>>;
|
|
324
351
|
repository: z.ZodOptional<z.ZodURL>;
|
|
325
352
|
supported_agents: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
326
353
|
publisherId: z.ZodOptional<z.ZodString>;
|
|
@@ -427,6 +454,32 @@ declare function extractTemplateReferences(config: Record<string, unknown>): {
|
|
|
427
454
|
field: string;
|
|
428
455
|
}[];
|
|
429
456
|
//#endregion
|
|
457
|
+
//#region src/command-handler.d.ts
|
|
458
|
+
/**
|
|
459
|
+
* Types for integration command handlers.
|
|
460
|
+
*
|
|
461
|
+
* Handler files are committed JS in integration repos. They export a function
|
|
462
|
+
* matching CommandHandlerFn that receives a payload and a CommandContext.
|
|
463
|
+
*/
|
|
464
|
+
interface CommandContext {
|
|
465
|
+
workspacePath: string;
|
|
466
|
+
aiProxyUrl: string | undefined;
|
|
467
|
+
aiProxyRunning: boolean;
|
|
468
|
+
apiKey: string;
|
|
469
|
+
exec(cmd: string, opts?: {
|
|
470
|
+
timeoutMs?: number;
|
|
471
|
+
maxBuffer?: number;
|
|
472
|
+
}): Promise<{
|
|
473
|
+
stdout: string;
|
|
474
|
+
stderr: string;
|
|
475
|
+
}>;
|
|
476
|
+
}
|
|
477
|
+
interface CommandResult {
|
|
478
|
+
status: "ok" | "error";
|
|
479
|
+
result: unknown;
|
|
480
|
+
}
|
|
481
|
+
type CommandHandlerFn = (payload: Record<string, unknown>, context: CommandContext) => Promise<CommandResult>;
|
|
482
|
+
//#endregion
|
|
430
483
|
//#region src/migration.d.ts
|
|
431
484
|
interface ConfigSchemaDiff {
|
|
432
485
|
added: ConfigSchemaField[];
|
|
@@ -457,4 +510,4 @@ declare function migrateConfig(currentConfig: Record<string, unknown>, diff: Con
|
|
|
457
510
|
warnings: string[];
|
|
458
511
|
};
|
|
459
512
|
//#endregion
|
|
460
|
-
export { type AgentRuntime, 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 PluginInstall, PluginInstallSchema, type PublishedIntegration, type PublishedVersion, type RuntimeInstall, RuntimeInstallSchema, type SelectOption, SelectOptionSchema, type SkillInstall, SkillInstallSchema, buildConfigValidationSchema, diffConfigSchemas, extractTemplateReferences, interpolateConfig, isRelativePath, migrateConfig, parseManifestFile, parseManifestString, resolveAssetUrl };
|
|
513
|
+
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 PluginInstall, PluginInstallSchema, type PublishedIntegration, type PublishedVersion, type RuntimeInstall, RuntimeInstallSchema, type SelectOption, SelectOptionSchema, type SkillInstall, SkillInstallSchema, buildConfigValidationSchema, diffConfigSchemas, extractTemplateReferences, interpolateConfig, isRelativePath, migrateConfig, parseManifestFile, parseManifestString, resolveAssetUrl };
|
package/dist/index.js
CHANGED
|
@@ -59,6 +59,13 @@ const ConfigSchemaFieldSchema = z.object({
|
|
|
59
59
|
if (field.type === "oauth_connect") return field.oauth_provider !== void 0 && field.oauth_provider.length > 0;
|
|
60
60
|
return true;
|
|
61
61
|
}, { message: "oauth_connect fields must specify an oauth_provider" });
|
|
62
|
+
const CommandDeclarationSchema = z.object({
|
|
63
|
+
name: z.string().min(1, "Command name must not be empty").regex(/^[a-z][a-z0-9]*\.[a-z][a-z0-9_]*$/, "Command name must be dot-namespaced (e.g. \"support.diagnostic\")"),
|
|
64
|
+
handler: z.string().min(1, "Handler path must not be empty"),
|
|
65
|
+
method: z.string().optional().default("handle"),
|
|
66
|
+
timeout_ms: z.number().int().positive().optional().default(3e4),
|
|
67
|
+
description: z.string().optional()
|
|
68
|
+
});
|
|
62
69
|
const SkillInstallSchema = z.object({ path: z.string().min(1, "Skill path must not be empty") });
|
|
63
70
|
const PluginInstallSchema = z.object({ package: z.string().min(1, "Plugin package name must not be empty") });
|
|
64
71
|
/** Per-runtime install overrides */
|
|
@@ -123,6 +130,7 @@ const IntegrationManifestSchema = z.object({
|
|
|
123
130
|
config_schema: z.array(ConfigSchemaFieldSchema).optional().default([]),
|
|
124
131
|
capabilities: z.array(z.string()).optional().default([]),
|
|
125
132
|
hooks: IntegrationHooksSchema.optional().default({}),
|
|
133
|
+
commands: z.array(CommandDeclarationSchema).optional().default([]),
|
|
126
134
|
repository: z.url().optional(),
|
|
127
135
|
supported_agents: z.array(RuntimeKeySchema).optional(),
|
|
128
136
|
publisherId: z.string().optional(),
|
|
@@ -370,4 +378,4 @@ function migrateConfig(currentConfig, diff) {
|
|
|
370
378
|
};
|
|
371
379
|
}
|
|
372
380
|
//#endregion
|
|
373
|
-
export { ConfigFieldTypeSchema, ConfigSchemaFieldSchema, InstallTargetsSchema, IntegrationHooksSchema, IntegrationManifestSchema, ManifestParseError, PluginInstallSchema, RuntimeInstallSchema, SelectOptionSchema, SkillInstallSchema, buildConfigValidationSchema, diffConfigSchemas, extractTemplateReferences, interpolateConfig, isRelativePath, migrateConfig, parseManifestFile, parseManifestString, resolveAssetUrl };
|
|
381
|
+
export { CommandDeclarationSchema, ConfigFieldTypeSchema, ConfigSchemaFieldSchema, InstallTargetsSchema, IntegrationHooksSchema, IntegrationManifestSchema, ManifestParseError, PluginInstallSchema, RuntimeInstallSchema, SelectOptionSchema, SkillInstallSchema, buildConfigValidationSchema, diffConfigSchemas, extractTemplateReferences, interpolateConfig, isRelativePath, migrateConfig, parseManifestFile, parseManifestString, resolveAssetUrl };
|