@alfe.ai/integration-manifest 0.0.4 → 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 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;
@@ -62,6 +74,7 @@ interface InstallTargets {
62
74
  interface IntegrationHooks {
63
75
  pre_install?: string;
64
76
  post_install?: string;
77
+ post_activate?: string;
65
78
  pre_uninstall?: string;
66
79
  post_uninstall?: string;
67
80
  health_check?: string;
@@ -99,6 +112,7 @@ interface IntegrationManifest {
99
112
  config_schema: ConfigSchemaField[];
100
113
  capabilities: string[];
101
114
  hooks: IntegrationHooks;
115
+ commands: CommandDeclaration[];
102
116
  /** Git repository URL (HTTPS) — not present in YAML, injected by the publish API */
103
117
  repository?: string;
104
118
  /**
@@ -208,6 +222,13 @@ declare const ConfigSchemaFieldSchema: z.ZodObject<{
208
222
  }, z.core.$strip>]>>;
209
223
  depends_on_integration: z.ZodOptional<z.ZodString>;
210
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>;
211
232
  declare const SkillInstallSchema: z.ZodObject<{
212
233
  path: z.ZodString;
213
234
  }, z.core.$strip>;
@@ -244,6 +265,7 @@ declare const InstallTargetsSchema: z.ZodObject<{
244
265
  declare const IntegrationHooksSchema: z.ZodObject<{
245
266
  pre_install: z.ZodOptional<z.ZodString>;
246
267
  post_install: z.ZodOptional<z.ZodString>;
268
+ post_activate: z.ZodOptional<z.ZodString>;
247
269
  pre_uninstall: z.ZodOptional<z.ZodString>;
248
270
  post_uninstall: z.ZodOptional<z.ZodString>;
249
271
  health_check: z.ZodOptional<z.ZodString>;
@@ -314,10 +336,18 @@ declare const IntegrationManifestSchema: z.ZodObject<{
314
336
  hooks: z.ZodDefault<z.ZodOptional<z.ZodObject<{
315
337
  pre_install: z.ZodOptional<z.ZodString>;
316
338
  post_install: z.ZodOptional<z.ZodString>;
339
+ post_activate: z.ZodOptional<z.ZodString>;
317
340
  pre_uninstall: z.ZodOptional<z.ZodString>;
318
341
  post_uninstall: z.ZodOptional<z.ZodString>;
319
342
  health_check: z.ZodOptional<z.ZodString>;
320
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>>>>;
321
351
  repository: z.ZodOptional<z.ZodURL>;
322
352
  supported_agents: z.ZodOptional<z.ZodArray<z.ZodString>>;
323
353
  publisherId: z.ZodOptional<z.ZodString>;
@@ -424,6 +454,32 @@ declare function extractTemplateReferences(config: Record<string, unknown>): {
424
454
  field: string;
425
455
  }[];
426
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
427
483
  //#region src/migration.d.ts
428
484
  interface ConfigSchemaDiff {
429
485
  added: ConfigSchemaField[];
@@ -454,4 +510,4 @@ declare function migrateConfig(currentConfig: Record<string, unknown>, diff: Con
454
510
  warnings: string[];
455
511
  };
456
512
  //#endregion
457
- 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 */
@@ -77,6 +84,7 @@ const InstallTargetsSchema = z.object({
77
84
  const IntegrationHooksSchema = z.object({
78
85
  pre_install: z.string().optional(),
79
86
  post_install: z.string().optional(),
87
+ post_activate: z.string().optional(),
80
88
  pre_uninstall: z.string().optional(),
81
89
  post_uninstall: z.string().optional(),
82
90
  health_check: z.string().optional()
@@ -122,6 +130,7 @@ const IntegrationManifestSchema = z.object({
122
130
  config_schema: z.array(ConfigSchemaFieldSchema).optional().default([]),
123
131
  capabilities: z.array(z.string()).optional().default([]),
124
132
  hooks: IntegrationHooksSchema.optional().default({}),
133
+ commands: z.array(CommandDeclarationSchema).optional().default([]),
125
134
  repository: z.url().optional(),
126
135
  supported_agents: z.array(RuntimeKeySchema).optional(),
127
136
  publisherId: z.string().optional(),
@@ -369,4 +378,4 @@ function migrateConfig(currentConfig, diff) {
369
378
  };
370
379
  }
371
380
  //#endregion
372
- 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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfe.ai/integration-manifest",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "Integration manifest schema, types, and parser for Alfe integration platform",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",