@alfe.ai/mcp-bundler 0.0.1 → 0.1.0
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.cjs +592 -0
- package/dist/index.d.cts +234 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +234 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +587 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -235,7 +235,240 @@ declare function buildNamespacedToolName(server: string, tool: string): string;
|
|
|
235
235
|
*/
|
|
236
236
|
declare function disambiguateAgainst(candidate: string, taken: ReadonlySet<string>): string;
|
|
237
237
|
//# sourceMappingURL=tool-naming.d.ts.map
|
|
238
|
+
//#endregion
|
|
239
|
+
//#region src/store.d.ts
|
|
240
|
+
/**
|
|
241
|
+
* Where a server entry came from. Used by `removeServersByOwner` so an
|
|
242
|
+
* integration uninstall can drop only its own entries without touching
|
|
243
|
+
* `cli`-owned (e.g. `alfe-platform`) or `manual`-owned (user-added) ones.
|
|
244
|
+
*/
|
|
245
|
+
type ServerOwner = 'cli' | `integration:${string}` | 'manual';
|
|
246
|
+
interface StoredServerCommon {
|
|
247
|
+
/** Where the entry came from — controls bulk-removal semantics. */
|
|
248
|
+
owner: ServerOwner;
|
|
249
|
+
/** ISO timestamp of first registration; preserved across updates. */
|
|
250
|
+
addedAt: string;
|
|
251
|
+
/** Optional semver of the providing package (e.g. `@alfe.ai/mcp-server` for `alfe-platform`). Used for drift detection on CLI upgrade. */
|
|
252
|
+
version?: string;
|
|
253
|
+
}
|
|
254
|
+
type StoredServerEntry = (StoredServerCommon & {
|
|
255
|
+
transport: 'stdio';
|
|
256
|
+
} & StdioServerConfig) | (StoredServerCommon & {
|
|
257
|
+
transport: 'sse' | 'streamable-http';
|
|
258
|
+
} & RemoteServerConfig);
|
|
259
|
+
interface StoreSchema {
|
|
260
|
+
servers: Record<string, StoredServerEntry>;
|
|
261
|
+
config: {
|
|
262
|
+
sessionIdleTtlMs?: number;
|
|
263
|
+
};
|
|
264
|
+
/**
|
|
265
|
+
* Server names this manager has written into `openclaw.json#mcp.servers.*`.
|
|
266
|
+
* Used to compute the mirror-write diff without re-reading openclaw.json
|
|
267
|
+
* (which would be a second source of truth). Foreign keys not listed here
|
|
268
|
+
* are preserved across mirror writes.
|
|
269
|
+
*/
|
|
270
|
+
_ownedOpenclawKeys: string[];
|
|
271
|
+
}
|
|
272
|
+
interface StoreOptions {
|
|
273
|
+
/** Absolute path to the store file. Defaults to `~/.alfe/mcp/servers.json`. */
|
|
274
|
+
path?: string;
|
|
275
|
+
logger?: Logger;
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* On-disk source of truth for the bundler's configured servers.
|
|
279
|
+
*
|
|
280
|
+
* Mutations go through `update()` (read-modify-write with atomic
|
|
281
|
+
* temp+rename) so a concurrent writer (e.g. two `alfe mcp add` invocations
|
|
282
|
+
* racing) can't lose data — the second writer reads the first's state.
|
|
283
|
+
*
|
|
284
|
+
* Schema is owner-tagged so `removeServersByOwner` can implement
|
|
285
|
+
* integration uninstall without touching CLI-owned or manual entries.
|
|
286
|
+
*/
|
|
287
|
+
declare class Store {
|
|
288
|
+
private readonly storePath;
|
|
289
|
+
private readonly logger?;
|
|
290
|
+
private watcher?;
|
|
291
|
+
private watcherListeners;
|
|
292
|
+
private rewatchTimer?;
|
|
293
|
+
constructor(opts?: StoreOptions);
|
|
294
|
+
get path(): string;
|
|
295
|
+
read(): StoreSchema;
|
|
296
|
+
/**
|
|
297
|
+
* Read-modify-write with atomic temp+rename, guarded by an
|
|
298
|
+
* inter-process lock file. Caller passes a pure function that
|
|
299
|
+
* produces the next state; this serialises the mutation to disk in
|
|
300
|
+
* one rename, which is atomic on POSIX and on Windows when the
|
|
301
|
+
* target path is on the same volume.
|
|
302
|
+
*
|
|
303
|
+
* The lock guards the read-then-rename window so two processes
|
|
304
|
+
* (e.g. two `alfe mcp add` shells, or the CLI racing the daemon)
|
|
305
|
+
* can't drop each other's writes. The lock file is at
|
|
306
|
+
* `<storePath>.lock`; stale locks (older than `LOCK_STALE_MS`) are
|
|
307
|
+
* stolen so a crashed writer doesn't wedge the store.
|
|
308
|
+
*
|
|
309
|
+
* Pure-function shape (instead of a `read()` then `write(next)`
|
|
310
|
+
* pair) intentionally — it keeps the read-modify-write contract
|
|
311
|
+
* local to each caller so two updates back-to-back never see each
|
|
312
|
+
* other's partial state.
|
|
313
|
+
*/
|
|
314
|
+
update(fn: (cur: StoreSchema) => StoreSchema): StoreSchema;
|
|
315
|
+
/**
|
|
316
|
+
* Acquire an inter-process file lock by atomically creating a
|
|
317
|
+
* sentinel via `openSync(lockPath, 'wx')`. Spins with bounded
|
|
318
|
+
* backoff up to `LOCK_WAIT_MS`. If the lock file is older than
|
|
319
|
+
* `LOCK_STALE_MS` it's assumed orphaned (writer crashed mid-update)
|
|
320
|
+
* and stolen — the write window is sub-second in practice, so
|
|
321
|
+
* holding the lock for >5s means something went wrong.
|
|
322
|
+
*
|
|
323
|
+
* Returns the release function. Single-process callers are
|
|
324
|
+
* unaffected — re-entering the same process spins briefly while
|
|
325
|
+
* the prior call's `finally` runs.
|
|
326
|
+
*/
|
|
327
|
+
private acquireLock;
|
|
328
|
+
private lockIsStale;
|
|
329
|
+
/**
|
|
330
|
+
* Watch the store file for external changes (e.g. another `alfe mcp add`
|
|
331
|
+
* shelling out from a separate process). Returns an unsubscribe fn.
|
|
332
|
+
*
|
|
333
|
+
* Coalesces bursts via a 50 ms debounce — editors and atomic-rename
|
|
334
|
+
* writers commonly fire multiple events per logical save.
|
|
335
|
+
*/
|
|
336
|
+
watch(cb: () => void): () => void;
|
|
337
|
+
dispose(): void;
|
|
338
|
+
private ensureWatcher;
|
|
339
|
+
private disposeWatcher;
|
|
340
|
+
}
|
|
341
|
+
declare function defaultStorePath(): string;
|
|
342
|
+
/** Pull the runtime config (transport + transport-specific fields) out of a stored entry. */
|
|
343
|
+
declare function toServerConfig(entry: StoredServerEntry): McpServerConfig;
|
|
344
|
+
/** Build a stored entry from a runtime config + ownership metadata. */
|
|
345
|
+
declare function toStoredEntry(config: McpServerConfig, meta: {
|
|
346
|
+
owner: ServerOwner;
|
|
347
|
+
transport?: McpTransportKind;
|
|
348
|
+
version?: string;
|
|
349
|
+
addedAt?: string;
|
|
350
|
+
}): StoredServerEntry;
|
|
351
|
+
//#endregion
|
|
352
|
+
//#region src/manager.d.ts
|
|
353
|
+
/**
|
|
354
|
+
* Shells out to `openclaw config set --batch-json` / `openclaw config unset`
|
|
355
|
+
* to keep `openclaw.json#mcp.servers.*` in sync with the bundler store.
|
|
356
|
+
* Default executor reuses the same machinery the integrations applier has
|
|
357
|
+
* used for ~6 months; tests inject a fake.
|
|
358
|
+
*/
|
|
359
|
+
interface OpenclawExecutor {
|
|
360
|
+
setBatch: (batch: {
|
|
361
|
+
path: string;
|
|
362
|
+
value: unknown;
|
|
363
|
+
}[]) => Promise<void>;
|
|
364
|
+
unset: (path: string) => Promise<void>;
|
|
365
|
+
}
|
|
366
|
+
declare const defaultOpenclawExecutor: OpenclawExecutor;
|
|
367
|
+
interface ManagerOptions {
|
|
368
|
+
/** Pre-constructed store. If omitted, one is built with default options. */
|
|
369
|
+
store?: Store;
|
|
370
|
+
/** Override for the openclaw mirror executor (tests inject a fake). */
|
|
371
|
+
executor?: OpenclawExecutor;
|
|
372
|
+
logger?: Logger;
|
|
373
|
+
/**
|
|
374
|
+
* Debounce window for the mirror-write. Mutations landing inside this
|
|
375
|
+
* window coalesce into a single openclaw config update, avoiding the
|
|
376
|
+
* auto-restart race where two back-to-back `addServer` calls hit an
|
|
377
|
+
* openclaw that's mid-shutdown from the first write's watcher.
|
|
378
|
+
*/
|
|
379
|
+
mirrorDebounceMs?: number;
|
|
380
|
+
}
|
|
381
|
+
interface AddServerOptions {
|
|
382
|
+
/** Required — flat-namespace key under `mcp.servers.*`. */
|
|
383
|
+
id: string;
|
|
384
|
+
/** Marks ownership for bulk removal. Defaults to `manual`. */
|
|
385
|
+
owner?: ServerOwner;
|
|
386
|
+
/** Semver of the providing package; used for CLI version-drift detection. */
|
|
387
|
+
version?: string;
|
|
388
|
+
/** Explicit transport hint for remote configs. Defaults to inferring from `config`. */
|
|
389
|
+
transport?: McpTransportKind;
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Bundler manager — owns the alfe store, mirrors it into openclaw.json,
|
|
393
|
+
* and surfaces a small CRUD API the CLI and integration applier both
|
|
394
|
+
* call into.
|
|
395
|
+
*
|
|
396
|
+
* The store is the Alfe-owned source of truth; openclaw.json is a
|
|
397
|
+
* derived mirror so the runtime keeps consuming its existing format.
|
|
398
|
+
*/
|
|
399
|
+
declare class Manager {
|
|
400
|
+
private readonly store;
|
|
401
|
+
private readonly executor;
|
|
402
|
+
private readonly logger?;
|
|
403
|
+
private readonly mirrorDebounceMs;
|
|
404
|
+
private mirrorTimer?;
|
|
405
|
+
private mirrorPromise;
|
|
406
|
+
private mirrorPending?;
|
|
407
|
+
private bundler?;
|
|
408
|
+
private changeListeners;
|
|
409
|
+
private storeUnsubscribe?;
|
|
410
|
+
constructor(opts?: ManagerOptions);
|
|
411
|
+
/** Direct accessor — handy for tests and the CLI's `alfe mcp list`. */
|
|
412
|
+
getStore(): Store;
|
|
413
|
+
/**
|
|
414
|
+
* Register or overwrite a server entry. Resolves as soon as the store
|
|
415
|
+
* mutation is committed to disk — the openclaw.json mirror runs async
|
|
416
|
+
* in the background and is debounced so back-to-back calls coalesce
|
|
417
|
+
* into one runtime restart. Call `flush()` to await the mirror.
|
|
418
|
+
*/
|
|
419
|
+
addServer(config: McpServerConfig, opts: AddServerOptions): Promise<void>;
|
|
420
|
+
/**
|
|
421
|
+
* Remove a single server entry. No-op if the id isn't in the store.
|
|
422
|
+
* Refuses to remove an entry whose owner doesn't match `expectedOwner`
|
|
423
|
+
* when supplied — the CLI uses this to guard `alfe mcp remove` from
|
|
424
|
+
* accidentally clobbering integration- or cli-owned entries.
|
|
425
|
+
*
|
|
426
|
+
* Resolves as soon as the store mutation is committed. Mirror runs
|
|
427
|
+
* async; call `flush()` to await it.
|
|
428
|
+
*/
|
|
429
|
+
removeServer(id: string, opts?: {
|
|
430
|
+
expectedOwner?: ServerOwner;
|
|
431
|
+
}): Promise<boolean>;
|
|
432
|
+
/** Drop every entry whose owner matches — used by integration uninstall. */
|
|
433
|
+
removeServersByOwner(owner: ServerOwner): Promise<string[]>;
|
|
434
|
+
/** Read-only snapshot for `alfe mcp list` and similar UIs. */
|
|
435
|
+
listServers(): {
|
|
436
|
+
id: string;
|
|
437
|
+
entry: StoredServerEntry;
|
|
438
|
+
}[];
|
|
439
|
+
/**
|
|
440
|
+
* Push the current store contents into a bundler instance (which owns
|
|
441
|
+
* connections / tools). Wires up a store watcher so external mutations
|
|
442
|
+
* (e.g. another shell running `alfe mcp add`) re-reconcile.
|
|
443
|
+
*/
|
|
444
|
+
loadIntoBundler(bundler: McpBundler): Promise<void>;
|
|
445
|
+
/** Subscribe to store mutations. Returns an unsubscribe fn. */
|
|
446
|
+
onChange(cb: () => void): () => void;
|
|
447
|
+
/**
|
|
448
|
+
* Cancel any pending mirror-write, flush the in-flight one, and stop
|
|
449
|
+
* watching the store. Safe to call multiple times.
|
|
450
|
+
*/
|
|
451
|
+
dispose(): Promise<void>;
|
|
452
|
+
/**
|
|
453
|
+
* Force the debounced mirror to run now and wait for it to finish.
|
|
454
|
+
* Surfaces the executor error if the mirror failed — callers wrap in
|
|
455
|
+
* try/catch (or .rejects in tests) if they need to handle it.
|
|
456
|
+
*/
|
|
457
|
+
flush(): Promise<void>;
|
|
458
|
+
private scheduleMirror;
|
|
459
|
+
private runMirror;
|
|
460
|
+
/**
|
|
461
|
+
* Compute the diff between this manager's owned set and what the store
|
|
462
|
+
* declares now, then apply the openclaw config delta. Foreign keys
|
|
463
|
+
* (entries in openclaw.json#mcp.servers.* not in our store) are
|
|
464
|
+
* preserved — we only touch the names we previously claimed.
|
|
465
|
+
*/
|
|
466
|
+
private applyMirror;
|
|
467
|
+
private reconcileBundler;
|
|
468
|
+
private fireChange;
|
|
469
|
+
}
|
|
470
|
+
//# sourceMappingURL=manager.d.ts.map
|
|
238
471
|
|
|
239
472
|
//#endregion
|
|
240
|
-
export { type BundlerOptions, Connection, type ConnectionDeps, type Logger, McpBundler, type McpClientHandle, type McpServerConfig, type McpToolCallResult, type McpToolDescriptor, type McpTransportKind, type ReconcileDiff, type RemoteServerConfig, STDIO_ENV_DENYLIST, type StdioServerConfig, buildNamespacedToolName, defaultConnect, disambiguateAgainst, sanitizeNameSegment, sanitizeStdioEnv };
|
|
473
|
+
export { type AddServerOptions, type BundlerOptions, Connection, type ConnectionDeps, type Logger, Manager, type ManagerOptions, McpBundler, type McpClientHandle, type McpServerConfig, type McpToolCallResult, type McpToolDescriptor, type McpTransportKind, type OpenclawExecutor, type ReconcileDiff, type RemoteServerConfig, STDIO_ENV_DENYLIST, type ServerOwner, type StdioServerConfig, Store, type StoreOptions, type StoreSchema, type StoredServerEntry, buildNamespacedToolName, defaultConnect, defaultOpenclawExecutor, defaultStorePath, disambiguateAgainst, sanitizeNameSegment, sanitizeStdioEnv, toServerConfig, toStoredEntry };
|
|
241
474
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/types.ts","../src/connection.ts","../src/bundler.ts","../src/tool-naming.ts"],"mappings":";;AAIA;;;AAAkD,KAAtC,eAAA,GAAkB,iBAAoB,GAAA,kBAAA;AAAkB,UAEnD,iBAAA,CAFmD;EAEnD,OAAA,EAAA,MAAA;EAOA,IAAA,CAAA,EAAA,MAAA,EAAA;EAOL,GAAA,CAAA,EAXJ,MAWI,CAAA,MAAgB,EAAA,MAAA,CAAA;EAKX,GAAA,CAAA,EAAA,MAAA;AAejB;AAOiB,UAlCA,kBAAA,CAkCM;EAAA,GAAA,EAAA,MAAA;WACO,C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A;AAOA;AAKA;AAeiB,iBGzBD,mBAAA,CHyBc,KAAA,EAAA,MAAA,CAAA,EAAA,MAAA;AAOb,iBG5BD,uBAAA,CH4BO,MAAA,EAAA,MAAA,EAAA,IAAA,EAAA,MAAA,CAAA,EAAA,MAAA;;;;;;AAIa,iBGlBpB,mBAAA,CHkBoB,SAAA,EAAA,MAAA,EAAA,KAAA,EGlB0B,WHkB1B,CAAA,MAAA,CAAA,CAAA,EAAA,MAAA;AAGpC"}
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/types.ts","../src/connection.ts","../src/bundler.ts","../src/tool-naming.ts","../src/store.ts","../src/manager.ts"],"mappings":";;AAIA;;;AAAkD,KAAtC,eAAA,GAAkB,iBAAoB,GAAA,kBAAA;AAAkB,UAEnD,iBAAA,CAFmD;EAEnD,OAAA,EAAA,MAAA;EAOA,IAAA,CAAA,EAAA,MAAA,EAAA;EAOL,GAAA,CAAA,EAXJ,MAWI,CAAA,MAAgB,EAAA,MAAA,CAAA;EAKX,GAAA,CAAA,EAAA,MAAA;AAejB;AAOiB,UAlCA,kBAAA,CAkCM;EAAA,GAAA,EAAA,MAAA;WACO,CAAA,EAAA,KAAA,GAAA,iBAAA;SACD,CAAA,EAjCjB,MAiCiB,CAAA,MAAA,EAAA,MAAA,CAAA;qBACA,CAAA,EAAA,MAAA;;AACO,KA/BxB,gBAAA,GA+BwB,OAAA,GAAA,KAAA,GAAA,iBAAA;AAGpC;AAKA;;UAlCiB,iBAAA;;ECrBJ,QAAA,EAAA,MAAA;EAUG;EAAgB,MAAA,EAAA,MAAA;;UAA2C,EAAA,MAAA;EAAM;EAUhE,KAAA,EAAA,MAAA;EAAc;aAMX,EAAA,MAAA;;YAAoB,EDO1B,MCP0B,CAAA,MAAA,EAAA,OAAA,CAAA;;AAQvB,UDEA,aAAA,CCFe;EAAA,KAAA,EAAA,MAAA,EAAA;SAC0C,EAAA,MAAA,EAAA;SAA3D,EAAA,MAAA,EAAA;WAC2C,E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C,WAAA,CAAA,CAAA,EAAA;IAIA,EAAA,EAAA,MAAA;IAcA,KAAA,EEyIsB,iBFzIH;;;;ACXnC;AAAqE;AAWrE;EAA6B,eAAA,CAAA,OAAA,ECmJI,UDnJJ,CAAA,ECmJiB,ODnJjB,CAAA,IAAA,CAAA;;UACsB,CAAA,EAAA,EAAA,GAAA,GAAA,IAAA,CAAA,EAAA,GAAA,GAAA,IAAA;;;;AAGnD;EAA4B,OAAA,CAAA,CAAA,ECqKT,ODrKS,CAAA,IAAA,CAAA;;;;AAsB5B;AAgBA;EAAkB,KAAA,CAAA,CAAA,ECsJD,ODtJC,CAAA,IAAA,CAAA;UAOE,cAAA;UASV,SAAA;;;;;AA2MV;AAKA;EAA8B,QAAA,WAAA;UAAQ,gBAAA;UAAoB,UAAA;;AAiB1D"}
|
package/dist/index.d.ts
CHANGED
|
@@ -235,7 +235,240 @@ declare function buildNamespacedToolName(server: string, tool: string): string;
|
|
|
235
235
|
*/
|
|
236
236
|
declare function disambiguateAgainst(candidate: string, taken: ReadonlySet<string>): string;
|
|
237
237
|
//# sourceMappingURL=tool-naming.d.ts.map
|
|
238
|
+
//#endregion
|
|
239
|
+
//#region src/store.d.ts
|
|
240
|
+
/**
|
|
241
|
+
* Where a server entry came from. Used by `removeServersByOwner` so an
|
|
242
|
+
* integration uninstall can drop only its own entries without touching
|
|
243
|
+
* `cli`-owned (e.g. `alfe-platform`) or `manual`-owned (user-added) ones.
|
|
244
|
+
*/
|
|
245
|
+
type ServerOwner = 'cli' | `integration:${string}` | 'manual';
|
|
246
|
+
interface StoredServerCommon {
|
|
247
|
+
/** Where the entry came from — controls bulk-removal semantics. */
|
|
248
|
+
owner: ServerOwner;
|
|
249
|
+
/** ISO timestamp of first registration; preserved across updates. */
|
|
250
|
+
addedAt: string;
|
|
251
|
+
/** Optional semver of the providing package (e.g. `@alfe.ai/mcp-server` for `alfe-platform`). Used for drift detection on CLI upgrade. */
|
|
252
|
+
version?: string;
|
|
253
|
+
}
|
|
254
|
+
type StoredServerEntry = (StoredServerCommon & {
|
|
255
|
+
transport: 'stdio';
|
|
256
|
+
} & StdioServerConfig) | (StoredServerCommon & {
|
|
257
|
+
transport: 'sse' | 'streamable-http';
|
|
258
|
+
} & RemoteServerConfig);
|
|
259
|
+
interface StoreSchema {
|
|
260
|
+
servers: Record<string, StoredServerEntry>;
|
|
261
|
+
config: {
|
|
262
|
+
sessionIdleTtlMs?: number;
|
|
263
|
+
};
|
|
264
|
+
/**
|
|
265
|
+
* Server names this manager has written into `openclaw.json#mcp.servers.*`.
|
|
266
|
+
* Used to compute the mirror-write diff without re-reading openclaw.json
|
|
267
|
+
* (which would be a second source of truth). Foreign keys not listed here
|
|
268
|
+
* are preserved across mirror writes.
|
|
269
|
+
*/
|
|
270
|
+
_ownedOpenclawKeys: string[];
|
|
271
|
+
}
|
|
272
|
+
interface StoreOptions {
|
|
273
|
+
/** Absolute path to the store file. Defaults to `~/.alfe/mcp/servers.json`. */
|
|
274
|
+
path?: string;
|
|
275
|
+
logger?: Logger;
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* On-disk source of truth for the bundler's configured servers.
|
|
279
|
+
*
|
|
280
|
+
* Mutations go through `update()` (read-modify-write with atomic
|
|
281
|
+
* temp+rename) so a concurrent writer (e.g. two `alfe mcp add` invocations
|
|
282
|
+
* racing) can't lose data — the second writer reads the first's state.
|
|
283
|
+
*
|
|
284
|
+
* Schema is owner-tagged so `removeServersByOwner` can implement
|
|
285
|
+
* integration uninstall without touching CLI-owned or manual entries.
|
|
286
|
+
*/
|
|
287
|
+
declare class Store {
|
|
288
|
+
private readonly storePath;
|
|
289
|
+
private readonly logger?;
|
|
290
|
+
private watcher?;
|
|
291
|
+
private watcherListeners;
|
|
292
|
+
private rewatchTimer?;
|
|
293
|
+
constructor(opts?: StoreOptions);
|
|
294
|
+
get path(): string;
|
|
295
|
+
read(): StoreSchema;
|
|
296
|
+
/**
|
|
297
|
+
* Read-modify-write with atomic temp+rename, guarded by an
|
|
298
|
+
* inter-process lock file. Caller passes a pure function that
|
|
299
|
+
* produces the next state; this serialises the mutation to disk in
|
|
300
|
+
* one rename, which is atomic on POSIX and on Windows when the
|
|
301
|
+
* target path is on the same volume.
|
|
302
|
+
*
|
|
303
|
+
* The lock guards the read-then-rename window so two processes
|
|
304
|
+
* (e.g. two `alfe mcp add` shells, or the CLI racing the daemon)
|
|
305
|
+
* can't drop each other's writes. The lock file is at
|
|
306
|
+
* `<storePath>.lock`; stale locks (older than `LOCK_STALE_MS`) are
|
|
307
|
+
* stolen so a crashed writer doesn't wedge the store.
|
|
308
|
+
*
|
|
309
|
+
* Pure-function shape (instead of a `read()` then `write(next)`
|
|
310
|
+
* pair) intentionally — it keeps the read-modify-write contract
|
|
311
|
+
* local to each caller so two updates back-to-back never see each
|
|
312
|
+
* other's partial state.
|
|
313
|
+
*/
|
|
314
|
+
update(fn: (cur: StoreSchema) => StoreSchema): StoreSchema;
|
|
315
|
+
/**
|
|
316
|
+
* Acquire an inter-process file lock by atomically creating a
|
|
317
|
+
* sentinel via `openSync(lockPath, 'wx')`. Spins with bounded
|
|
318
|
+
* backoff up to `LOCK_WAIT_MS`. If the lock file is older than
|
|
319
|
+
* `LOCK_STALE_MS` it's assumed orphaned (writer crashed mid-update)
|
|
320
|
+
* and stolen — the write window is sub-second in practice, so
|
|
321
|
+
* holding the lock for >5s means something went wrong.
|
|
322
|
+
*
|
|
323
|
+
* Returns the release function. Single-process callers are
|
|
324
|
+
* unaffected — re-entering the same process spins briefly while
|
|
325
|
+
* the prior call's `finally` runs.
|
|
326
|
+
*/
|
|
327
|
+
private acquireLock;
|
|
328
|
+
private lockIsStale;
|
|
329
|
+
/**
|
|
330
|
+
* Watch the store file for external changes (e.g. another `alfe mcp add`
|
|
331
|
+
* shelling out from a separate process). Returns an unsubscribe fn.
|
|
332
|
+
*
|
|
333
|
+
* Coalesces bursts via a 50 ms debounce — editors and atomic-rename
|
|
334
|
+
* writers commonly fire multiple events per logical save.
|
|
335
|
+
*/
|
|
336
|
+
watch(cb: () => void): () => void;
|
|
337
|
+
dispose(): void;
|
|
338
|
+
private ensureWatcher;
|
|
339
|
+
private disposeWatcher;
|
|
340
|
+
}
|
|
341
|
+
declare function defaultStorePath(): string;
|
|
342
|
+
/** Pull the runtime config (transport + transport-specific fields) out of a stored entry. */
|
|
343
|
+
declare function toServerConfig(entry: StoredServerEntry): McpServerConfig;
|
|
344
|
+
/** Build a stored entry from a runtime config + ownership metadata. */
|
|
345
|
+
declare function toStoredEntry(config: McpServerConfig, meta: {
|
|
346
|
+
owner: ServerOwner;
|
|
347
|
+
transport?: McpTransportKind;
|
|
348
|
+
version?: string;
|
|
349
|
+
addedAt?: string;
|
|
350
|
+
}): StoredServerEntry;
|
|
351
|
+
//#endregion
|
|
352
|
+
//#region src/manager.d.ts
|
|
353
|
+
/**
|
|
354
|
+
* Shells out to `openclaw config set --batch-json` / `openclaw config unset`
|
|
355
|
+
* to keep `openclaw.json#mcp.servers.*` in sync with the bundler store.
|
|
356
|
+
* Default executor reuses the same machinery the integrations applier has
|
|
357
|
+
* used for ~6 months; tests inject a fake.
|
|
358
|
+
*/
|
|
359
|
+
interface OpenclawExecutor {
|
|
360
|
+
setBatch: (batch: {
|
|
361
|
+
path: string;
|
|
362
|
+
value: unknown;
|
|
363
|
+
}[]) => Promise<void>;
|
|
364
|
+
unset: (path: string) => Promise<void>;
|
|
365
|
+
}
|
|
366
|
+
declare const defaultOpenclawExecutor: OpenclawExecutor;
|
|
367
|
+
interface ManagerOptions {
|
|
368
|
+
/** Pre-constructed store. If omitted, one is built with default options. */
|
|
369
|
+
store?: Store;
|
|
370
|
+
/** Override for the openclaw mirror executor (tests inject a fake). */
|
|
371
|
+
executor?: OpenclawExecutor;
|
|
372
|
+
logger?: Logger;
|
|
373
|
+
/**
|
|
374
|
+
* Debounce window for the mirror-write. Mutations landing inside this
|
|
375
|
+
* window coalesce into a single openclaw config update, avoiding the
|
|
376
|
+
* auto-restart race where two back-to-back `addServer` calls hit an
|
|
377
|
+
* openclaw that's mid-shutdown from the first write's watcher.
|
|
378
|
+
*/
|
|
379
|
+
mirrorDebounceMs?: number;
|
|
380
|
+
}
|
|
381
|
+
interface AddServerOptions {
|
|
382
|
+
/** Required — flat-namespace key under `mcp.servers.*`. */
|
|
383
|
+
id: string;
|
|
384
|
+
/** Marks ownership for bulk removal. Defaults to `manual`. */
|
|
385
|
+
owner?: ServerOwner;
|
|
386
|
+
/** Semver of the providing package; used for CLI version-drift detection. */
|
|
387
|
+
version?: string;
|
|
388
|
+
/** Explicit transport hint for remote configs. Defaults to inferring from `config`. */
|
|
389
|
+
transport?: McpTransportKind;
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Bundler manager — owns the alfe store, mirrors it into openclaw.json,
|
|
393
|
+
* and surfaces a small CRUD API the CLI and integration applier both
|
|
394
|
+
* call into.
|
|
395
|
+
*
|
|
396
|
+
* The store is the Alfe-owned source of truth; openclaw.json is a
|
|
397
|
+
* derived mirror so the runtime keeps consuming its existing format.
|
|
398
|
+
*/
|
|
399
|
+
declare class Manager {
|
|
400
|
+
private readonly store;
|
|
401
|
+
private readonly executor;
|
|
402
|
+
private readonly logger?;
|
|
403
|
+
private readonly mirrorDebounceMs;
|
|
404
|
+
private mirrorTimer?;
|
|
405
|
+
private mirrorPromise;
|
|
406
|
+
private mirrorPending?;
|
|
407
|
+
private bundler?;
|
|
408
|
+
private changeListeners;
|
|
409
|
+
private storeUnsubscribe?;
|
|
410
|
+
constructor(opts?: ManagerOptions);
|
|
411
|
+
/** Direct accessor — handy for tests and the CLI's `alfe mcp list`. */
|
|
412
|
+
getStore(): Store;
|
|
413
|
+
/**
|
|
414
|
+
* Register or overwrite a server entry. Resolves as soon as the store
|
|
415
|
+
* mutation is committed to disk — the openclaw.json mirror runs async
|
|
416
|
+
* in the background and is debounced so back-to-back calls coalesce
|
|
417
|
+
* into one runtime restart. Call `flush()` to await the mirror.
|
|
418
|
+
*/
|
|
419
|
+
addServer(config: McpServerConfig, opts: AddServerOptions): Promise<void>;
|
|
420
|
+
/**
|
|
421
|
+
* Remove a single server entry. No-op if the id isn't in the store.
|
|
422
|
+
* Refuses to remove an entry whose owner doesn't match `expectedOwner`
|
|
423
|
+
* when supplied — the CLI uses this to guard `alfe mcp remove` from
|
|
424
|
+
* accidentally clobbering integration- or cli-owned entries.
|
|
425
|
+
*
|
|
426
|
+
* Resolves as soon as the store mutation is committed. Mirror runs
|
|
427
|
+
* async; call `flush()` to await it.
|
|
428
|
+
*/
|
|
429
|
+
removeServer(id: string, opts?: {
|
|
430
|
+
expectedOwner?: ServerOwner;
|
|
431
|
+
}): Promise<boolean>;
|
|
432
|
+
/** Drop every entry whose owner matches — used by integration uninstall. */
|
|
433
|
+
removeServersByOwner(owner: ServerOwner): Promise<string[]>;
|
|
434
|
+
/** Read-only snapshot for `alfe mcp list` and similar UIs. */
|
|
435
|
+
listServers(): {
|
|
436
|
+
id: string;
|
|
437
|
+
entry: StoredServerEntry;
|
|
438
|
+
}[];
|
|
439
|
+
/**
|
|
440
|
+
* Push the current store contents into a bundler instance (which owns
|
|
441
|
+
* connections / tools). Wires up a store watcher so external mutations
|
|
442
|
+
* (e.g. another shell running `alfe mcp add`) re-reconcile.
|
|
443
|
+
*/
|
|
444
|
+
loadIntoBundler(bundler: McpBundler): Promise<void>;
|
|
445
|
+
/** Subscribe to store mutations. Returns an unsubscribe fn. */
|
|
446
|
+
onChange(cb: () => void): () => void;
|
|
447
|
+
/**
|
|
448
|
+
* Cancel any pending mirror-write, flush the in-flight one, and stop
|
|
449
|
+
* watching the store. Safe to call multiple times.
|
|
450
|
+
*/
|
|
451
|
+
dispose(): Promise<void>;
|
|
452
|
+
/**
|
|
453
|
+
* Force the debounced mirror to run now and wait for it to finish.
|
|
454
|
+
* Surfaces the executor error if the mirror failed — callers wrap in
|
|
455
|
+
* try/catch (or .rejects in tests) if they need to handle it.
|
|
456
|
+
*/
|
|
457
|
+
flush(): Promise<void>;
|
|
458
|
+
private scheduleMirror;
|
|
459
|
+
private runMirror;
|
|
460
|
+
/**
|
|
461
|
+
* Compute the diff between this manager's owned set and what the store
|
|
462
|
+
* declares now, then apply the openclaw config delta. Foreign keys
|
|
463
|
+
* (entries in openclaw.json#mcp.servers.* not in our store) are
|
|
464
|
+
* preserved — we only touch the names we previously claimed.
|
|
465
|
+
*/
|
|
466
|
+
private applyMirror;
|
|
467
|
+
private reconcileBundler;
|
|
468
|
+
private fireChange;
|
|
469
|
+
}
|
|
470
|
+
//# sourceMappingURL=manager.d.ts.map
|
|
238
471
|
|
|
239
472
|
//#endregion
|
|
240
|
-
export { type BundlerOptions, Connection, type ConnectionDeps, type Logger, McpBundler, type McpClientHandle, type McpServerConfig, type McpToolCallResult, type McpToolDescriptor, type McpTransportKind, type ReconcileDiff, type RemoteServerConfig, STDIO_ENV_DENYLIST, type StdioServerConfig, buildNamespacedToolName, defaultConnect, disambiguateAgainst, sanitizeNameSegment, sanitizeStdioEnv };
|
|
473
|
+
export { type AddServerOptions, type BundlerOptions, Connection, type ConnectionDeps, type Logger, Manager, type ManagerOptions, McpBundler, type McpClientHandle, type McpServerConfig, type McpToolCallResult, type McpToolDescriptor, type McpTransportKind, type OpenclawExecutor, type ReconcileDiff, type RemoteServerConfig, STDIO_ENV_DENYLIST, type ServerOwner, type StdioServerConfig, Store, type StoreOptions, type StoreSchema, type StoredServerEntry, buildNamespacedToolName, defaultConnect, defaultOpenclawExecutor, defaultStorePath, disambiguateAgainst, sanitizeNameSegment, sanitizeStdioEnv, toServerConfig, toStoredEntry };
|
|
241
474
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/types.ts","../src/connection.ts","../src/bundler.ts","../src/tool-naming.ts"],"mappings":";;AAIA;;;AAAkD,KAAtC,eAAA,GAAkB,iBAAoB,GAAA,kBAAA;AAAkB,UAEnD,iBAAA,CA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OAAA,EAAA,MAAA,CAAA,ECgCwC,WDhCxC,CAAA,ECgCsD,ODhCtD,CCgC8D,iBDhC9D,CAAA;;;;;EA0CK,QAAA,aAAA;EA0BF;;;;SAAyC,CAAA,CAAA,ECI5C,ODJ4C,CAAA,IAAA,CAAA;EAAO,QAAA,cAAA;;;;;;;AD/LtE;;;;;AAEA;AAOA;AAOA;AAKA;AAeiB,iBGzBD,mBAAA,CHyBc,KAAA,EAAA,MAAA,CAAA,EAAA,MAAA;AAOb,iBG5BD,uBAAA,CH4BO,MAAA,EAAA,MAAA,EAAA,IAAA,EAAA,MAAA,CAAA,EAAA,MAAA;;;;;;AAIa,iBGlBpB,mBAAA,CHkBoB,SAAA,EAAA,MAAA,EAAA,KAAA,EGlB0B,WHkB1B,CAAA,MAAA,CAAA,CAAA,EAAA,MAAA;AAGpC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/types.ts","../src/connection.ts","../src/bundler.ts","../src/tool-naming.ts","../src/store.ts","../src/manager.ts"],"mappings":";;AAIA;;;AAAkD,KAAtC,eAAA,GAAkB,iBAAoB,GAAA,kBAAA;AAAkB,UAEnD,iBAAA,CAFmD;EAEnD,OAAA,EAAA,MAAA;EAOA,IAAA,CAAA,EAAA,MAAA,EAAA;EAOL,GAAA,CAAA,EAXJ,MAWI,CAAA,MAAgB,EAAA,MAAA,CAAA;EAKX,GAAA,CAAA,EAAA,MAAA;AAejB;AAOiB,UAlCA,kBAAA,CAkCM;EAAA,GAAA,EAAA,MAAA;WACO,CAAA,EAAA,KAAA,GAAA,iBAAA;SACD,CAAA,EAjCjB,MAiCiB,CAAA,MAAA,EAAA,MAAA,CAAA;qBACA,CAAA,EAAA,MAAA;;AACO,KA/BxB,gBAAA,GA+BwB,OAAA,GAAA,KAAA,GAAA,iBAAA;AAGpC;AAKA;;UAlCiB,iBAAA;;ECrBJ,QAAA,EAAA,MAAA;EAUG;EAAgB,MAAA,EAAA,MAAA;;UAA2C,EAAA,MAAA;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