@alfe.ai/integrations 0.0.20 → 0.0.22

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
@@ -220,7 +220,7 @@ declare class Installer {
220
220
  * These are the canonical types used by all packages that interact with
221
221
  * integration manifests -- registry, lifecycle manager, CLI, etc.
222
222
  */
223
- type ConfigFieldType = 'secret' | 'string' | 'number' | 'boolean' | 'enum' | 'select' | 'multi_select' | 'oauth_connect' | 'phone_number_picker';
223
+ type ConfigFieldType = 'secret' | 'string' | 'number' | 'boolean' | 'enum' | 'select' | 'multi_select' | 'oauth_connect';
224
224
  interface SelectOption {
225
225
  value: string;
226
226
  label: string;
@@ -380,6 +380,8 @@ interface RuntimeApplier {
380
380
  applySkill(name: string, srcPath: string): Promise<void>;
381
381
  /** Install a skill from ClawHub registry */
382
382
  applyClawHubSkill(slug: string): Promise<void>;
383
+ /** Remove a ClawHub-installed skill from this runtime */
384
+ removeClawHubSkill(slug: string): Promise<void>;
383
385
  /** Remove a skill directory from this runtime */
384
386
  removeSkill(name: string): Promise<void>;
385
387
  /** Deep-merge config into the runtime's agent configuration */
@@ -715,6 +717,7 @@ declare class OpenClawApplier implements RuntimeApplier {
715
717
  removePlugin(pkg: string): Promise<void>;
716
718
  applySkill(name: string, srcPath: string): Promise<void>;
717
719
  applyClawHubSkill(slug: string): Promise<void>;
720
+ removeClawHubSkill(slug: string): Promise<void>;
718
721
  removeSkill(name: string): Promise<void>;
719
722
  /**
720
723
  * Apply integration config to the OpenClaw runtime via `openclaw config set`.
@@ -801,13 +804,17 @@ interface IIntegrationManager {
801
804
  /** Install an integration at a specific version with config */
802
805
  install(integrationId: string, version: string, config: unknown): Promise<void>;
803
806
  /** Activate an installed integration */
804
- activate(integrationId: string): Promise<void>;
807
+ activate(integrationId: string): Promise<{
808
+ configApplied: boolean;
809
+ }>;
805
810
  /** Deactivate a running integration */
806
811
  deactivate(integrationId: string): Promise<void>;
807
812
  /** Uninstall an integration */
808
813
  uninstall(integrationId: string): Promise<void>;
809
814
  /** Reinstall an integration — full teardown then fresh install + activate */
810
- reinstall(integrationId: string, version: string, config: unknown): Promise<void>;
815
+ reinstall(integrationId: string, version: string, config: unknown): Promise<{
816
+ configApplied: boolean;
817
+ }>;
811
818
  }
812
819
  declare class IntegrationManagerAdapter implements IIntegrationManager {
813
820
  private readonly manager;
@@ -819,10 +826,14 @@ declare class IntegrationManagerAdapter implements IIntegrationManager {
819
826
  installedAt?: string;
820
827
  }[]>;
821
828
  install(integrationId: string, version: string, config: unknown): Promise<void>;
822
- activate(integrationId: string): Promise<void>;
829
+ activate(integrationId: string): Promise<{
830
+ configApplied: boolean;
831
+ }>;
823
832
  deactivate(integrationId: string): Promise<void>;
824
833
  uninstall(integrationId: string): Promise<void>;
825
- reinstall(integrationId: string, version: string, config: unknown): Promise<void>;
834
+ reinstall(integrationId: string, version: string, config: unknown): Promise<{
835
+ configApplied: boolean;
836
+ }>;
826
837
  }
827
838
  //#endregion
828
839
  export { type HookEnvOptions, type HookResult, type IIntegrationManager, type InstalledInfo, Installer, InstallerError, type IntegrationConfigureParams, type IntegrationHealthParams, type IntegrationInfo, type IntegrationInstallParams, IntegrationManager, IntegrationManagerAdapter, type IntegrationManagerOptions, type IntegrationRemoveParams, LockManager, OpenClawApplier, type OpenClawApplierOptions, Registry, type RegistryEntry, type RegistryFetcher, type RegistryIndex, RegistryResolveError, type ResolvedIntegration, Resolver, type RuntimeApplier, type RuntimeDesiredState, type RuntimeLockFile, type RuntimePluginEntry, type RuntimeSkillEntry, StateManager, buildHookEnv, resolveInstallsForRuntime, runHook, runHookWithContext };
package/dist/index.js CHANGED
@@ -995,6 +995,7 @@ var IntegrationManager = class {
995
995
  const manifestPath = join(installPath, "alfe-integration.yaml");
996
996
  if (!existsSync(manifestPath)) return this.err("MANIFEST_MISSING", `Manifest not found at ${manifestPath}`);
997
997
  const manifest = parseManifestFile(manifestPath);
998
+ let configApplied = false;
998
999
  const supportedAgents = manifest.supported_agents;
999
1000
  for (const [runtimeName, applier] of this.runtimeAppliers) {
1000
1001
  if (!await applier.isAvailable()) {
@@ -1024,6 +1025,7 @@ var IntegrationManager = class {
1024
1025
  const interpolatedConfig = interpolateSelfConfig(runtimeConfig, agentConfig);
1025
1026
  this.log.info(`Applying config for ${integrationId} to ${runtimeName}`);
1026
1027
  await applier.applyConfig(integrationId, interpolatedConfig);
1028
+ configApplied = true;
1027
1029
  }
1028
1030
  if (plugins.length > 0 || skills.length > 0) this.lockManager.addEntries(runtimeName, integrationId, manifest.version, plugins, skills, installPath);
1029
1031
  }
@@ -1057,7 +1059,8 @@ var IntegrationManager = class {
1057
1059
  ok: true,
1058
1060
  payload: {
1059
1061
  name: integrationId,
1060
- status: "active"
1062
+ status: "active",
1063
+ configApplied
1061
1064
  }
1062
1065
  };
1063
1066
  } catch (err) {
@@ -1109,7 +1112,8 @@ var IntegrationManager = class {
1109
1112
  for (const skill of entries.skills) {
1110
1113
  this.log.info(`Removing skill ${skill.name} from ${runtimeName}`);
1111
1114
  try {
1112
- await applier.removeSkill(skill.name);
1115
+ if (skill.sourcePath.startsWith("clawhub:")) await applier.removeClawHubSkill(skill.name);
1116
+ else await applier.removeSkill(skill.name);
1113
1117
  } catch (err) {
1114
1118
  this.log.warn(`Failed to remove skill ${skill.name} from ${runtimeName}: ${err instanceof Error ? err.message : String(err)}`);
1115
1119
  }
@@ -1503,15 +1507,30 @@ var OpenClawApplier = class {
1503
1507
  async applyClawHubSkill(slug) {
1504
1508
  log.info({ slug }, "Installing skill from ClawHub");
1505
1509
  try {
1506
- await execFileAsync("clawhub", ["install", slug], { timeout: 6e4 });
1510
+ await execFileAsync("openclaw", [
1511
+ "skills",
1512
+ "install",
1513
+ slug
1514
+ ], { timeout: 6e4 });
1507
1515
  log.info({ slug }, "ClawHub skill installed");
1508
1516
  } catch (err) {
1509
1517
  const msg = err instanceof Error ? err.message : String(err);
1510
- log.warn({
1518
+ log.error({
1511
1519
  slug,
1512
1520
  err: msg
1513
- }, "ClawHub skill install failed — clawhub CLI may not be available");
1521
+ }, "ClawHub skill install failed");
1522
+ }
1523
+ }
1524
+ removeClawHubSkill(slug) {
1525
+ const workspaceSkillsDir = join(this.workspace, "skills", slug);
1526
+ if (existsSync(workspaceSkillsDir)) {
1527
+ rmSync(workspaceSkillsDir, {
1528
+ recursive: true,
1529
+ force: true
1530
+ });
1531
+ log.info({ slug }, "ClawHub skill removed");
1514
1532
  }
1533
+ return Promise.resolve();
1515
1534
  }
1516
1535
  removeSkill(name) {
1517
1536
  const skillPath = join(this.skillsDir, name);
@@ -1622,6 +1641,7 @@ var IntegrationManagerAdapter = class {
1622
1641
  async activate(integrationId) {
1623
1642
  const result = await this.manager.activate(integrationId);
1624
1643
  if (!result.ok) throw new Error(result.error?.message ?? `Failed to activate ${integrationId}`);
1644
+ return { configApplied: result.payload?.configApplied ?? false };
1625
1645
  }
1626
1646
  async deactivate(integrationId) {
1627
1647
  const result = await this.manager.deactivate(integrationId);
@@ -1638,6 +1658,7 @@ var IntegrationManagerAdapter = class {
1638
1658
  config
1639
1659
  });
1640
1660
  if (!result.ok) throw new Error(result.error?.message ?? `Failed to reinstall ${integrationId}`);
1661
+ return { configApplied: result.payload?.configApplied ?? false };
1641
1662
  }
1642
1663
  };
1643
1664
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfe.ai/integrations",
3
- "version": "0.0.20",
3
+ "version": "0.0.22",
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.8"
16
+ "@alfe.ai/integration-manifest": "^0.0.9"
17
17
  },
18
18
  "files": [
19
19
  "dist"