@alfe.ai/integration-manifest 0.0.5 → 0.0.7
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 +79 -8
- package/dist/index.js +14 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -36,9 +36,23 @@ 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
|
-
path
|
|
53
|
+
path?: string;
|
|
54
|
+
/** ClawHub skill slug to install from the registry */
|
|
55
|
+
clawhub?: string;
|
|
42
56
|
}
|
|
43
57
|
interface PluginInstall {
|
|
44
58
|
/** npm package name to install */
|
|
@@ -100,6 +114,7 @@ interface IntegrationManifest {
|
|
|
100
114
|
config_schema: ConfigSchemaField[];
|
|
101
115
|
capabilities: string[];
|
|
102
116
|
hooks: IntegrationHooks;
|
|
117
|
+
commands: CommandDeclaration[];
|
|
103
118
|
/** Git repository URL (HTTPS) — not present in YAML, injected by the publish API */
|
|
104
119
|
repository?: string;
|
|
105
120
|
/**
|
|
@@ -108,6 +123,12 @@ interface IntegrationManifest {
|
|
|
108
123
|
* Example: ['openclaw'] means this integration only works with OpenClaw.
|
|
109
124
|
*/
|
|
110
125
|
supported_agents?: AgentRuntime[];
|
|
126
|
+
/**
|
|
127
|
+
* Scopes where this integration can be installed.
|
|
128
|
+
* Default: ['agent'] (per-agent only).
|
|
129
|
+
* 'org' means it can be installed at the org level and cascades to all agents.
|
|
130
|
+
*/
|
|
131
|
+
supported_scopes?: ('agent' | 'org')[];
|
|
111
132
|
/** Marketplace metadata */
|
|
112
133
|
publisherId?: string;
|
|
113
134
|
icon?: string;
|
|
@@ -209,8 +230,16 @@ declare const ConfigSchemaFieldSchema: z.ZodObject<{
|
|
|
209
230
|
}, z.core.$strip>]>>;
|
|
210
231
|
depends_on_integration: z.ZodOptional<z.ZodString>;
|
|
211
232
|
}, z.core.$strip>;
|
|
233
|
+
declare const CommandDeclarationSchema: z.ZodObject<{
|
|
234
|
+
name: z.ZodString;
|
|
235
|
+
handler: z.ZodString;
|
|
236
|
+
method: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
237
|
+
timeout_ms: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
238
|
+
description: z.ZodOptional<z.ZodString>;
|
|
239
|
+
}, z.core.$strip>;
|
|
212
240
|
declare const SkillInstallSchema: z.ZodObject<{
|
|
213
|
-
path: z.ZodString
|
|
241
|
+
path: z.ZodOptional<z.ZodString>;
|
|
242
|
+
clawhub: z.ZodOptional<z.ZodString>;
|
|
214
243
|
}, z.core.$strip>;
|
|
215
244
|
declare const PluginInstallSchema: z.ZodObject<{
|
|
216
245
|
package: z.ZodString;
|
|
@@ -218,7 +247,8 @@ declare const PluginInstallSchema: z.ZodObject<{
|
|
|
218
247
|
/** Per-runtime install overrides */
|
|
219
248
|
declare const RuntimeInstallSchema: z.ZodObject<{
|
|
220
249
|
skills: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
221
|
-
path: z.ZodString
|
|
250
|
+
path: z.ZodOptional<z.ZodString>;
|
|
251
|
+
clawhub: z.ZodOptional<z.ZodString>;
|
|
222
252
|
}, z.core.$strip>>>>;
|
|
223
253
|
plugins: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
224
254
|
package: z.ZodString;
|
|
@@ -227,14 +257,16 @@ declare const RuntimeInstallSchema: z.ZodObject<{
|
|
|
227
257
|
}, z.core.$strip>;
|
|
228
258
|
declare const InstallTargetsSchema: z.ZodObject<{
|
|
229
259
|
skills: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
230
|
-
path: z.ZodString
|
|
260
|
+
path: z.ZodOptional<z.ZodString>;
|
|
261
|
+
clawhub: z.ZodOptional<z.ZodString>;
|
|
231
262
|
}, z.core.$strip>>>>;
|
|
232
263
|
plugins: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
233
264
|
package: z.ZodString;
|
|
234
265
|
}, z.core.$strip>>>>;
|
|
235
266
|
runtimes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
236
267
|
skills: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
237
|
-
path: z.ZodString
|
|
268
|
+
path: z.ZodOptional<z.ZodString>;
|
|
269
|
+
clawhub: z.ZodOptional<z.ZodString>;
|
|
238
270
|
}, z.core.$strip>>>>;
|
|
239
271
|
plugins: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
240
272
|
package: z.ZodString;
|
|
@@ -264,14 +296,16 @@ declare const IntegrationManifestSchema: z.ZodObject<{
|
|
|
264
296
|
min_gateway_version: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
265
297
|
installs: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
266
298
|
skills: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
267
|
-
path: z.ZodString
|
|
299
|
+
path: z.ZodOptional<z.ZodString>;
|
|
300
|
+
clawhub: z.ZodOptional<z.ZodString>;
|
|
268
301
|
}, z.core.$strip>>>>;
|
|
269
302
|
plugins: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
270
303
|
package: z.ZodString;
|
|
271
304
|
}, z.core.$strip>>>>;
|
|
272
305
|
runtimes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
273
306
|
skills: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
274
|
-
path: z.ZodString
|
|
307
|
+
path: z.ZodOptional<z.ZodString>;
|
|
308
|
+
clawhub: z.ZodOptional<z.ZodString>;
|
|
275
309
|
}, z.core.$strip>>>>;
|
|
276
310
|
plugins: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
277
311
|
package: z.ZodString;
|
|
@@ -321,8 +355,19 @@ declare const IntegrationManifestSchema: z.ZodObject<{
|
|
|
321
355
|
post_uninstall: z.ZodOptional<z.ZodString>;
|
|
322
356
|
health_check: z.ZodOptional<z.ZodString>;
|
|
323
357
|
}, z.core.$strip>>>;
|
|
358
|
+
commands: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
359
|
+
name: z.ZodString;
|
|
360
|
+
handler: z.ZodString;
|
|
361
|
+
method: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
362
|
+
timeout_ms: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
363
|
+
description: z.ZodOptional<z.ZodString>;
|
|
364
|
+
}, z.core.$strip>>>>;
|
|
324
365
|
repository: z.ZodOptional<z.ZodURL>;
|
|
325
366
|
supported_agents: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
367
|
+
supported_scopes: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
368
|
+
agent: "agent";
|
|
369
|
+
org: "org";
|
|
370
|
+
}>>>>;
|
|
326
371
|
publisherId: z.ZodOptional<z.ZodString>;
|
|
327
372
|
icon: z.ZodOptional<z.ZodString>;
|
|
328
373
|
pricing: z.ZodOptional<z.ZodObject<{
|
|
@@ -427,6 +472,32 @@ declare function extractTemplateReferences(config: Record<string, unknown>): {
|
|
|
427
472
|
field: string;
|
|
428
473
|
}[];
|
|
429
474
|
//#endregion
|
|
475
|
+
//#region src/command-handler.d.ts
|
|
476
|
+
/**
|
|
477
|
+
* Types for integration command handlers.
|
|
478
|
+
*
|
|
479
|
+
* Handler files are committed JS in integration repos. They export a function
|
|
480
|
+
* matching CommandHandlerFn that receives a payload and a CommandContext.
|
|
481
|
+
*/
|
|
482
|
+
interface CommandContext {
|
|
483
|
+
workspacePath: string;
|
|
484
|
+
aiProxyUrl: string | undefined;
|
|
485
|
+
aiProxyRunning: boolean;
|
|
486
|
+
apiKey: string;
|
|
487
|
+
exec(cmd: string, opts?: {
|
|
488
|
+
timeoutMs?: number;
|
|
489
|
+
maxBuffer?: number;
|
|
490
|
+
}): Promise<{
|
|
491
|
+
stdout: string;
|
|
492
|
+
stderr: string;
|
|
493
|
+
}>;
|
|
494
|
+
}
|
|
495
|
+
interface CommandResult {
|
|
496
|
+
status: "ok" | "error";
|
|
497
|
+
result: unknown;
|
|
498
|
+
}
|
|
499
|
+
type CommandHandlerFn = (payload: Record<string, unknown>, context: CommandContext) => Promise<CommandResult>;
|
|
500
|
+
//#endregion
|
|
430
501
|
//#region src/migration.d.ts
|
|
431
502
|
interface ConfigSchemaDiff {
|
|
432
503
|
added: ConfigSchemaField[];
|
|
@@ -457,4 +528,4 @@ declare function migrateConfig(currentConfig: Record<string, unknown>, diff: Con
|
|
|
457
528
|
warnings: string[];
|
|
458
529
|
};
|
|
459
530
|
//#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 };
|
|
531
|
+
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,7 +59,17 @@ 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
|
|
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
|
+
});
|
|
69
|
+
const SkillInstallSchema = z.object({
|
|
70
|
+
path: z.string().min(1, "Skill path must not be empty").optional(),
|
|
71
|
+
clawhub: z.string().min(1, "ClawHub skill slug must not be empty").optional()
|
|
72
|
+
}).refine((data) => data.path ?? data.clawhub, { message: "Skill must have either a path or clawhub slug" });
|
|
63
73
|
const PluginInstallSchema = z.object({ package: z.string().min(1, "Plugin package name must not be empty") });
|
|
64
74
|
/** Per-runtime install overrides */
|
|
65
75
|
const RuntimeInstallSchema = z.object({
|
|
@@ -123,8 +133,10 @@ const IntegrationManifestSchema = z.object({
|
|
|
123
133
|
config_schema: z.array(ConfigSchemaFieldSchema).optional().default([]),
|
|
124
134
|
capabilities: z.array(z.string()).optional().default([]),
|
|
125
135
|
hooks: IntegrationHooksSchema.optional().default({}),
|
|
136
|
+
commands: z.array(CommandDeclarationSchema).optional().default([]),
|
|
126
137
|
repository: z.url().optional(),
|
|
127
138
|
supported_agents: z.array(RuntimeKeySchema).optional(),
|
|
139
|
+
supported_scopes: z.array(z.enum(["agent", "org"])).optional().default(["agent"]),
|
|
128
140
|
publisherId: z.string().optional(),
|
|
129
141
|
icon: z.string().optional(),
|
|
130
142
|
pricing: IntegrationPricingSchema.optional(),
|
|
@@ -370,4 +382,4 @@ function migrateConfig(currentConfig, diff) {
|
|
|
370
382
|
};
|
|
371
383
|
}
|
|
372
384
|
//#endregion
|
|
373
|
-
export { ConfigFieldTypeSchema, ConfigSchemaFieldSchema, InstallTargetsSchema, IntegrationHooksSchema, IntegrationManifestSchema, ManifestParseError, PluginInstallSchema, RuntimeInstallSchema, SelectOptionSchema, SkillInstallSchema, buildConfigValidationSchema, diffConfigSchemas, extractTemplateReferences, interpolateConfig, isRelativePath, migrateConfig, parseManifestFile, parseManifestString, resolveAssetUrl };
|
|
385
|
+
export { CommandDeclarationSchema, ConfigFieldTypeSchema, ConfigSchemaFieldSchema, InstallTargetsSchema, IntegrationHooksSchema, IntegrationManifestSchema, ManifestParseError, PluginInstallSchema, RuntimeInstallSchema, SelectOptionSchema, SkillInstallSchema, buildConfigValidationSchema, diffConfigSchemas, extractTemplateReferences, interpolateConfig, isRelativePath, migrateConfig, parseManifestFile, parseManifestString, resolveAssetUrl };
|