@alfe.ai/integrations 0.0.28 → 0.0.30

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
@@ -245,6 +245,10 @@ interface ConfigSchemaField {
245
245
  select_options?: SelectOption[];
246
246
  /** OAuth provider identifier for oauth_connect fields */
247
247
  oauth_provider?: string;
248
+ /** Force specific scope groups for OAuth (e.g. ["chat"]) — hides other scopes in the dashboard */
249
+ oauth_scopes?: string[];
250
+ /** Integration ID to patch on OAuth callback (when using a shared OAuth provider) */
251
+ oauth_integration_id?: string;
248
252
  /** If true, this field is not shown in the dashboard UI (install wizard or configure modal) */
249
253
  hidden?: boolean;
250
254
  /** Only show this field if another field has a truthy value (string) or matches a specific value (object) */
@@ -748,16 +752,30 @@ declare function runHookWithContext(integrationPath: string, hookScript: string,
748
752
  //#endregion
749
753
  //#region src/appliers/openclaw-applier.d.ts
750
754
  interface OpenClawApplierOptions {
751
- /** Path to the OpenClaw workspace directory (e.g. ~/.openclaw) */
752
- workspace: string;
755
+ /**
756
+ * Path to the OpenClaw home directory (e.g. ~/.openclaw) — where openclaw.json,
757
+ * plugins/, and extensions/ live.
758
+ */
759
+ home?: string;
760
+ /**
761
+ * Path to the agent workspace directory (e.g. ~/.openclaw/workspace) — where
762
+ * the agent's CWD lives, including SOUL.md / AGENTS.md / skills/. Defaults to
763
+ * `${home}/workspace` (OpenClaw's default for `agents.defaults.workspace`).
764
+ */
765
+ agentWorkspace?: string;
766
+ /**
767
+ * @deprecated Use `home` instead. Kept for back-compat — when set, used as `home`.
768
+ */
769
+ workspace?: string;
753
770
  /** Override skills directory (defaults to ~/.alfe/skills/) */
754
771
  skillsDir?: string;
755
- /** Path to the integration tracking file (defaults to {workspace}/config.json) */
772
+ /** Path to the integration tracking file (defaults to {home}/config.json) */
756
773
  configPath?: string;
757
774
  }
758
775
  declare class OpenClawApplier implements RuntimeApplier {
759
776
  readonly runtime = "openclaw";
760
- private workspace;
777
+ private home;
778
+ private agentWorkspace;
761
779
  private skillsDir;
762
780
  private trackingPath;
763
781
  constructor(options: OpenClawApplierOptions);
@@ -770,8 +788,12 @@ declare class OpenClawApplier implements RuntimeApplier {
770
788
  */
771
789
  private ensurePluginsAllow;
772
790
  /**
773
- * Check if a plugin is already installed in ~/.openclaw/extensions/.
774
- * OpenClaw names extension dirs as {pkg-name-with-dashes}-{hash}.
791
+ * Check if a plugin is already installed.
792
+ *
793
+ * OpenClaw 2026.4 stored plugins under `~/.openclaw/extensions/{pkg-name-with-dashes}-{hash}`.
794
+ * 2026.5+ added an npm registry at `~/.openclaw/npm/node_modules/<pkg>` for npm-source
795
+ * plugins. We must check both — the extensions-only check missed npm-installed
796
+ * plugins under 2026.5+, which made force-mode skip its uninstall step.
775
797
  */
776
798
  private isPluginInstalled;
777
799
  removePlugin(pkg: string): Promise<void>;
package/dist/index.js CHANGED
@@ -1524,13 +1524,17 @@ function flattenConfig(obj, prefix = "") {
1524
1524
  }
1525
1525
  var OpenClawApplier = class {
1526
1526
  runtime = "openclaw";
1527
- workspace;
1527
+ home;
1528
+ agentWorkspace;
1528
1529
  skillsDir;
1529
1530
  trackingPath;
1530
1531
  constructor(options) {
1531
- this.workspace = options.workspace;
1532
+ const home = options.home ?? options.workspace;
1533
+ if (!home) throw new Error("OpenClawApplier requires `home` (or legacy `workspace`) option");
1534
+ this.home = home;
1535
+ this.agentWorkspace = options.agentWorkspace ?? join(home, "workspace");
1532
1536
  this.skillsDir = options.skillsDir ?? DEFAULT_SKILLS_DIR;
1533
- this.trackingPath = options.configPath ?? join(this.workspace, "config.json");
1537
+ this.trackingPath = options.configPath ?? join(this.home, "config.json");
1534
1538
  }
1535
1539
  async applyPlugin(pkg, _installPath, opts) {
1536
1540
  await this.ensurePluginsAllow(pkg);
@@ -1546,25 +1550,22 @@ var OpenClawApplier = class {
1546
1550
  }
1547
1551
  }
1548
1552
  if (!this.isPluginInstalled(pkg)) {
1553
+ const baseArgs = [
1554
+ "plugins",
1555
+ "install",
1556
+ pkg,
1557
+ "--force"
1558
+ ];
1559
+ const useUnsafeFlag = pkg.startsWith("@alfe.ai/");
1560
+ const args = useUnsafeFlag ? [...baseArgs, "--dangerously-force-unsafe-install"] : baseArgs;
1549
1561
  try {
1550
- const args = [
1551
- "plugins",
1552
- "install",
1553
- pkg
1554
- ];
1555
- const useUnsafeFlag = pkg.startsWith("@alfe.ai/");
1556
- if (useUnsafeFlag) args.push("--dangerously-force-unsafe-install");
1557
1562
  try {
1558
1563
  await execFileAsync("openclaw", args, { timeout: 6e4 });
1559
1564
  } catch (err) {
1560
1565
  const errText = err instanceof Error ? `${err.message}\n${err.stderr ?? ""}` : String(err);
1561
1566
  if (useUnsafeFlag && errText.includes("unknown option")) {
1562
1567
  log.info({ pkg }, "OpenClaw does not support --dangerously-force-unsafe-install, retrying without");
1563
- await execFileAsync("openclaw", [
1564
- "plugins",
1565
- "install",
1566
- pkg
1567
- ], { timeout: 6e4 });
1568
+ await execFileAsync("openclaw", baseArgs, { timeout: 6e4 });
1568
1569
  } else throw err;
1569
1570
  }
1570
1571
  } catch (err) {
@@ -1614,10 +1615,15 @@ var OpenClawApplier = class {
1614
1615
  }
1615
1616
  }
1616
1617
  /**
1617
- * Check if a plugin is already installed in ~/.openclaw/extensions/.
1618
- * OpenClaw names extension dirs as {pkg-name-with-dashes}-{hash}.
1618
+ * Check if a plugin is already installed.
1619
+ *
1620
+ * OpenClaw 2026.4 stored plugins under `~/.openclaw/extensions/{pkg-name-with-dashes}-{hash}`.
1621
+ * 2026.5+ added an npm registry at `~/.openclaw/npm/node_modules/<pkg>` for npm-source
1622
+ * plugins. We must check both — the extensions-only check missed npm-installed
1623
+ * plugins under 2026.5+, which made force-mode skip its uninstall step.
1619
1624
  */
1620
1625
  isPluginInstalled(pkg) {
1626
+ if (existsSync(join(homedir(), ".openclaw", "npm", "node_modules", ...pkg.split("/")))) return true;
1621
1627
  const extensionsDir = join(homedir(), ".openclaw", "extensions");
1622
1628
  if (!existsSync(extensionsDir)) return false;
1623
1629
  const prefix = pkg.replaceAll("/", "-") + "-";
@@ -1659,7 +1665,7 @@ var OpenClawApplier = class {
1659
1665
  }
1660
1666
  }
1661
1667
  removeClawHubSkill(slug) {
1662
- const workspaceSkillsDir = join(this.workspace, "skills", slug);
1668
+ const workspaceSkillsDir = join(this.agentWorkspace, "skills", slug);
1663
1669
  if (existsSync(workspaceSkillsDir)) {
1664
1670
  rmSync(workspaceSkillsDir, {
1665
1671
  recursive: true,
@@ -1812,7 +1818,7 @@ var OpenClawApplier = class {
1812
1818
  this.writeTracking(tracking);
1813
1819
  }
1814
1820
  isAvailable() {
1815
- return Promise.resolve(existsSync(this.workspace));
1821
+ return Promise.resolve(existsSync(this.home));
1816
1822
  }
1817
1823
  readTracking() {
1818
1824
  if (!existsSync(this.trackingPath)) return {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfe.ai/integrations",
3
- "version": "0.0.28",
3
+ "version": "0.0.30",
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.10"
16
+ "@alfe.ai/integration-manifest": "^0.0.11"
17
17
  },
18
18
  "files": [
19
19
  "dist"