@alfe.ai/integrations 0.5.1 → 0.5.3

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.
Files changed (2) hide show
  1. package/dist/index.js +29 -5
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -2195,6 +2195,19 @@ function isMalformedStateDbError(err) {
2195
2195
  return `${e.message}\n${e.stderr ?? ""}\n${e.stdout ?? ""}`.toLowerCase().includes(MALFORMED_STATE_DB_PHRASE);
2196
2196
  }
2197
2197
  /**
2198
+ * Extract the `stderr` string from a rejected `execFileAsync` call (the
2199
+ * promisified `execFile` attaches captured stderr onto the Error). Returns
2200
+ * `undefined` when the rejection isn't an execFile-style error (no stderr).
2201
+ * The message is included as a fallback because some Node/CLI combinations
2202
+ * surface the CLI's message on `.message` rather than `.stderr`.
2203
+ */
2204
+ function getExecFileStderr(err) {
2205
+ if (!(err instanceof Error)) return void 0;
2206
+ const e = err;
2207
+ const combined = `${typeof e.stderr === "string" ? e.stderr : ""}\n${e.message}`.trim();
2208
+ return combined === "" ? void 0 : combined;
2209
+ }
2210
+ /**
2198
2211
  * OpenClaw rejects `config unset` of a single leaf under a CUSTOM model provider
2199
2212
  * when the removal would leave a schema-invalid partial — e.g. unsetting
2200
2213
  * `models.providers.zhipu.baseUrl` fails with "custom model providers must
@@ -2709,8 +2722,9 @@ var OpenClawApplier = class {
2709
2722
  } catch {
2710
2723
  readTrustworthy = false;
2711
2724
  }
2712
- } catch {
2713
- readTrustworthy = false;
2725
+ } catch (err) {
2726
+ const stderr = getExecFileStderr(err);
2727
+ if (stderr !== void 0 && /config path not found/i.test(stderr)) {} else readTrustworthy = false;
2714
2728
  }
2715
2729
  const missing = [...new Set([...wanted, ...BUNDLED_BASELINE_ALLOW])].filter((id) => !currentAllow.includes(id));
2716
2730
  if (missing.length === 0) return;
@@ -4033,6 +4047,14 @@ var ClaudeCodeApplier = class {
4033
4047
  */
4034
4048
  const log$1 = createLogger("ClaudeCodeMcpSync");
4035
4049
  const DEFAULT_CLAUDE_CODE_HOME = join(homedir(), ".claude-code");
4050
+ /**
4051
+ * The store id of the core Alfe MCP server (`@alfe.ai/mcp-server`). Its argv is
4052
+ * registered runtime-agnostically (command-only, shared with OpenClaw), so the
4053
+ * `--profile claude-code` flag that unlocks the memory/voice/messaging tools is
4054
+ * injected here — in the claude-code-only sync layer — rather than in the shared
4055
+ * store (which would double OpenClaw's memory-tool surface).
4056
+ */
4057
+ const ALFE_PLATFORM_SERVER_ID = "alfe-platform";
4036
4058
  const DEFAULT_DEBOUNCE_MS = 250;
4037
4059
  /**
4038
4060
  * Full-regenerate writer of the MCP store into `~/.claude-code/mcp-config.json`.
@@ -4151,7 +4173,7 @@ var ClaudeCodeMcpSync = class {
4151
4173
  }
4152
4174
  computeDesired() {
4153
4175
  const desired = /* @__PURE__ */ new Map();
4154
- for (const { id, entry } of this.manager.listServers()) desired.set(id, this.toClaudeCodeEntry(entry));
4176
+ for (const { id, entry } of this.manager.listServers()) desired.set(id, this.toClaudeCodeEntry(entry, id));
4155
4177
  return desired;
4156
4178
  }
4157
4179
  /**
@@ -4160,11 +4182,13 @@ var ClaudeCodeMcpSync = class {
4160
4182
  * with the documented `type` discriminator (`sse` → `sse`, `streamable-http`
4161
4183
  * → `http`).
4162
4184
  */
4163
- toClaudeCodeEntry(entry) {
4185
+ toClaudeCodeEntry(entry, id) {
4164
4186
  const cfg = toServerConfig(entry);
4165
4187
  if ("command" in cfg) {
4166
4188
  const out = { command: cfg.command };
4167
- if (cfg.args && cfg.args.length > 0) out.args = cfg.args;
4189
+ const args = cfg.args && cfg.args.length > 0 ? [...cfg.args] : [];
4190
+ if (id === ALFE_PLATFORM_SERVER_ID && !args.some((a) => a === "--profile" || a.startsWith("--profile="))) args.push("--profile", "claude-code");
4191
+ if (args.length > 0) out.args = args;
4168
4192
  const env = this.withAlfeApiKey(cfg.env);
4169
4193
  if (Object.keys(env).length > 0) out.env = env;
4170
4194
  return out;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfe.ai/integrations",
3
- "version": "0.5.1",
3
+ "version": "0.5.3",
4
4
  "description": "Integration lifecycle management for Alfe — registry, resolution, installation, and state",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -14,8 +14,8 @@
14
14
  "dependencies": {
15
15
  "@auriclabs/logger": "^0.1.1",
16
16
  "yaml": ">=2.8.3",
17
- "@alfe.ai/integration-manifest": "^0.3.2",
18
- "@alfe.ai/mcp-bundler": "^0.3.1"
17
+ "@alfe.ai/integration-manifest": "^0.3.3",
18
+ "@alfe.ai/mcp-bundler": "^0.3.2"
19
19
  },
20
20
  "files": [
21
21
  "dist"