@alfe.ai/integrations 0.0.14 → 0.0.15

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
@@ -247,6 +247,18 @@ interface ConfigSchemaField {
247
247
  /** Only show this field if a specific integration is installed */
248
248
  depends_on_integration?: string;
249
249
  }
250
+ interface CommandDeclaration {
251
+ /** Dot-namespaced command name (e.g. "support.diagnostic") */
252
+ name: string;
253
+ /** Relative path to handler file within integration directory */
254
+ handler: string;
255
+ /** Exported function name (default: "handle") */
256
+ method?: string;
257
+ /** Timeout in milliseconds (default: 30000) */
258
+ timeout_ms?: number;
259
+ /** Human-readable description */
260
+ description?: string;
261
+ }
250
262
  interface SkillInstall {
251
263
  /** Relative path within the integration repo to the skill directory */
252
264
  path: string;
@@ -311,6 +323,7 @@ interface IntegrationManifest {
311
323
  config_schema: ConfigSchemaField[];
312
324
  capabilities: string[];
313
325
  hooks: IntegrationHooks;
326
+ commands: CommandDeclaration[];
314
327
  /** Git repository URL (HTTPS) — not present in YAML, injected by the publish API */
315
328
  repository?: string;
316
329
  /**
@@ -501,6 +514,21 @@ declare class IntegrationManager {
501
514
  * Get a specific integration by name.
502
515
  */
503
516
  get(name: string): IntegrationInfo | undefined;
517
+ /**
518
+ * Get command declarations from all active integrations with resolved absolute paths.
519
+ * Used by the daemon to rebuild the command registry after reconciliation.
520
+ */
521
+ getActiveCommands(): {
522
+ integrationId: string;
523
+ commands: {
524
+ name: string;
525
+ handler: string;
526
+ resolvedPath: string;
527
+ method: string;
528
+ timeoutMs: number;
529
+ description?: string;
530
+ }[];
531
+ }[];
504
532
  /**
505
533
  * Clear in-memory secrets (called on daemon restart).
506
534
  */
package/dist/index.js CHANGED
@@ -137,7 +137,8 @@ const NPM_TIMEOUT_MS = 6e4;
137
137
  /** Shared @alfe.ai packages available to all integration hooks */
138
138
  const SHARED_PACKAGES = {
139
139
  "@alfe.ai/config": "latest",
140
- "@alfe.ai/agent-api-client": "latest"
140
+ "@alfe.ai/agent-api-client": "latest",
141
+ "@alfe.ai/doctor": "latest"
141
142
  };
142
143
  var InstallerError = class extends Error {
143
144
  constructor(message) {
@@ -1247,6 +1248,37 @@ var IntegrationManager = class {
1247
1248
  };
1248
1249
  }
1249
1250
  /**
1251
+ * Get command declarations from all active integrations with resolved absolute paths.
1252
+ * Used by the daemon to rebuild the command registry after reconciliation.
1253
+ */
1254
+ getActiveCommands() {
1255
+ const result = [];
1256
+ for (const entry of this.state.list()) {
1257
+ if (entry.status !== "active") continue;
1258
+ const installPath = this.installer.getInstallPath(entry.id);
1259
+ const manifestPath = join(installPath, "alfe-integration.yaml");
1260
+ if (!existsSync(manifestPath)) continue;
1261
+ try {
1262
+ const manifest = parseManifestFile(manifestPath);
1263
+ if (manifest.commands.length === 0) continue;
1264
+ result.push({
1265
+ integrationId: entry.id,
1266
+ commands: manifest.commands.map((cmd) => ({
1267
+ name: cmd.name,
1268
+ handler: cmd.handler,
1269
+ resolvedPath: join(installPath, cmd.handler),
1270
+ method: cmd.method ?? "handle",
1271
+ timeoutMs: cmd.timeout_ms ?? 3e4,
1272
+ description: cmd.description
1273
+ }))
1274
+ });
1275
+ } catch (err) {
1276
+ this.log.warn(`Failed to read commands for "${entry.id}": ${err instanceof Error ? err.message : String(err)}`);
1277
+ }
1278
+ }
1279
+ return result;
1280
+ }
1281
+ /**
1250
1282
  * Clear in-memory secrets (called on daemon restart).
1251
1283
  */
1252
1284
  clear() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfe.ai/integrations",
3
- "version": "0.0.14",
3
+ "version": "0.0.15",
4
4
  "description": "Integration lifecycle management for Alfe — registry, resolution, installation, and state",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -13,7 +13,7 @@
13
13
  },
14
14
  "dependencies": {
15
15
  "@auriclabs/logger": "^0.1.1",
16
- "@alfe.ai/integration-manifest": "^0.0.5"
16
+ "@alfe.ai/integration-manifest": "^0.0.6"
17
17
  },
18
18
  "files": [
19
19
  "dist"